Commodity name processing method and device and nonvolatile storage medium
By dividing product names into characters and forming words, and determining the phrase attribute labels with neural network models and classification models, the accuracy of word attribute judgment in product names is solved, and the accuracy of product name word segmentation and semantic analysis is achieved.
Patent Information
- Application Number
- CN202411883769.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-04-18
AI Technical Summary
The prior art is difficult to accurately judge the properties of words in product names, resulting in errors in boundary segmentation and semantic confusion.
By obtaining the name of the target product, dividing it into multiple characters, and grouping words for each character, you will get a collection of phrases. Then, the name of the target product is analyzed based on the attribute labels in the phrase set. The method includes using a neural network model and a pre-trained classification model to determine the attribute tags of the phrases separately, and perform matching and redetermining of the repetitive phrases.
It realizes accurate judgment of word attributes in product names, improves the accuracy of product name word segmentation and semantic analysis, and avoids semantic confusion and label prediction errors.
Smart Images

Figure CN119849491A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, device and non-volatile storage medium for processing product names. Background Art
[0002] Product titles usually contain many common names, abbreviations, and multiple meanings, and lack contextual information, which causes existing models to have problems such as boundary segmentation errors and semantic confusion. At the same time, product title parsing often relies on common sense knowledge. For example, from the product title "Cucumber Chips", it is impossible to determine whether "cucumber" is a core word or a flavor word. There is currently no effective solution to the above problems. Summary of the invention
[0003] The embodiments of the present invention provide a method, device, and non-volatile storage medium for processing product names, so as to at least solve the technical problem that the attributes of the words contained in the product names cannot be accurately determined.
[0004] According to one aspect of an embodiment of the present invention, a method for processing a product name is provided, comprising: obtaining a name of a target product; dividing the name of the target product into a plurality of characters, and forming words for the plurality of characters respectively, to obtain a plurality of phrase sets corresponding to the plurality of characters one by one; respectively determining attribute labels of each phrase in the plurality of phrase sets, wherein a phrase is a product feature describing the target product, and an attribute label is a type to which the product feature belongs; dividing the name of the target product into a plurality of phrases according to the attribute labels of each phrase in the plurality of phrase sets, and determining the attribute labels of each phrase; analyzing the name of the target product according to the attribute labels of each phrase in the plurality of phrase sets.
[0005] Optionally, the name of the target product is divided into multiple phrases according to the attribute labels of each phrase in the multiple phrase sets, and the attribute labels of each phrase are determined, including: selecting multiple matching phrases that match the name of the target product from the phrases in the multiple phrase sets; dividing the name of the target product into multiple phrases that correspond one-to-one to the multiple matching phrases; and determining the attribute labels of each phrase according to the attribute labels of each matching phrase.
[0006] Optionally, the attribute labels of the multiple phrases are determined based on the attribute labels corresponding to the matching phrases, including: when the attribute labels of the multiple matching phrases are repeated, selecting the matching phrases corresponding to the repeated attribute labels as repeated phrases; and redetermining the attribute labels of the repeated phrases until the redetermined attribute labels are no longer repeated.
[0007] Optionally, the name of the target product is divided into multiple characters, and words are formed for the multiple characters respectively to obtain multiple phrase sets corresponding to the multiple characters one by one, including: inputting the name of the target product into a neural network model, and outputting multiple phrase sets from the neural network model, wherein the neural network model is obtained by training an original neural network model with a first training sample, and the first training sample includes the product name of a first sample product, sample characters included in the product name of the first sample product, a phrase set corresponding to the sample characters, and a knowledge graph including the sample characters.
[0008] Optionally, respectively determining the attribute labels of each phrase in a plurality of phrase sets includes: respectively inputting the plurality of phrase sets into a pre-trained classification model, and having the classification model output the attribute labels of each phrase in the plurality of phrase sets, wherein the classification model is obtained by training an original classification model with a second training sample, the second training sample includes a plurality of sample phrases included in a second sample product name, and sample attribute labels of each of the plurality of sample phrases.
[0009] Optionally, the classification model is trained in the following manner: connecting the original classification model with the neural network model; inputting the second sample product name into the neural network model, and the neural network model outputs multiple sample phrases; using multiple sample phrases and sample attribute labels of each of the multiple sample phrases to input the original classification model, training the original classification model, and obtaining a classification model.
[0010] According to another aspect of an embodiment of the present invention, a device for processing a product name is provided, comprising: an acquisition module for acquiring the name of a target product; a division module for dividing the name of the target product into a plurality of characters, and forming words for the plurality of characters respectively, to obtain a plurality of phrase sets corresponding to the plurality of characters one by one; a first determination module for respectively determining the attribute labels of each phrase in the plurality of phrase sets, wherein a phrase is a product feature describing the target product, and an attribute label is a type to which the product feature belongs. A second determination module for dividing the name of the target product into a plurality of phrases according to the attribute labels of each phrase in the plurality of phrase sets, and determining the attribute labels of each phrase; and an analysis module for analyzing the name of the target product according to the attribute labels of each phrase in the plurality of phrase sets.
[0011] According to another aspect of an embodiment of the present invention, a non-volatile storage medium is provided. The non-volatile storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing any one of the product name processing methods.
[0012] According to another aspect of an embodiment of the present invention, there is provided an electronic device, comprising: one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement any one of the product name processing methods.
[0013] According to yet another aspect of an embodiment of the present invention, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, any one of the above-mentioned methods for processing product names is implemented.
[0014] In an embodiment of the present invention, the name of a target product is obtained; the name of the target product is divided into a plurality of characters, and words are formed for the plurality of characters to obtain a plurality of phrase sets corresponding to the plurality of characters one by one; the attribute labels of the phrases in the plurality of phrase sets are determined respectively, wherein the phrases are product features that describe the target product, and the attribute labels are types to which the product features belong; the name of the target product is divided into a plurality of phrases according to the attribute labels of the phrases in the plurality of phrase sets, and the attribute labels of the plurality of phrases are determined; the name of the target product is analyzed according to the attribute labels of the plurality of phrases, thereby solving the technical problem that the attributes of the words contained in the product name cannot be accurately judged, and by first judging the attributes of the words that can be formed by each character in the product name, and then comprehensively judging the attributes of the words contained in the product name, the technical effect of improving the accuracy of the judgment of the belonging of the words contained in the product name is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0016] Figure 1 is a flowchart of an optional method for processing product names provided according to an embodiment of the present invention;
[0017] Figure 2 is a schematic diagram of an optional product name processing device provided according to an embodiment of the present invention;
[0018] Figure 3 is a schematic diagram of an electronic device provided according to an embodiment of the present invention. DETAILED DESCRIPTION
[0019] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0020] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0021] According to an embodiment of the present invention, a method embodiment for processing a product name is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0022] Figure 1 is a flowchart of a method for processing a product name according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:
[0023] Step S102, obtaining the name of the target product;
[0024] In this step, one or some products are selected from the products on various platforms, and the names of the products are obtained as parsing objects in subsequent steps.
[0025] Step S104, dividing the name of the target product into a plurality of characters, and forming words for each of the plurality of characters to obtain a plurality of word group sets corresponding to the plurality of characters one by one;
[0026] In this step, each character corresponding to the name of the target product is grouped into words to obtain four sets corresponding to each character. The first set of the four sets represents the beginning of the character in the grouped word, the second set of the four sets represents the middle of the character in the grouped word, the third set of the four sets represents the end of the character in the grouped word, and the fourth set of the four sets represents that there is no word that can be grouped with the character.
[0027] In an optional embodiment, the name of the target product is divided into multiple characters, and words are formed for the multiple characters to obtain multiple phrase sets corresponding to the multiple characters one by one, including: inputting the name of the target product into a neural network model, and outputting multiple phrase sets from the neural network model, wherein the neural network model is obtained by training an original neural network model with a first training sample, and the first training sample includes the product name of a first sample product, sample characters included in the product name of the first sample product, a phrase set corresponding to the sample characters, and a knowledge graph including the sample characters.
[0028] Optionally, the name of the sample product is represented by a character sequence, where the character sequence is s = {c1, c2, …, c n}, where the existing word is denoted by w i,j =c i ,c i+1 ,…,c j In order to save all the word segmentation information, each character c i The matched words are classified into four sets {B, M, E, S}, which represent the words in c i Words starting with c i In the middle of the word set, c i Words ending with c i itself, so that each character c i Four word sets are available:
[0029]
[0030] Among them, C i (B) indicates that the character c i Starting word set B, C i (M) represents character c i In the middle word set M, C i (E) represents character c i In the word set ending in E, C i (S) indicates the character c i The word set S is an independent word, L represents all the words in the dictionary, and w i,k 、w j,k 、w j,iThey all represent words selected from the dictionary L, where i, j, k are the position information of the word in the sequence, and n represents the length of the sequence.
[0031] Using four word sets {B, M, E, S} to represent each character can ensure that word segmentation information is not lost, and each word can be represented using an embedding. After each character has a corresponding word set, the word frequency is used as the weight to perform weighted compression on the word set to obtain the word set S. The compression of the word set S is shown in the following formula:
[0032]
[0033] Among them, z(w) is the frequency of word w in the dictionary, e w is the embedding representation of word w.
[0034] Then the four weighted and compressed word sets are combined into a feature of fixed dimension:
[0035] e s (B,M,E,S)=[v s (B),v s (M),v s (E),v s (S)]
[0036] Among them, e s (B, M, E, S) is the character representation of each word contained in the name of the sample product, v s (B) is the compressed form of word set B, v s (M) is the compressed form of the word set M, v s (E) is the compressed form of the word set E, v s (S) is the compressed expression of the word set S. According to the character representation of each word in the sample product, the original neural network model is trained to obtain a neural network model. The type of the neural network model can be a named entity model or other related large language model. The name of the target product is input into the neural network model, and the neural network model can automatically output the character representation corresponding to each word in the name of the target product, that is, the four phrase sets corresponding to each word.
[0037] In an optional embodiment, the attribute labels of each phrase in a plurality of phrase sets are determined respectively, including: inputting the plurality of phrase sets into a pre-trained classification model respectively, and having the classification model output the attribute labels of each phrase in the plurality of phrase sets, wherein the classification model is obtained by training an original classification model with a second training sample, and the second training sample includes a plurality of sample phrases included in a second sample product name, and sample attribute labels of each of the plurality of sample phrases.
[0038] Optionally, from data sources such as a product library, product details page, search logs, merchant information, and product operation terminal, a product attribute word list is obtained by means of word segmentation, new word discovery, etc., including dimensions such as brand, product, flavor, model, origin, packaging, etc. According to the attribute word list, the selected sample product titles are segmented and it is determined which attribute each word belongs to, thereby obtaining a second training sample. The original classification model is trained with the second training sample to obtain a classification model. After segmenting the title of the target product, the set of word groups corresponding to each character is input into the pre-trained classification model, and the classification model can automatically output the attribute labels of each word in the set of word groups corresponding to each character of the target product title.
[0039] In an optional embodiment, the classification model is trained in the following manner: Connect the original classification model with a neural network model; input the second sample product name into the neural network model, and the neural network model outputs multiple sample word groups; use the multiple sample word groups and the sample attribute labels of each of the multiple sample word groups to input into the original classification model to train the original classification model to obtain a classification model.
[0040] Optionally, the attribute label data information of each word w of the sample product is:
[0041] F w =[(a1,f1),(a2,f2),…,(a n ,f n )]
[0042] where a i ,0 < i ≤ n is the attribute label name, and f i ,0 < i ≤ n is the frequency of the occurrence of a i among all the attribute labels of the word w, and f1 + f2 + … + f n = 1. F w is the true label for the multi-classification task.
[0043] The classification model includes a one-dimensional convolutional layer and a fully connected layer. The input data is the character representation e s (B,M,E,S), and the output is the predicted probability [y1,y2,…,y n for each category. The cross-entropy is used as the loss function:
[0044]
[0045] where y i and P iThe true label and predicted probability corresponding to the i-th category, n is the number of categories. By inputting the phrase consisting of sample products into the original classification model, the classification model can be trained to accurately determine the attribute label represented by each word character, thereby avoiding semantic confusion and label prediction errors when parsing the product title.
[0046] Step S106, determining the attribute labels of each of the phrases in the plurality of phrase sets, wherein the phrases are commodity features describing the target commodity, and the attribute labels are the types to which the commodity features belong;
[0047] In this step, in the field of e-commerce, product features may be brand, product type, flavor, model, packaging form, origin, etc. Determining the attribute label of a phrase means identifying which feature type of brand, product type, flavor, model, packaging form, origin, etc. the phrase belongs to.
[0048] Step S108, dividing the name of the target product into multiple phrases according to the attribute labels of the phrases in the multiple phrase sets, and determining the attribute labels of the multiple phrases;
[0049] In this step, the name of the target product is segmented into a series of possible phrases. For each phrase, its corresponding attribute label is determined based on its position and association in the knowledge graph or based on the results of preliminary structured analysis in the training dataset.
[0050] In an optional embodiment, the name of the target product is divided into multiple phrases according to the attribute labels of each phrase in the multiple phrase sets, and the attribute labels of each phrase are determined, including: selecting multiple matching phrases that match the name of the target product from the phrases in the multiple phrase sets; dividing the name of the target product into multiple phrases corresponding to the multiple matching phrases one by one; and determining the attribute labels of each phrase according to the attribute labels of each matching phrase.
[0051] Optionally, the purpose of this step is mainly to accurately divide the name of the target product and determine the attribute label of each phrase in the name of the target product. The division method is to compare the possible segmentation results of the target product with the four sets corresponding to each character of the target product, and use the phrase matching the name of the target product as the segmentation result of the target product. For example, the target product is "cucumber potato chips", and each character of the target product corresponds to four phrase sets. The four phrase sets corresponding to each character are all the words that can be composed of the character. The target product is split into two words "cucumber" and "potato chips", and these two words are matched in the four phrase sets corresponding to each character of the name of the target product. It is found that: "cucumber" can match the phrases in the four phrase sets corresponding to "yellow" and "melon" respectively, so it can be determined that the first segmentation of the target product is "cucumber". Similarly, it can be found that: "potato chips" can match the phrases in the phrase sets corresponding to "potato" and "chips", so it can be determined that the second segmentation of the target product is "potato chips". By comparing the attribute labels in the phrase sets of each character of the target product, the attribute labels corresponding to the segmentation of the target product can be determined.
[0052] In an optional embodiment, attribute tags of multiple phrases are determined based on attribute tags corresponding to matching phrases, including: when attribute tags of multiple matching phrases are repeated, selecting the matching phrases corresponding to the repeated attribute tags as repeated phrases; and redetermining the attribute tags of the repeated phrases until the redetermined attribute tags are no longer repeated.
[0053] Optionally, after the target product title is segmented, multiple matching phrases can be determined. When the attribute labels corresponding to each matching phrase in the multiple matching phrases are different, the attribute of each segmented phrase corresponding to the target product title can be determined. When the attribute labels corresponding to some matching phrases in the multiple matching phrases are the same, the meaning of each matching phrase needs to be re-determined. For example, if the target product is "cucumber potato chips", the phrases matched after the target product is segmented may be "cucumber" and "potato chips". When determining the attribute label of "cucumber", it may be identified as "product type" or "flavor". At this time, the matching phrase needs to be identified as a repeated phrase, and the attribute label of the repeated phrase needs to be re-determined.
[0054] Step S110 , analyzing the name of the target product according to the attribute tags of the plurality of phrases.
[0055] In this step, after completing the attribute tag labeling of the phrase, these attribute tags are used to more deeply understand and analyze the meaning and structure of the product name.
[0056] The name of the target product is obtained through the above method; the name of the target product is divided into multiple characters, and the multiple characters are respectively grouped into words to obtain multiple phrase sets corresponding to the multiple characters one by one; the attribute labels of each phrase in the multiple phrase sets are respectively determined, wherein the phrase is a product feature describing the target product, and the attribute label is the type to which the product feature belongs; according to the attribute labels of each phrase in the multiple phrase sets, the name of the target product is divided into multiple phrases, and the attribute labels of each multiple phrases are determined; according to the attribute labels of each phrase in the multiple phrase sets, the name of the target product is analyzed, thereby solving the technical problem that the attributes of the words contained in the name of the product cannot be accurately judged, and by first judging the attributes of the words that can be composed of each character in the product name, and then comprehensively judging the attributes of the words contained in the product name, the technical effect of improving the accuracy of the judgment of the belonging of the words contained in the product name is achieved.
[0057] Based on the above embodiments and optional embodiments, the present invention proposes an optional implementation manner.
[0058] Step S1, obtaining the name of the target product;
[0059] In this step, one or some products are selected from the products on various platforms, and the names of the products are obtained as parsing objects in subsequent steps.
[0060] Step S2, dividing the name of the target product into a plurality of characters, and forming words for each of the plurality of characters to obtain a plurality of word group sets corresponding to the plurality of characters one by one;
[0061] Optionally, each character corresponding to the name of the target product is grouped into words to obtain four sets corresponding to each character, the first set of the four sets represents the beginning of the character in the grouped word, the second set of the four sets represents the middle of the character in the grouped word, the third set of the four sets represents the end of the character in the grouped word, and the fourth set of the four sets represents that there is no word that can be grouped with the character.
[0062] Step S21, divide the name of the target product into multiple characters, and form words for the multiple characters respectively to obtain multiple phrase sets corresponding to the multiple characters one by one, including: inputting the name of the target product into a neural network model, and outputting multiple phrase sets from the neural network model, wherein the neural network model is obtained by training an original neural network model through a first training sample, and the first training sample includes the product name of a first sample product, sample characters included in the product name of the first sample product, a phrase set corresponding to the sample characters, and a knowledge graph including the sample characters.
[0063] Optionally, the name of the sample product is represented by a character sequence, where the character sequence is s = {c1, c2, …, cn}, where the existing word is denoted by w i,j =c i ,c i+1 ,…,c j In order to save all the word segmentation information, each character c i The matched words are classified into four sets {B, M, E, S}, which represent the words in c i Words starting with c i In the middle of the word set, c i Words ending with c i itself, so that each character c i Four word sets are available:
[0064]
[0065] Among them, C i (B) indicates that the character c i Starting word set B, C i (M) represents character c i In the middle word set M, C i (E) represents character c i In the word set ending in E, C i (S) indicates the character c i The word set S is an independent word, L represents all the words in the dictionary, and w i,k 、w j,k 、w j,i They all represent words selected from the dictionary L, where i, j, k are the position information of the word in the sequence, and n represents the length of the sequence.
[0066] Using four word sets {B, M, E, S} to represent each character can ensure that word segmentation information is not lost, and each word can be represented using an embedding. After each character has a corresponding word set, the word frequency is used as the weight to perform weighted compression on the word set to obtain the word set S. The compression of the word set S is shown in the following formula:
[0067]
[0068] Among them, z(w) is the frequency of word w in the dictionary, e w is the embedding representation of word w.
[0069] Then the four weighted and compressed word sets are combined into a feature of fixed dimension:
[0070] e s (B,M,E,S)=[v s (B),v s (M),v s (E),v s(S)]
[0071] Among them, e s (B, M, E, S) is the character representation of each word contained in the name of the sample product, v s (B) is the compressed form of word set B, v s (M) is the compressed form of the word set M, v s (E) is the compressed form of the word set E, v s (S) is the compressed expression of the word set S. . According to the character representation of each word in the sample product, the original neural network model is trained to obtain a neural network model. The type of the neural network model can be a named entity model or other related large language model. The name of the target product is input into the neural network model, and the neural network model can automatically output the character representation corresponding to each word in the name of the target product, that is, the four phrase sets corresponding to each word.
[0072] Step S22, respectively determining the attribute labels of each phrase in the multiple phrase sets, including: respectively inputting the multiple phrase sets into a pre-trained classification model, and having the classification model output the attribute labels of each phrase in the multiple phrase sets, wherein the classification model is obtained by training the original classification model through a second training sample, and the second training sample includes multiple sample phrases included in the second sample product name, and sample attribute labels of each of the multiple sample phrases.
[0073] Optionally, from data sources such as product libraries, product detail pages, search logs, merchant information, and product operation terminals, product attribute word lists are obtained by means of word segmentation and new word discovery, including dimensions such as brand, product, flavor, model, origin, and packaging. According to the attribute word list, the selected sample product titles are segmented and each word is judged to which attribute it belongs, thereby obtaining a second training sample, and the original classification model is trained by the second training sample to obtain a classification model. After the target product title is segmented, the phrase set corresponding to each character is comfortably added to the pre-trained classification model, and the classification model can automatically output the attribute label of each phrase in the phrase set corresponding to each character in the target product title.
[0074] In step S23, the classification model is trained in the following manner: the original classification model is connected to the neural network model; the second sample product name is input into the neural network model, and the neural network model outputs a plurality of sample phrases; the plurality of sample phrases and the sample attribute labels of the plurality of sample phrases are input into the original classification model, and the original classification model is trained to obtain the classification model.
[0075] Optionally, the attribute label data information of each word w of the sample product is:
[0076] Fw = [(a1, f1), (a2, f2), …, (a n , f n )]
[0077] where, a i , 0 < i ≤ n is the name of the attribute label, and f i , 0 < i ≤ n is the frequency of the occurrence of a i among all the attribute labels of the word w, and f1 + f2 + … + f n = 1. F w is the true label for the multi-classification task.
[0078] The classification model includes a one-dimensional convolutional layer and a fully connected layer. The input data is the character representation e s (B, M, E, S), and the output is the predicted probability [y1, y2, …, y n for each class. The cross-entropy is used as the loss function:
[0079]
[0080] where, y i and P i correspond to the true label and the predicted probability for the i-th class, and n is the number of classes. By inputting the phrases composed of sample commodities into the original classification model, the classification model can be trained to accurately determine the attribute labels represented by each word character, thereby avoiding problems such as semantic confusion and incorrect label prediction when parsing the titles of commodities.
[0081] Step S3: Determine the respective attribute labels of the phrases in multiple phrase sets. Here, the phrase is the commodity feature describing the target commodity, and the attribute label is the type to which the commodity feature belongs;
[0082] In this step, in the e-commerce field, the commodity features can be brand, product type, flavor, model, packaging form, place of origin, etc. Determining the attribute label of a phrase means identifying which feature type among brand, product type, flavor, model, packaging form, place of origin, etc. the phrase belongs to.
[0083] Step S4: Divide the name of the target commodity into multiple phrases according to the respective attribute labels of the phrases in multiple phrase sets, and determine the respective attribute labels of the multiple phrases;
[0084] In this step, the name of the target commodity is split into a series of possible phrases. For each phrase, according to its position and association in the knowledge graph, or based on the results of preliminary structured analysis in the training dataset, its corresponding attribute label is determined.
[0085] Step S41, dividing the name of the target product into multiple phrases according to the attribute labels of each phrase in the multiple phrase sets, and determining the attribute labels of each of the multiple phrases, including: selecting multiple matching phrases that match the name of the target product from the phrases in the multiple phrase sets; dividing the name of the target product into multiple phrases that correspond one-to-one to the multiple matching phrases; and determining the attribute labels of each of the multiple phrases according to the attribute labels of each of the multiple matching phrases.
[0086] Optionally, the purpose of this step is mainly to accurately divide the name of the target product and determine the attribute label of each phrase in the name of the target product. The division method is to compare the possible segmentation results of the target product with the four sets corresponding to each character of the target product, and use the phrase matching the name of the target product as the segmentation result of the target product. For example, the target product is "cucumber potato chips", and each character of the target product corresponds to four phrase sets. The four phrase sets corresponding to each character are all the words that can be composed of the character. The target product is split into two words "cucumber" and "potato chips", and these two words are matched in the four phrase sets corresponding to each character of the name of the target product. It is found that: "cucumber" can match the phrases in the four phrase sets corresponding to "yellow" and "melon" respectively, so it can be determined that the first segmentation of the target product is "cucumber". Similarly, it can be found that: "potato chips" can match the phrases in the phrase sets corresponding to "potato" and "chips", so it can be determined that the second segmentation of the target product is "potato chips". By comparing the attribute labels in the phrase sets of each character of the target product, the attribute labels corresponding to the segmentation of the target product can be determined.
[0087] Step S42, determining the attribute tags of the plurality of phrases according to the attribute tags corresponding to the matching phrases, including: when the attribute tags of the plurality of matching phrases are repeated, selecting the matching phrases corresponding to the repeated attribute tags as repeated phrases; and redetermining the attribute tags of the repeated phrases until the re-determined attribute tags are no longer repeated.
[0088] Optionally, after the target product title is segmented, multiple matching phrases can be determined. When the attribute labels corresponding to each matching phrase in the multiple matching phrases are different, the attribute of each segmented phrase corresponding to the target product title can be determined. When the attribute labels corresponding to some matching phrases in the multiple matching phrases are the same, the meaning of each matching phrase needs to be re-determined. For example, if the target product is "cucumber potato chips", the phrases matched after the target product is segmented may be "cucumber" and "potato chips". When determining the attribute label of "cucumber", it may be identified as "product type" or "flavor". At this time, the matching phrase needs to be identified as a repeated phrase, and the attribute label of the repeated phrase needs to be re-determined.
[0089] Step S5, analyzing the name of the target product according to the attribute tags of the multiple phrases.
[0090] In this step, after completing the attribute tag labeling of the phrase, these attribute tags are used to more deeply understand and analyze the meaning and structure of the product name.
[0091] The above-mentioned optional implementation achieves at least the following effects: it solves the technical problem of being unable to accurately judge the attributes of the words contained in the name of the product, by first judging the attributes of the words that can be composed of each character in the product name, and then comprehensively judging the attributes of the words contained in the product name, thereby achieving the technical effect of improving the accuracy of the judgment of the words contained in the product name.
[0092] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0093] In this embodiment, a commodity name processing device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the terms "module" and "device" can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0094] According to an embodiment of the present invention, there is also provided an apparatus embodiment for implementing the method for processing a product name. Figure 2 is a schematic diagram of a commodity name processing device according to an embodiment of the present invention. Figure 2 As shown, the above-mentioned product name processing device includes an acquisition module 21, a classification module 22, a first determination module 23, a second determination module 24, and an analysis module 25. The device is described below.
[0095] An acquisition module 21 is used to acquire the name of the target product;
[0096] The division module 22 is connected to the acquisition module 21 and is used to divide the name of the target product into a plurality of characters and form words for each of the plurality of characters to obtain a plurality of word group sets corresponding to the plurality of characters one by one;
[0097] The first determination module 23 is connected to the division module 22 and is used to respectively determine the attribute labels of the phrases in the plurality of phrase sets, wherein the phrases are commodity features describing the target commodity and the attribute labels are the types to which the commodity features belong.
[0098] A second determination module 24, connected to the first determination module 23, is used to divide the name of the target product into multiple phrases according to the attribute labels of the phrases in the multiple phrase sets, and determine the attribute labels of the multiple phrases;
[0099] The analyzing module 25 is connected to the second determining module 24 and is used to analyze the name of the target product according to the attribute tags of the plurality of phrases.
[0100] In a commodity name processing device provided by an embodiment of the present invention, an acquisition module is set to acquire the name of a target commodity; a division module is used to divide the name of the target commodity into multiple characters, and form words for the multiple characters respectively, to obtain multiple phrase sets corresponding to the multiple characters one by one; a first determination module is used to respectively determine the attribute labels of each phrase in the multiple phrase sets, wherein the phrase is a commodity feature describing the target commodity, and the attribute label is the type to which the commodity feature belongs. A second determination module is used to divide the name of the target commodity into multiple phrases according to the attribute labels of each phrase in the multiple phrase sets, and determine the attribute labels of each phrase; an analysis module analyzes the name of the target commodity according to the attribute labels of each phrase, thereby solving the technical problem of being unable to accurately judge the attributes of the words contained in the commodity name, by first judging the attributes of the words that can be formed by each character in the commodity name, and then comprehensively judging the attributes of the words contained in the commodity name, thereby achieving the technical effect of improving the accuracy of the judgment of the belonging of the words contained in the commodity name.
[0101] The technical problem solved achieves the purpose of accurately judging the attributes of the words contained in the product name, thereby achieving the technical effect of improving the accuracy of the judgment of the words contained in the product name.
[0102] It should be noted that the above modules can be implemented by software or hardware. For example, for the latter, it can be implemented in the following ways: the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0103] It should be noted that the acquisition module 21, the division module 22, the first determination module 23, the second determination module 24, and the analysis module 25 correspond to steps S102 to S110 in the embodiment, and the examples and application scenarios implemented by the modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above embodiment. It should be noted that the modules as part of the device can be run in a computer terminal.
[0104] It should be noted that the optional or preferred implementation of this embodiment can refer to the relevant description in the embodiment, which will not be repeated here.
[0105] The above-mentioned product name processing device may also include a processor and a memory. The acquisition module 21, the division module 22, the first determination module 23, the second determination module 24, the analysis module 25, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize the corresponding functions.
[0106] The processor includes a kernel, which retrieves the corresponding program unit from the memory. There can be one or more kernels. The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one storage chip.
[0107] An embodiment of the present invention provides a non-volatile storage medium on which a program is stored. When the program is executed by a processor, a method for processing a product name is implemented.
[0108] like Figure 3 As shown, an embodiment of the present invention provides an electronic device, the electronic device 10 includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, the following steps are implemented: the memory is used to store a computer program, wherein when the computer program is executed by the processor, the processor implements the above-mentioned product name processing method. The device in this article may be a server, a PC, etc.
[0109] The present invention also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that initializes the following method steps: computer instructions are executed by a processor to perform the above-mentioned product name processing method.
[0110] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0111] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0112] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0113] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0114] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0115] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0116] Computer readable media include permanent and non-permanent, removable and non-removable media that can be used to store learning by any method or technology. Learning can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store learning that can be accessed by a computing device. As defined in this article, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0117] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0118] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0119] The above are only embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of the claims of the present invention.
Claims
1. A method for processing a product name, characterized in that: include: Get the name of the target product; Dividing the name of the target product into a plurality of characters, and forming words for the plurality of characters respectively, to obtain a plurality of word group sets corresponding to the plurality of characters one by one; Determining attribute labels of respective phrases in the plurality of phrase sets, respectively, wherein the phrases are commodity features describing the target commodity, and the attribute labels are types to which the commodity features belong; Dividing the name of the target product into a plurality of phrases according to the attribute labels of the respective phrases in the plurality of phrase sets, and determining the attribute labels of the respective phrases; The name of the target product is analyzed according to the attribute tags of each of the plurality of phrases.
2. The method according to claim 1, characterized in that: The step of dividing the name of the target product into a plurality of phrases according to the attribute labels of the phrases in the plurality of phrase sets, and determining the attribute labels of the plurality of phrases, comprises: Selecting a plurality of matching phrases that match the name of the target product from the phrases in the plurality of phrase sets; Dividing the name of the target product into the multiple phrases corresponding one-to-one to the multiple matching phrases; According to the attribute tags of the plurality of matching phrases, the attribute tags of the plurality of phrases are determined.
3. The method according to claim 2, characterized in that The determining the attribute tags of the respective phrases according to the attribute tags corresponding to the matching phrases includes: When the attribute tags of the plurality of matching phrases are repeated, the matching phrases corresponding to the repeated attribute tags are selected as repeated phrases; Re-determine the attribute tags of the repetitive phrases until the re-determined attribute tags are no longer repeated.
4. The method according to claim 1, characterized in that: The step of dividing the name of the target product into a plurality of characters and forming words for the plurality of characters to obtain a plurality of word group sets corresponding to the plurality of characters one by one includes: The name of the target product is input into a neural network model, and the neural network model outputs the multiple phrase sets, wherein the neural network model is obtained by training an original neural network model through a first training sample, and the first training sample includes the product name of a first sample product, sample characters included in the product name of the first sample product, a phrase set corresponding to the sample characters, and a knowledge graph including the sample characters.
5. The method according to claim 4, characterized in that The respectively determining the attribute labels of the phrases in the plurality of phrase sets comprises: The multiple phrase sets are respectively input into a pre-trained classification model, and the classification model outputs attribute labels of each phrase in the multiple phrase sets, wherein the classification model is obtained by training an original classification model with a second training sample, and the second training sample includes multiple sample phrases included in the second sample product name, and sample attribute labels of each of the multiple sample phrases.
6. The method according to claim 5, characterized in that The classification model is trained as follows: Connecting the original classification model with the neural network model; Inputting the second sample product name into the neural network model, and having the neural network model output the plurality of sample phrases; The plurality of sample phrases and the sample attribute labels of the plurality of sample phrases are input into the original classification model, and the original classification model is trained to obtain the classification model.
7. A product name processing device, characterized in that: include: Get module to get the name of the target product; A division module, used for dividing the name of the target product into a plurality of characters, and forming words for the plurality of characters respectively, to obtain a plurality of word group sets corresponding to the plurality of characters one by one; A first determination module is used to respectively determine the attribute labels of the phrases in the plurality of phrase sets, wherein the phrases are commodity features describing the target commodity, and the attribute labels are the types to which the commodity features belong; A second determination module, configured to divide the name of the target product into a plurality of phrases according to the attribute labels of the respective phrases in the plurality of phrase sets, and determine the attribute labels of the respective phrases; The analysis module analyzes the name of the target product according to the attribute tags of each of the plurality of phrases.
8. A non-volatile storage medium, characterized in that: The non-volatile storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the product name processing method described in any one of claims 1 to 6.
9. An electronic device, characterized in that: include: One or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the product name processing method described in any one of claims 1 to 6.
10. A computer program product comprising computer instructions, characterized in that: The computer instructions are executed by a processor to execute the product name processing method described in any one of claims 1 to 6.