Disclosure of Invention
In order to at least partially solve the technical problems mentioned in the background art, the scheme of the application provides a commodity file generation method and a commodity file generation device.
According to a first aspect of the present application, there is provided a method for generating a commodity document, wherein the method comprises: acquiring commodity attribute information; performing word segmentation processing on the commodity attribute information to obtain a plurality of associated words; extracting the plurality of associated words to obtain a plurality of keywords; and splicing the plurality of keywords to obtain the commodity copy. The commodity file generation method can effectively solve the technical problems of complex flow, low efficiency, poor effect and the like in the prior art.
Optionally, the performing word segmentation processing on the commodity attribute information to obtain a plurality of associated words includes: and matching the commodity attribute information with the vocabulary in a preset word bank according to a preset word segmentation algorithm to obtain the plurality of associated words.
Optionally, the extracting the multiple associated words to obtain multiple keywords includes: and judging the categories of the associated words, and extracting according to a preset rule to obtain the keywords.
Optionally, the splicing the plurality of keywords to obtain the commodity copy includes: and splicing the plurality of keywords according to a preset sequence to obtain the commodity file.
Optionally, the method for generating a commodity file further includes: and after the keywords are spliced, performing color rendering on the text content obtained by splicing to obtain the commodity copy.
Optionally, the rendering the text content obtained by splicing includes: and according to a preset rule, selecting one or more modifiers from a word-algae library, and inserting the modifiers into the text content to obtain the commodity case.
According to a second aspect of the present application, there is provided a commodity document generating apparatus, wherein the apparatus comprises: the acquisition module is used for acquiring commodity attribute information; the word segmentation module is used for carrying out word segmentation processing on the commodity attribute information to obtain a plurality of associated words; the extraction module is used for extracting the plurality of associated words to obtain a plurality of keywords; and the splicing module is used for splicing the plurality of keywords to obtain the commodity file.
Optionally, the word segmentation module is configured to perform word segmentation processing on the commodity attribute information in the following manner: and matching the commodity attribute information with the vocabulary in the word bank according to a preset word segmentation algorithm to obtain the plurality of associated words.
Optionally, the extracting module is configured to extract the multiple associated words by using the following method: and judging the categories of the associated words, and extracting according to a preset rule to obtain the keywords.
Optionally, the splicing device is configured to splice the plurality of keywords in the following manner: and splicing the plurality of keywords according to a preset sequence to obtain the commodity file.
Optionally, the device for generating a commodity file further comprises: and the color rendering module is used for rendering the text content obtained by splicing after the plurality of keywords are spliced to obtain the commodity copy.
Optionally, the rendering device is configured to render the text content obtained by splicing in the following manner: and according to a preset rule, selecting one or more modifiers from a word-algae library, and inserting the modifiers into the text content to obtain the commodity case.
According to a third aspect of the present application, there is provided an electronic apparatus, wherein the apparatus includes a memory and a processor, the memory stores a computer program, and the processor executes the computer program to implement the method for generating a product document as described above.
According to a fourth aspect of the present application, there is provided a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program, when executed, implements the article document generation method described above.
According to the commodity file generation method and device, the user is helped to save the current complicated flow steps, the user can finish the production of the commodity file in one key by only selecting the commodity, and the commodity file generation method and device are suitable for the file production of any kinds of commodities and any number of commodities, so that the labor cost and the time cost are greatly saved. In addition, the commodity file obtained by the commodity file generation method and device is more stable, the situation of misspelling does not exist, the word algae is more changeable in color moistening, and the display effect is better.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Specific embodiments of the present application are described in detail below with reference to the accompanying drawings.
In one embodiment of the present application, a method for generating a commodity document is provided, as shown in fig. 1, the method includes the following steps S101 to S104. Step S101: acquiring commodity attribute information; step S102: performing word segmentation processing on the commodity attribute information to obtain a plurality of associated words; step S103: extracting the plurality of associated words to obtain a plurality of keywords; step S104: and splicing the plurality of keywords to obtain the commodity copy.
According to the method, the commodity file is intelligently generated, the generation efficiency of the commodity file is effectively improved, the labor cost and the time cost of a user are saved, the obtained commodity file is more stable, and the display effect is better.
In step S101, product attribute information is acquired.
According to the embodiment of the present application, in order to obtain the article document, first, article attribute information is acquired, which includes but is not limited to: brand of goods, name of goods, attribute features of goods, SKU information of goods, etc. The product attribute information may be obtained through any suitable means, such as through an API interface provided by an Independent Software developers (ISVs) of the e-commerce platform, or manually entered, etc.
In step S102, a word segmentation process is performed on the product attribute information to obtain a plurality of related words.
As a preferred embodiment, the performing word segmentation processing on the article attribute information to obtain a plurality of associated words includes: and matching the commodity attribute information with the vocabulary in a preset word bank according to a preset word segmentation algorithm to obtain the plurality of associated words. The preset word segmentation algorithm can adopt any suitable word segmentation algorithm in the prior art, and preferably adopts a mechanical word segmentation algorithm.
As a specific embodiment, in this embodiment, the commodity attribute information is used as an input data source, and according to a mechanical word segmentation algorithm, the commodity attribute information is matched with words in a preset lexicon to obtain a plurality of associated words. For example, the long text of the acquired commodity attribute information "having swan quality and shirts and white chiffon blouse women jacket design sense, little and new style and fashion shirt" is used as an input data source, the long text is matched with words in a preset lexicon according to a mechanical word segmentation algorithm, and the long text is decomposed to obtain the following associated words: swan, pleated, white, chiffon and shirt.
In step S103, the plurality of related words are extracted to obtain a plurality of keywords.
As a preferred embodiment, the extracting the plurality of relevant words and obtaining a plurality of keywords includes: and judging the categories of the associated words, and extracting according to a preset rule to obtain the keywords. Wherein, preset rules can be set according to actual needs, including but not limited to: extracting characters/words related to the commodity brand and/or the commodity category in the associated words as key words, wherein the number of the extracted key words does not exceed a preset threshold value, and the like.
As a specific embodiment, the present embodiment classifies the obtained multiple related words according to categories, where the categories include, but are not limited to: brand, category, color, characteristics, etc. of the goods; then extracting characters/words with the categories of commodity brands and commodity categories from the associated words as key words according to preset rules; and comparing the number of the extracted keywords with a preset threshold, if the number of the extracted keywords is less than the preset threshold, extracting the keywords from the remaining associated words again until the number of the extracted keywords reaches the preset threshold. For example, for the obtained related word: extracting swans, pleats, white, chiffons and shirts to obtain keywords: "shirts", "white", "chiffon", "shirts".
In step S104, the plurality of keywords are spliced to obtain the commodity copy.
As a preferred embodiment, the splicing the plurality of keywords to obtain the commodity copy includes: and splicing the plurality of keywords according to a preset sequence to obtain the commodity file. Wherein, the preset sequence can be set according to actual needs, including but not limited to: the brand of the article as the beginning of the article document, the category of the article as the end of the article document, the remaining keywords arranged in the order in the article attribute information, all keywords arranged in part of speech, and so on.
As a specific embodiment, in this embodiment, the obtained multiple keywords are spliced in the order of the original product attribute information to obtain the product pattern. For example: for the obtained keywords: the method comprises the following steps of splicing shirts, white, chiffon and shirts to obtain a commodity file: "Pleated white chiffon shirt".
As a preferred embodiment, the method for generating a commodity file of the present embodiment further includes: and after the keywords are spliced, performing color rendering on the text content obtained by splicing to obtain the commodity copy.
As a preferred embodiment, the rendering the text content obtained by splicing includes: and according to a preset rule, selecting one or more modifiers from a word-algae library, and inserting the modifiers into the text content to obtain the commodity case. Wherein, the modifier comprises any words which can be used for modifying or limiting the commodity; the preset rules comprise a preset rule for selecting a modifier from a word-algae library and a preset rule for inserting the selected modifier into the text content, and both of the preset rules can be set according to actual needs, for example, the preset rule can be set for selecting the modifier containing the year from the word-algae library and inserting the modifier into the back of the brand of the commodity.
As a specific example, this embodiment selects a modifier including a year from the word-algae library and inserts it into the beginning of the text content obtained by concatenation. For example: selecting a modifier '2021 New style' from a word and alga library, inserting the beginning of the text content 'Pleated white chiffon shirt' obtained by splicing, and obtaining a commodity file: "2021 New shirts of shirts white chiffon.
The commodity file generation method can be used for file making of single-class commodities and can also be used for file making of multiple-class commodities; the same or different word segmentation rules, extraction rules, splicing sequences and/or coloring rules can be set for different types of commodities, so that the production efficiency of the commodity file is greatly improved, the labor cost and the time cost of a user are saved, diversified commodity files can be obtained, and the display effect is better. After the user obtains the commodity file, the user can upload the E-commerce platform, and the relevant commodity file is completed by one key, so that the commodity issue is completed.
In another embodiment of the present application, a commodity document generation device is provided. The apparatus is used to perform the steps in the embodiment of the method for generating a merchandise document described above in connection with fig. 1.
As shown in fig. 2, theapparatus 100 includes an obtainingmodule 101, aword segmentation module 102, anextraction module 103, and aconcatenation module 104, where the obtainingmodule 101 is configured to obtain commodity attribute information; theword segmentation module 102 is configured to perform word segmentation processing on the commodity attribute information to obtain a plurality of associated words; theextraction module 103 is configured to extract the multiple associated words to obtain multiple keywords; thesplicing module 104 is configured to splice the plurality of keywords to obtain the commodity copy.
As a preferred embodiment, theword segmentation module 102 is configured to perform word segmentation processing on the commodity attribute information in the following manner: and matching the commodity attribute information with the vocabulary in the word bank according to a preset word segmentation algorithm to obtain the plurality of associated words.
As a preferred embodiment, the extractingmodule 103 is configured to extract the plurality of relevant words by: and judging the categories of the associated words, and extracting according to a preset rule to obtain the keywords.
As a preferred embodiment, thesplicing device 104 is configured to splice the plurality of keywords in the following manner: and splicing the plurality of keywords according to a preset sequence to obtain the commodity file.
As a preferred embodiment, the commodity document creation device of the present embodiment further includes: and the color rendering module is used for rendering the text content obtained by splicing after the plurality of keywords are spliced to obtain the commodity copy.
As a preferred embodiment, the rendering device is configured to render the text content obtained by splicing in the following manner: and according to a preset rule, selecting one or more modifiers from a word-algae library, and inserting the modifiers into the text content to obtain the commodity case.
It is to be understood that, regarding the commodity pattern generating apparatus in the embodiment described above with reference to fig. 2, the specific manner in which the respective modules perform operations has been described in detail in the embodiment of the commodity pattern generating method described in conjunction with fig. 1, and will not be elaborated herein.
In another embodiment of the present application, an electronic apparatus is further provided, where the apparatus includes a memory and a processor, the memory stores a computer program, and the processor executes the computer program to implement the following steps: acquiring commodity attribute information; performing word segmentation processing on the commodity attribute information to obtain a plurality of associated words; extracting the plurality of associated words to obtain a plurality of keywords; and splicing the plurality of keywords to obtain the commodity copy.
It is understood that the steps implemented when the computer program is executed by the processor are substantially the same as the implementation of the steps in the above method, and the specific manner is described in detail in the embodiment of the method for generating the commodity file, and will not be elaborated herein.
In another embodiment of the present application, a computer-readable storage medium is provided, wherein the storage medium stores a computer program, and when the computer program is executed, the computer program implements the following steps: acquiring commodity attribute information; performing word segmentation processing on the commodity attribute information to obtain a plurality of associated words; extracting the plurality of associated words to obtain a plurality of keywords; and splicing the plurality of keywords to obtain the commodity copy.
It is understood that the steps implemented when the computer program is executed by the processor are substantially the same as the implementation of the steps in the above method, and the specific manner is described in detail in the embodiment of the method for generating the commodity file, and will not be elaborated herein.
The foregoing detailed description of the embodiments of the present application has been presented to illustrate the principles and implementations of the present application, and the above description of the embodiments is only provided to help understand the method and the core concept of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.
It should be understood that the terms "first" and "second," etc. in the claims, description, and drawings of the present application are used for distinguishing between different objects and not for describing a particular order. The terms "comprises" and "comprising," when used in the specification and claims of this application, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the present application herein is for the purpose of describing particular embodiments only, and is not intended to be limiting of the application. As used in the specification and claims of this application, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should be further understood that the term "and/or" as used in the specification and claims of this application refers to any and all possible combinations of one or more of the associated listed items and includes such combinations.