Commodity named entity recognition model generation method and commodity search text processing method
Through artificial intelligence, the product naming entity recognition model is generated through active learning of labeling and combination model training, which solves the problems of high vocabulary maintenance costs and unconsidered search intentions in the search method of online shopping platform, and improves the accuracy of search results and users Experience, improving click-through rate and conversion rate.
Patent Information
- Application Number
- CN202411332424.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2025-01-03
AI Technical Summary
The product search methods of existing online shopping platforms rely on verb + literal matching, resulting in high maintenance costs for the word library, unable to adapt to user search terms updates and search intentions, resulting in problems such as mis-ordering and missing rows, and unable to improve the accuracy of search results and User experience.
Adopt artificial intelligence active learning labeling method, combine pre-trained models, two-way long and short-term memory networks and conditional random fields to build product named entity recognition models, and use user history search data and product attribute training models to generate product named entity recognition models, and improve the vocabulary library Richness and search sorting accuracy.
It improves the click-through rate and conversion rate of search results on online shopping platforms, reduces the search result without results, enhances the transaction conversion rate of the search box, and improves the search experience.
Smart Images

Figure CN119250075A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence, and in particular to a method for generating a commodity named entity recognition model and a method for processing commodity search text. Background Art
[0002] The core of online shopping platforms is to provide a convenient and efficient shopping experience. With the continuous development and growth of online business in recent years, users' demands and requirements in various aspects are also increasing day by day. Among them, the accuracy and richness of user searches can greatly enhance the user's direct shopping experience, thereby promoting the interaction and stickiness between users and the platform.
[0003] The existing technology mainly uses the method of word segmentation + literal matching to search for product recalls. This method has high accuracy, strong explanatory power, and fast matching speed, but at the same time, the maintenance cost of the word library is high, and keywords need to be added manually to maintain the richness of the word library, which is difficult to adapt to the constantly updated user search terms. In addition, the word part of speech and the weight information of the entity type are generally not considered in the sorting stage, which cannot better take into account the user's search intent, and it is easy to have wrong sorting or missing sorting.
[0004] The invention provides a named entity recognition method for commodities that can be used for search, which improves the richness of the vocabulary while ensuring the accuracy of sorting. It is of great significance to the search module of online shopping platforms and can also play a role in optimizing commodity information management and improving products and services in the future. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide a method for generating a commodity named entity recognition model and a method for processing commodity search text.
[0006] In order to solve the above problems, the present invention provides a method for generating a commodity named entity recognition model, including: obtaining historical search data on the user side and the main title, subtitle and shopping guide attributes of standard commodities on the commodity side as original data; adopting an active learning labeling method of artificial intelligence, using the original data to train a pre-trained model and generate training data; using the pre-trained model and a bidirectional long short-term memory network, as well as a conditional random field to construct a combined model; using the text of the training data as input text to train the combined model to generate a commodity named entity recognition model, and freezing the parameters of the pre-trained model during the training process; evaluating the commodity named entity recognition model, and the evaluation indicators include accuracy, precision, recall rate and F value.
[0007] In some embodiments, the named entities include brand words, modifier words, main words, and specification words.
[0008] In some embodiments, the historical search data on the user side is denoised data.
[0009] In some embodiments, the standard commodities on the commodity side are randomly selected.
[0010] In some embodiments, the active learning annotation method using artificial intelligence uses the original data to train the pre-trained model and generate training data, and the BIOES annotation method is used for sequence annotation.
[0011] In some embodiments, the pre-trained model is a roBERTa model.
[0012] In some embodiments, the step of using the text in the training data as input text to train the combined model further includes: the input text is divided into multiple text units by the word segmenter of the pre-trained model; the text unit enters the pre-trained model and is converted into a two-dimensional tensor; the two-dimensional tensor enters the bidirectional long short-term memory network encoding to form a new two-dimensional tensor; the new two-dimensional tensor is decoded into an entity index of the corresponding position of the input text through a conditional random field; and the named entity corresponding to the input text is obtained according to the entity index.
[0013] In some embodiments, the evaluation index further includes a global evaluation index for the commodity named entity recognition model, and the global evaluation index is an average value or a weighted sum of the values of the evaluation indexes of the respective named entities.
[0014] In order to solve the above problems, the present invention also provides a commodity search text processing method, including: obtaining a text to be recognized from a search end; inputting the text to be recognized into a commodity search named entity recognition model generated by the commodity named entity recognition model generation method to perform named entity recognition and identify named entities; importing brand words and subject words in the named entities into a search keyword thesaurus; retrieving synonyms corresponding to the subject words in the named entities from a corpus, and importing them into a search synonym thesaurus; using the search keyword thesaurus and the search synonym thesaurus to match commodities to provide a search sequence, and sorting the search sequence by assigning weights to the named entities.
[0015] In some embodiments, synonyms corresponding to the main words in the named entity are retrieved from a corpus through a word vector generation model.
[0016] The above technical solution obtains historical search data on the user side and the main title, subtitle and shopping guide attributes of standard products on the product side as original data, adopts the active learning and labeling method of artificial intelligence, trains the pre-trained model and generates training data, trains the pre-trained model with the bidirectional long short-term memory network and the combined model constructed by the conditional random field, generates a product named entity recognition model, freezes the parameters of the pre-trained model during the training process, and evaluates the generated product named entity recognition model, and uses the product named entity recognition model for product search, thereby improving the richness of the search vocabulary and the accuracy of the search ranking, thereby improving the click-through rate and conversion rate of the search results page of the online shopping platform, further improving the transaction conversion rate of the search box of the online shopping platform, and reducing the search result-free rate.
[0017] It should be understood that the above general description and the detailed description below are exemplary and explanatory only and cannot limit the present invention. The techniques, methods and devices known to ordinary technicians in the relevant field may not be discussed in detail, but where appropriate, the techniques, methods and devices should be considered as part of the authorization specification. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments of the present invention are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0019] Figure 1 is a flowchart of a method for generating a commodity named entity recognition model provided by an embodiment of the present invention;
[0020] Figure 2 is a flowchart of steps for training the combined model provided by an embodiment of the present invention;
[0021] Figure 3 The figure is a flowchart of a method for processing commodity search text provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0022] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. 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 are within the scope of protection of the present invention.
[0023] Figure 1FIG. 1 is a flow chart of a method for generating a commodity named entity recognition model according to an embodiment of the present invention. Figure 1 As shown, the method for generating a named entity recognition model for a product includes: step S11, obtaining historical search data on the user side and the main title, subtitle and shopping guide attributes of standard products on the product side as original data; step S12, using an active learning labeling method of artificial intelligence, using the original data to train a pre-trained model and generate training data; step S13, using the pre-trained model and a bidirectional long short-term memory network, and a conditional random field to construct a combined model; step S14, using the training data to train the combined model to generate a named entity recognition model for a product, and freezing the parameters of the pre-trained model during the training process; step S15, evaluating the named entity recognition model for a product, and the evaluation indicators include accuracy, precision, recall and F value.
[0024] Referring to step S11, the historical search data on the user side and the main title, subtitle and shopping guide attributes of the standard products on the product side are obtained as original data. In this step, in order to make the model reasoning as close as possible to the actual distribution of Youxian data, the data volume of the historical search data on the user side and the standard products on the product side is basically the same, and both account for about half of the original data volume. Among them, the historical search data on the user side is the data after denoising, and obviously abnormal data is removed; the standard products on the product side are randomly extracted. The main title, subtitle and shopping guide attributes of the product respectively contain important information such as brand words, modifiers, main words, specification words, etc. required for product search.
[0025] Referring to step S12, an active learning labeling method of artificial intelligence is adopted, and the original data is used to train the pre-trained model and generate training data. In the active learning labeling method, during the training process, a machine learning algorithm is used to actively select the most valuable unlabeled data samples, request manual labeling, and then add these newly labeled data to the training set, retrain the model, and then iterate this process, so that the samples that are most helpful for model training can be more accurately located, so that the algorithm can select the most valuable samples for labeling, further improve learning efficiency, and reduce labor costs. In this embodiment, manual labeling is completed by the search group. First, a group of data is labeled for fine-tuning training of the pre-trained model, and then the pre-trained model recognizes a part of the entity data. The search group conducts manual review, returns the corrected data, and then strengthens the training of the pre-trained model for this part of the recognition error samples. The recognition ability, thereby continuously improving the recognition accuracy of the pre-trained model.
[0026] In this step, the BIOES annotation method is used for sequence annotation, where B (Begin) represents the beginning of an entity, I (Inside) represents the middle of an entity, O (Outside) represents a non-entity, E (End) represents the end of an entity, and S (Single) represents a single-word entity.
[0027] Referring to step S13, a combined model is constructed using the pre-trained model, a bidirectional long short-term memory network, and a conditional random field.
[0028] In this step, the pre-trained model is a roBERTa model. The RoBERTa (Robustly optimizedBERT approach) model has a powerful feature extraction capability, and can effectively extract deep features in the text through the Transformer encoder, so that it can capture rich contextual information. The bidirectional long short-term memory (Bi-directional Long Short-Term Memory, referred to as BiLSTM) network can simultaneously utilize forward and backward feature information through the stacking of two layers of long short-term memory (Long Short-Term Memory, referred to as LSTM) networks, so as to better combine contextual information for entity recognition. Conditional Random Field (Conditional Random Field, referred to as CRF) is a probabilistic model of an undirected graph that can optimize the annotation results and solve the problem of label bias, and is particularly suitable for sequence annotation tasks. It can use the joint probability of the entire sequence to optimize the annotation results, thereby avoiding the generation of unreasonable annotation sequences. This combination makes the combined model more accurate, stable and efficient in identifying entities.
[0029] In this step, the named entities include brand words, modifier words, main words, and specification words, which are mainly aimed at the behavior of users searching for products on online shopping platforms.
[0030] Referring to step S14, the text of the training data is used as input text to train the combined model to generate a commodity named entity recognition model, and the parameters of the pre-trained model are frozen during the training process. In this step, the parameters of the pre-trained model are frozen, and only the parameters of the bidirectional long short-term memory network and the conditional random field are adjusted, which can speed up the training speed, save computing resources, and prevent the overfitting problem caused by the pre-trained model losing too much information.
[0031] Figure 2 FIG. 1 is a flow chart of steps for training the combined model provided by an embodiment of the present invention. Figure 2As shown, the step of using the text in the training data as the input text to train the combined model further includes: step S21, the input text is divided into multiple text units by the word segmenter of the pre-training model; step S22, the text unit enters the pre-training model and is converted into a two-dimensional tensor; step S23, the two-dimensional tensor enters the bidirectional long short-term memory network encoding to form a new two-dimensional tensor; step S24, the new two-dimensional tensor is decoded into the entity index of the corresponding position of the input text through the conditional random field; step S25, the named entity corresponding to the input text is obtained according to the entity index.
[0032] In step S21, the pre-trained model is a roBERTa model, and the word segmenter of the pre-trained model switches the input text into multiple text units (tokens).
[0033] In step S22, the first encoding is performed using the pre-trained model, and the text unit generated in step S21 is converted into a two-dimensional tensor (embeddings).
[0034] In step S23, a second encoding is performed through the bidirectional long short-term memory network to transform the two-dimensional tensor into a new two-dimensional tensor (embeddings).
[0035] The pre-trained model and the bidirectional long short-term memory network are combined as an encoder of the combined model.
[0036] In step S24, the conditional random field serves as a decoder of the combined model, decoding the new two-dimensional tensor to generate an entity index corresponding to the input text, so that the corresponding named entity can be found through the entity index in step S25.
[0037] When training the combined model, the objective function of the training adopts a negative log-likelihood function associated with the probabilistic graphical model, aiming to optimize the sequence labeling results from a global perspective, solve the labeling bias problem, and improve the prediction accuracy and efficiency of the model.
[0038] In conditional random fields, the loss function is usually defined as the negative log-likelihood function, which is the negative logarithm of the probability of the correct sequence predicted by the model. Given an input sequence x and an output sequence y, the loss function of the conditional random field can be expressed as: Loss(x,y) = -logP(y|x), where maximizing P(y|x) is to minimize -logP(y|x).
[0039] Referring to step S15, the commodity named entity recognition model is evaluated, and the evaluation indicators include accuracy, precision, recall rate and F value.
[0040] The specific evaluation indicators are as follows:
[0041] The accuracy is: The accuracy is: The recall rate is: F value, mainly F1 value is: Among them, TP is a true positive example, the model predicts it to be a positive sample, and it is actually a positive sample; FN is a false negative example, the model predicts it to be a negative sample, but it is actually a positive sample; FP is a false positive example, the model predicts it to be a positive sample, but it is actually a negative sample; TN is a true negative example, the model predicts it to be a negative sample, and it is actually a negative sample.
[0042] In this step, the evaluation index also includes a global evaluation index for the commodity named entity recognition model, and the global evaluation index is the average value or weighted sum value of the evaluation index values of each named entity. For example, the named entities to be recognized by the combined model include brand words, modifiers, main words, and specification words. For the F value index, the global evaluation index of the model is obtained by taking the average value: F (global) = [F (brand) + F (modifier) + F (main body) + F (specification)] / 4, and the reference entity weights are ensured to be the same by taking the average value. If it is necessary to focus on one or several named entities, standardized weight distribution can be performed to assign different weights to different named entities. The global evaluation index is the weighted sum value of the evaluation index values of each named entity.
[0043] Based on the same inventive concept, the present invention also provides a commodity search text processing method.
[0044] Figure 3 FIG. 1 is a flowchart of a method for processing commodity search text provided by an embodiment of the present invention. Figure 3 As shown, the commodity search text processing method includes: step S31, obtaining the text to be recognized from the search end; step S32, inputting the text to be recognized into the commodity named entity recognition model generated by the commodity named entity recognition model generation method to perform named entity recognition and recognize the named entity; step S33, importing the brand words and subject words in the named entity into the search keyword thesaurus; step S34, retrieving the synonyms corresponding to the subject words in the named entity from the corpus, and importing them into the search synonym thesaurus; step S35, using the search keyword thesaurus and the search synonym thesaurus to match commodities to provide a search sequence, and sorting the search sequence by assigning weights to the named entities.
[0045] For example, step S31, obtain the text to be recognized as "Yili Wei Ke Zi Chocolate Milk 240ml / box" from the search end; step S32, input the text to be recognized into the commodity named entity recognition model generated by the commodity named entity recognition model generation method, recognize the brand words as "Yili" and "Wei Ke Zi", the modifier word as "chocolate", the main word as "milk", and the specification as "240ml / box", and the commodity named entity recognition model is trained by a combination model constructed by the pre-trained model, a bidirectional long short-term memory network, and a conditional random field. The inference step of the commodity named entity recognition model is the step of training the combination model, which can be referred to. Figure 2 ; Step S33, add the main word "milk", brand words "Yili" and "Weikezi" to the search keyword thesaurus respectively; Step S34, retrieve the synonyms of the main word "milk" from the corpus, and import them into the search synonym thesaurus; Step S35, use the search keyword thesaurus and the search synonym thesaurus to match the products, and assign weights to the named entities, that is, the more important the entity matching, the higher the ranking score of the product, thereby providing a search sequence that can fully consider the user's search intention.
[0046] In this embodiment, the synonyms corresponding to the main words in the named entity are retrieved from the corpus through the word vector generation model (Word2vec), and the retrieved synonyms are imported into the search synonym thesaurus through manual review and batch import, saving labor costs.
[0047] The above technical solution obtains historical search data on the user side and the main title, subtitle and shopping guide attributes of standard products on the product side as original data, adopts the active learning and labeling method of artificial intelligence, trains the pre-trained model and generates training data, trains the pre-trained model with the bidirectional long short-term memory network and the combined model constructed by the conditional random field, generates a product named entity recognition model, freezes the parameters of the pre-trained model during the training process, and evaluates the generated product named entity recognition model, and uses the product named entity recognition model for product search, thereby improving the richness of the search vocabulary and the accuracy of the search ranking, thereby improving the click-through rate and conversion rate of the search results page of the online shopping platform, further improving the transaction conversion rate of the search box of the online shopping platform, and reducing the search result-free rate.
[0048] It should be noted that, in this document, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion. The various embodiments in this specification are described in a related manner, and the same and similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
[0049] The above is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. It should be noted that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention, and these improvements and modifications should also be regarded as the protection scope of the present invention.
Claims
1. A method for generating a commodity named entity recognition model, characterized in that: include: Acquire historical search data on the user side and main titles, subtitles, and shopping guide attributes of standard products on the product side as raw data; Using an active learning annotation method of artificial intelligence, the original data is used to train a pre-trained model and generate training data; A combined model is constructed using the pre-trained model, a bidirectional long short-term memory network, and a conditional random field; Using the text of the training data as input text to train the combined model to generate a commodity named entity recognition model, and freezing the parameters of the pre-trained model during the training process; The commodity named entity recognition model is evaluated, and the evaluation indicators include accuracy, precision, recall rate and F value.
2. The method for generating a commodity named entity recognition model according to claim 1, characterized in that: The named entities include brand words, modifier words, main words, and specification words.
3. The method for generating a commodity named entity recognition model according to claim 1, characterized in that: The historical search data on the user side is the data after denoising.
4. The method for generating a commodity named entity recognition model according to claim 1, characterized in that: The standard products on the product side are randomly selected.
5. The method for generating a commodity named entity recognition model according to claim 1, characterized in that: In the active learning annotation method using artificial intelligence, in the step of using the original data to train the pre-training model and generate training data, the BIOES annotation method is used for sequence annotation.
6. The method for generating a commodity named entity recognition model according to claim 1, characterized in that: The pre-trained model is the roBERTa model.
7. The method for generating a commodity named entity recognition model according to claim 1, characterized in that: The step of using the text in the training data as input text to train the combined model further includes: The input text is divided into multiple text units by the word segmenter of the pre-trained model; The text unit enters the pre-trained model and is converted into a two-dimensional tensor; The two-dimensional tensor enters the bidirectional long short-term memory network encoding to form a new two-dimensional tensor; The new two-dimensional tensor is decoded into an entity index corresponding to the position of the input text through a conditional random field; The named entity corresponding to the input text is obtained according to the entity index.
8. The method for generating a commodity named entity recognition model according to claim 1, characterized in that: The evaluation index also includes a global evaluation index for the commodity named entity recognition model, and the global evaluation index is an average value or a weighted sum of the values of the evaluation indexes of the named entities.
9. A commodity search text processing method, characterized in that: include: Obtain the text to be recognized from the search end; Inputting the text to be recognized into a commodity named entity recognition model generated by the commodity named entity recognition model generation method according to any one of claims 1 to 8 to perform named entity recognition to recognize named entities; Importing the brand words and subject words in the named entity into a search keyword word library; Retrieving the synonyms corresponding to the subject words in the named entity from the corpus, and importing them into the search synonym thesaurus; The search keyword thesaurus and the search synonym thesaurus are used to match commodities to provide a search sequence, and the search sequence is ranked by assigning weights to the named entities.
10. The commodity search text processing method according to claim 9, characterized in that: The synonyms corresponding to the main words in the named entity are retrieved from the corpus through the word vector generation model.
