A method for associating shopping needs with commodities
By training the shopping demand identification model, identifying the named entities in the product title of the e-commerce platform, establishing the connection between shopping demand and product, solving the problem of mismatch between the recommended products on the e-commerce platform and user needs, and achieving high matching and wide coverage of products recommend.
Patent Information
- Application Number
- CN202110564384.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-24
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2041-05-24
AI Technical Summary
It is difficult for e-commerce platforms to accurately identify the shopping needs expressed in the search statements entered by users, resulting in the mismatch of recommended products with user needs and the inability to fully cover multiple product types.
By obtaining product title samples, using the named entity recognition (NER) algorithm to train the shopping demand recognition model, identify the named entities in the product title, establish the association between shopping demand and the product, and then recommend matching products to users.
It has achieved the recommendation of products with high matching and wide coverage for users under known user needs, and improved the accuracy and comprehensiveness of the recommendation of the e-commerce platform.
Smart Images

Figure CN113256379B_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of the present specification relate to the field of information technology, and more particularly, to a method for associating shopping needs with commodities. Background Art
[0002] In actual applications, users often use e-commerce platforms without the specific purpose of purchasing a specific product. Users usually enter search terms into e-commerce platforms, such as "how to get rid of insects" and "what to use for kitchen cleaning". These search terms usually only indicate a certain shopping need of the user, such as getting rid of insects, kitchen cleaning, etc., but cannot specifically point to a certain type of product.
[0003] Assuming that the e-commerce platform can determine the user's shopping needs based on the search statements entered by the user, then how to recommend products that can meet the shopping needs to the user is a technical problem that needs to be solved urgently. Summary of the invention
[0004] In order to overcome the problems existing in the related art, the present disclosure provides a method for associating shopping needs with commodities, a method for recommending commodities to users, and a device, an electronic device and a storage medium.
[0005] According to a first aspect of an embodiment of the present disclosure, a method for associating shopping needs with commodities is provided, the method comprising:
[0006] For the products to be associated with the shopping demand on the e-commerce platform, obtain the product titles corresponding to the products;
[0007] Inputting the obtained product title into a shopping demand identification model to identify the shopping demand satisfied by the product name in the obtained product title;
[0008] Establishing an association between the identified shopping demand and the product;
[0009] Among them, the training method of the shopping demand identification model includes: obtaining product title samples, taking the product names contained in the product title samples as named entities, taking the shopping needs satisfied by the product names in the product title samples as named entity types, and performing model training based on the named entity type identification NER algorithm.
[0010] According to a second aspect of the present disclosure, a method for recommending products to a user is disclosed, which is applied to an e-commerce platform, and the method comprises:
[0011] Obtaining a search statement input by a user, and determining matching shopping needs based on the search statement;
[0012] Recommending at least part of the commodities associated with the determined shopping demand to the user; wherein the association between the shopping demand and the commodities is determined by the method of aspect 1.
[0013] According to a third aspect of the present disclosure, a device for associating shopping needs with commodities is disclosed, comprising:
[0014] An acquisition module, for obtaining the product title corresponding to the product to be associated with the shopping demand on the e-commerce platform;
[0015] an identification module, inputting the obtained product title into a shopping demand identification model, and identifying the shopping demand satisfied by the product name in the obtained product title;
[0016] An association module, establishing an association between the identified shopping demand and the commodity;
[0017] Among them, the training method of the shopping demand identification model includes: obtaining product title samples, taking the product names contained in the product title samples as named entities, taking the shopping needs satisfied by the product names in the product title samples as named entity types, and performing model training based on the named entity type identification NER algorithm.
[0018] According to a fourth aspect of the present disclosure, a device for recommending products to users is disclosed, which is applied to an e-commerce platform, and the device includes:
[0019] An acquisition module, which acquires a search statement input by a user and determines matching shopping needs according to the search statement;
[0020] The recommendation module recommends at least part of the commodities associated with the determined shopping demand to the user; wherein the association between the shopping demand and the commodities is determined by the method of the first aspect.
[0021] According to a fifth aspect of the present disclosure, an electronic device is disclosed, comprising: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement the method according to the first aspect and the second aspect of claim 1.
[0022] According to a sixth aspect of the present disclosure, a non-temporary computer-readable storage medium is disclosed, on which a computer program is stored, and when the program is executed by a processor, the method of the first aspect and the second aspect is implemented.
[0023] In the above technical solution, the problem of "how to recommend products to users when the shopping needs of users are known" is converted into the problem of "associating shopping needs with products". In addition, the problem of "how to associate shopping needs with products" is further converted into the problem of "how to identify named entities from product titles (define the product name in the product title as a named entity)".
[0024] In this way, multiple product title samples can be obtained, and the product names contained in each product title sample are named entities, and the shopping needs satisfied by each product name in each product title sample are named entity types. Based on the named entity type recognition NER algorithm, model training is performed to obtain a shopping demand recognition model. Therefore, the shopping demand recognition model can be used to associate products on the e-commerce platform with various shopping needs. This association relationship can also be used to recommend products with a high degree of shopping demand matching to users, given that the user's shopping needs are known. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 This is a schematic diagram provided in this manual for a user to search using an e-commerce platform.
[0026] Figure 2 It is a flowchart of a method for associating shopping demands with commodities provided in an embodiment of this specification.
[0027] Figure 3 It is a flowchart of a method for determining user shopping needs provided in an embodiment of this specification.
[0028] Figure 4 It is a structural diagram of a demand keyword identification model provided in this specification.
[0029] Figure 5 It is a schematic diagram of the architecture of an integration model provided in an embodiment of this specification.
[0030] Figure 6 This is a structural diagram of a device for associating shopping needs with commodities provided in this specification.
[0031] Figure 7 This is a schematic diagram of the structure of a device for recommending products to users provided in this manual.
[0032] Figure 8 It is a structural diagram of a device for determining user shopping needs provided in this specification.
[0033] Fig. 9 It is a structural diagram of a device for determining demand representation words for shopping needs provided in this specification.
[0034] Fig.10It is a structural schematic diagram of a device for determining similarity between demand keywords provided in this specification.
[0035] Fig.11 is a schematic structural diagram of an electronic device 1500 according to an exemplary embodiment.
[0036] Fig.12 is a schematic structural diagram of another electronic device 1600 according to an exemplary embodiment. DETAILED DESCRIPTION
[0037] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0038] The terms used in this disclosure are for the purpose of describing specific embodiments only and are not intended to limit the disclosure. The singular forms of "a", "said" and "the" used in this disclosure and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0039] It should be understood that although the terms first, second, third, etc. may be used in the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present disclosure, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0040] In actual applications, users often use e-commerce platforms without the specific purpose of purchasing a specific product. Users usually enter search terms into e-commerce platforms, such as "how to get rid of insects" and "what to use for kitchen cleaning". These search terms usually only indicate a certain shopping need of the user, such as getting rid of insects, kitchen cleaning, etc., but cannot specifically point to a certain type of product.
[0041] For an e-commerce platform, it first needs to determine the user's shopping needs based on the search statement entered by the user, and then recommend several products that can meet the shopping needs to the user based on the user's shopping needs. It is understandable that the e-commerce platform often hopes that the shopping needs determined based on the search statement are accurate, and also hopes that the products recommended to the user have a high degree of match with the user's shopping needs and are as comprehensive as possible (i.e., covering as many types of products as possible).
[0042] This disclosure proposes a technical solution for recommending products to users based on known shopping needs. Specifically:
[0043] The problem of "how to recommend products to users when their shopping needs are known" is converted into the problem of "associating shopping needs with products". In addition, the problem of "how to associate shopping needs with products" is further converted into the problem of "how to identify named entities from product titles (define the product names in product titles as named entities)".
[0044] In this way, multiple product title samples can be obtained, and the product names contained in each product title sample are named entities, and the shopping needs satisfied by each product name in each product title sample are named entity types. Based on the named entity type recognition NER algorithm, model training is performed to obtain a shopping demand recognition model. Therefore, the shopping demand recognition model can be used to associate products on the e-commerce platform with various shopping needs. This association relationship can also be used to recommend products associated with shopping needs to users on the premise of knowing the user's shopping needs, and each product recommended to the user can meet the user's shopping needs as comprehensively as possible.
[0045] Figure 1 This is a schematic diagram provided in this manual for users to search using an e-commerce platform. Figure 1 As shown, the user enters the search statement "home cleaning" into the search box on the page, and the e-commerce platform recommends several products that meet the shopping needs expressed by the search statement to the user.
[0046] Figure 2 This is a flow chart of a method for associating shopping needs with commodities provided in an embodiment of this specification, comprising the following steps:
[0047] S200: For the products to be associated with the shopping demand on the e-commerce platform, obtain the product titles corresponding to the products.
[0048] In the field of e-commerce, merchants usually write the product name in the title of the product purchase page (i.e., the product title). Sometimes, in order to increase the probability of their products being retrieved, merchants will list multiple product names in different expressions in the product title. For example, product names such as electric kettle, kettle, and electric kettle all correspond to one product.
[0049] S202: Input the obtained product titles into a shopping demand identification model to identify the shopping demand satisfied by each product name in the obtained product titles.
[0050] When a product needs to be associated with a matching shopping demand, the title of the product is input into the shopping demand recognition model.
[0051] The training method of the shopping demand recognition model may include: obtaining product title samples, taking the product names contained in the product title samples as named entities, taking the shopping demands satisfied by the product names in the product title samples as named entity types, and performing model training based on a named entity type recognition NER algorithm. In practical applications, there are usually multiple product title samples obtained, taking the product names contained in each product title sample as named entities, taking the shopping demands satisfied by the product names in each product title sample as named entity types, and performing model training based on a named entity type recognition NER algorithm.
[0052] In other words, the input of the model can be each product title sample, and the output can be the named entity label corresponding to each product name in the product title sample.
[0053] There are many NER algorithms. In some embodiments, the BERT algorithm, the BiLSTM algorithm and the CRF algorithm can be combined to implement the NER algorithm, and a model including a BERT algorithm layer, a BiLSTM algorithm layer and a CRF algorithm layer connected in sequence is constructed for training.
[0054] In some embodiments, the word2vec algorithm, the BiLSTM algorithm, and the CRF algorithm may be combined to construct a model including a word2vec algorithm layer, a BiLSTM algorithm layer, and a CRF algorithm layer connected in sequence for training.
[0055] It should be noted that in the above two models, the first layer of the model is usually used to vectorize (or encode) each Chinese character in the input product title sample, so that the vector-represented product title sample can enter the BiLSTM algorithm layer for training or recognition. The BiLSTM algorithm layer can learn what information to remember and what information to forget during the training process, so it can better capture longer-distance dependencies, and the BiLSTM algorithm layer can learn semantic information in both the front and back directions of the sentence.
[0056] In the model application stage, the output of the BiLSTM algorithm layer is the probability that each word in the sentence is a named entity of each type. There is no connection between the probabilities corresponding to each word (the probability of belonging to a part of a named entity is considered at the granularity of a single word), and the probability of belonging to a named entity is not considered at the granularity of a word. This can easily lead to the identification of a named entity composed of each word that is part of a named entity based only on the output of the BiLSTM algorithm layer, which is not the desired product name.
[0057] Therefore, the output of the BiLSTM algorithm layer is further input into the CRF algorithm layer. The CRF algorithm can consider the connection between individual characters and analyze the probability of various possible combinations belonging to named entities. According to the output of the CRF algorithm layer, the character combination (i.e., word) with the highest probability belonging to each type of named entity can be determined. Among these probabilities, the named entity type corresponding to the highest probability represents the shopping demand satisfied by the product name.
[0058] It should also be noted that when training a shopping demand recognition model, three labels, B, I, and O, are usually used to perform named entity annotation on the product names in the search sentence samples. Use B to mark the first word of the demand keyword, use I to mark the other words of the demand keyword, and use O to mark the parts of the search sentence that are not related to the demand keyword. A search sentence may contain more than one demand keyword. When actually annotating, the label is followed by the named entity type, such as BS (S represents the named entity type), IS. Figure 3 In the method flow shown, there are multiple named entity types (corresponding to multiple shopping needs respectively).
[0059] In addition, in the process of training the shopping demand identification model, the actual product title can be obtained, and based on the shopping demand satisfied by the product name in the actual product title, at least one other product name that satisfies the shopping demand is determined, and the at least one other product name is added to the actual product title to obtain the product title sample.
[0060] In practical applications, multiple actual product titles can usually be obtained from the database of the e-commerce platform. For each actual product title, according to the shopping needs satisfied by each product name in the actual product title, at least one other product name that satisfies the shopping needs is determined, and the at least one other product name is added to the actual product title to obtain a product title sample. Since there may be multiple actual product titles obtained, a product title sample can be obtained for each actual product title, and therefore, multiple product title samples can be obtained.
[0061] In this way, not only can the amount of data be expanded when the labeling manpower is limited, but the model can also learn more specifically the shopping needs that you want it to identify.
[0062] S204: Establishing an association between the identified shopping demand and the product.
[0063] Thus, in the application stage, the search statement input by the user can be obtained, and the matching shopping needs can be determined according to the search statement. Then, at least part of the commodities associated with the determined shopping needs can be recommended to the user.
[0064] Furthermore, in some embodiments, the matching shopping needs are determined based on the search statement, which may specifically be to extract demand keywords from the search statement, and determine the matching shopping needs based on the extracted demand keywords.
[0065] In some embodiments, a corresponding demand representation word may be pre-assigned to each shopping demand. In this way, if there is a demand representation word identical to the extracted demand keyword, the shopping demand corresponding to the demand representation word is determined as the matching shopping demand. If there is no demand representation word identical to the extracted demand keyword, the demand representation word closest in meaning to the extracted demand keyword is determined, and the shopping demand corresponding to the demand representation word is determined as the matching shopping demand.
[0066] When determining the demand representation word that is closest in meaning to the extracted demand keyword, the extracted demand keyword and each demand table testimony are actually calculated for similarity one by one, and the demand table testimony corresponding to the calculated maximum similarity is used as the demand representation word that is closest in meaning to the extracted demand keyword. The method used here to calculate the similarity in meaning between two words can be a method well known to those skilled in the art, or it can be a similarity calculation method given in this article.
[0067] In some embodiments, after the e-commerce platform determines the demand representation word corresponding to the search statement, if it finds that the demand representation word is inconsistent with the demand keyword in the search statement input by the user, the e-commerce platform can prompt the user with the demand representation word. After the user clicks on the demand representation word, the e-commerce platform recommends the product associated with the demand representation word to the user for purchase.
[0068] It should be noted that the method for extracting demand keywords here can be implemented using the demand keyword recognition model described later, or can be implemented using other methods. For example, the following method can be used to extract demand keywords:
[0069] The search sentence is segmented, and each segmented word is input into a word classification model. According to the segmented words classified as demand keywords, matching shopping demands are determined.
[0070] The training method of the word classification model includes: obtaining multiple search sentence samples, and extracting demand keywords from each search sentence sample. Taking each extracted demand keyword as a white sample, a classification algorithm is used to perform model training. Black samples can be specified according to actual conditions.
[0071] If the above-mentioned word classification model is used to extract the required keywords from the search sentence, the search sentence input by the user needs to be segmented first, and each segmented word is input into the word classification model one by one to determine whether each segmented word is a required keyword.
[0072] In addition, the above-mentioned word classification model may include a BERT algorithm layer, a BiLSTM algorithm layer and a fully connected layer connected in sequence. Among them, the BERT algorithm layer may also be replaced by other algorithm layers for vectorizing Chinese characters in words, such as a word2vec algorithm layer.
[0073] In the embodiment where the word classification model includes the BERT algorithm layer, since it is a classification task, the vector representation corresponding to the text classification representation CLS output by BERT can be used to more "fairly" integrate the semantic information of each character in the word. The vector representation corresponding to CLS is also input into the fully connected layer, so that the fully connected layer combines the overall text representation of the word to be identified with the output of BiLSTM to determine the classification.
[0074] The above-mentioned solution of extracting demand keywords from search sentences based on the word classification model actually converts the task of extracting demand keywords from search sentences into the problem of determining whether each word in the search sentence belongs to the demand keyword one by one. By inputting each word in the search sentence into the word classification model, it can be determined whether each word in the search sentence belongs to the demand keyword, thus achieving the purpose of identifying the demand keyword from the search sentence. Afterwards, the user's shopping needs can be determined based on the identified demand keywords, and then the products that meet the shopping needs can be recommended to the user.
[0075] In addition, the present disclosure also proposes a technical solution for determining shopping needs based on search statements. Specifically:
[0076] The problem of "how to determine shopping needs based on search statements" is converted into the problem of "how to extract demand keywords from search statements". Demand keywords can accurately reflect shopping needs. In addition, the problem of "how to extract demand keywords from search statements" is converted into the problem of "how to identify named entities from search statements (define demand keywords in search statements as named entities)".
[0077] In this way, multiple search sentence samples can be obtained, and the demand keywords contained in each search sentence sample are used as named entities. Based on the named entity recognition (NER) algorithm, model training is performed to obtain a demand keyword recognition model. The demand keyword recognition model can then be used to identify demand keywords from the search sentences input by the user, and based on the identified demand keywords, shopping needs can be accurately matched.
[0078] Figure 3 This is a flow chart of a method for determining a user's shopping needs provided by an embodiment of this specification, comprising the following steps:
[0079] S300: Obtaining a search statement input by a user.
[0080] Figure 3 The method shown is applied to a system of an e-commerce platform. Figure 3 The method flow shown is for any search statement input by any user.
[0081] The search sentence described in this article refers to the sentence that the user enters into the page provided by the e-commerce platform when shopping on the e-commerce platform. The e-commerce platform retrieves products based on the search sentence and recommends them to the user.
[0082] S302: Input the search statement into a demand keyword recognition model to identify demand keywords.
[0083] The training method of the demand keyword recognition model includes: obtaining multiple search sentence samples, taking the demand keywords contained in each search sentence sample as named entities, and performing model training based on a named entity recognition (NER) algorithm.
[0084] In other words, the input of the model is each search sentence sample, and the output is the named entity label of the required keyword in the sentence sample.
[0085] There are many NER algorithms. In some embodiments, the BERT algorithm, the BiLSTM algorithm, and the CRF algorithm can be combined to construct a model including a BERT algorithm layer, a BiLSTM algorithm layer, and a CRF algorithm layer connected in sequence for training.
[0086] In some embodiments, the word2vec algorithm, the BiLSTM algorithm, and the CRF algorithm may be combined to construct a model including a word2vec algorithm layer, a BiLSTM algorithm layer, and a CRF algorithm layer connected in sequence for training.
[0087] It should be noted that in the above two models, the first layer of the model is usually used to vectorize (or encode) each Chinese character in the input search sentence, so that the search sentence represented by the vector can enter the BiLSTM algorithm layer for training or recognition. During the training process, the BiLSTM algorithm layer can learn what information to remember and what information to forget, so it can better capture longer-distance dependencies. The BiLSTM algorithm layer can learn the semantic information in both the front and back directions of the sentence.
[0088] However, in the model application stage, the output of the BiLSTM algorithm layer is the probability of whether each word in the sentence is a named entity. There is no connection between the probabilities corresponding to each word (the probability of being part of a named entity is considered at the granularity of a single word), and the probability of being a named entity is not considered at the granularity of a word. This can easily lead to the identification of named entities composed of each word that is part of a named entity based solely on the output of the BiLSTM algorithm layer, which is not the desired keyword.
[0089] Therefore, the output of the BiLSTM algorithm layer is further input into the CRF algorithm layer. The CRF algorithm can consider the connection between individual characters and analyze the probability of various possible combinations belonging to the named entity. According to the output of the CRF algorithm layer, the character combination (i.e., word) with the highest probability of belonging to the named entity can be determined. This word is the demand keyword.
[0090] It should also be noted that when training the demand keyword model, three labels, B, I, and O, are usually used to perform named entity annotation on the demand keywords in the search sentence samples. Use B to mark the first word of the demand keyword, use I to mark the other words of the demand keyword, and use O to mark the parts of the search sentence that are not related to the demand keyword. A search sentence may contain more than one demand keyword. When actually annotating, the label is followed by the named entity type, such as BS (S represents the named entity type), IS. Figure 1 In the method flow shown, there is actually only one named entity type, which is the requirement keyword.
[0091] Figure 4 This is a schematic diagram of the structure of a demand keyword recognition model provided in this specification. Figure 4 As shown in the figure, the input search sentence (Query) is "What to buy for outdoor cycling". The search sentence is first input into the BERT layer, and then the encoding of the search sentence output by the BERT layer is input into the BiLSTM (bidirectional LSTM) neural network layer. The output recognition result enters the CRF layer for correction, and the CRF layer finally outputs the corrected recognition result. Since it is the training stage, the output of the CRF layer is specified, and "outdoor cycling" is specified as the demand keyword, which is the named entity that the model is required to recognize through learning.
[0092] S304: Determine matching shopping needs based on the identified demand keywords.
[0093] It should be explained here how to find matching shopping needs based on demand keywords. This can be achieved through the idea of "finding demand table testimonies that are similar in meaning to the demand keywords". Demand table testimonies are used to represent shopping needs.
[0094] In some embodiments, the identified demand keyword may be defined as a demand table testimony of a shopping demand. A shopping demand may have multiple demand table testimony.
[0095] In addition, in some embodiments, a corresponding demand representation word is pre-assigned to each shopping demand. If there is a demand representation word that is the same as the identified demand keyword, the shopping demand corresponding to the demand representation word is determined as the matching shopping demand. If there is no demand representation word that is the same as the identified demand keyword, the demand representation word that is closest in meaning to the extracted demand keyword is determined, and the shopping demand corresponding to the demand representation word is determined as the matching shopping demand.
[0096] In addition, the present disclosure also provides a method for determining demand representation words for shopping needs. Specifically, multiple historical search statements can be obtained. For each historical search statement, the historical search statement is input into a demand keyword recognition model to identify the demand keyword. Each identified demand keyword is added to a candidate set of demand representation words. According to the similarity between each demand keyword in the set, the set is divided into multiple subsets, and the similarity between each demand keyword in the same subset is greater than a specified threshold. In this way, each demand keyword in the same subset meets the same shopping demand, and different subsets correspond to different shopping demands. Then, based on different subsets, different demand representation words are determined. The demand representation word corresponding to each subset is a representation word used to characterize the demand corresponding to the subset.
[0097] The above method for determining demand representation words is actually to unify multiple demand keywords with similar meanings into one shopping demand, and summarize these multiple demand keywords with similar meanings into one demand keyword. In some embodiments, a demand keyword can be selected from the subset as a demand table testimony representing the shopping demand, or a new word can be created based on each demand keyword in the subset as the demand table testimony.
[0098] In some embodiments, before calculating the similarity between each demand keyword in the set, several search sentence samples for training the demand keyword recognition model may be obtained, and the demand keyword in each obtained search sentence sample is added to the set. In this way, as many demand keywords as possible may be taken into consideration.
[0099] As for how to determine the similarity between each required keyword in the set, various known algorithms for calculating the similarity of the meaning between two words can be used for implementation.
[0100] The present disclosure provides a technical solution that integrates multiple similarity determination methods, as follows:
[0101] For any two demand keywords in the set, at least two different similarity determination methods are used to respectively determine the similarity between the two demand keywords. A weighted calculation is performed based on the at least two similarities obtained, and the calculation result is used again as the similarity between the two demand keywords.
[0102] The weighted calculation mentioned above means that different weights are assigned to different similarity determination methods, and the results of various similarity determination methods are multiplied by the weights and added. This method can combine a variety of similarity determination methods based on different principles and analyze the similarity between two demand keywords from multiple perspectives.
[0103] A similarity determination method used in the present disclosure is to calculate the Jaro distance between two demand keywords. The Jaro distance focuses on the similarity of the literal meanings of the two demand keywords, and pays attention to which words are the same in the two demand keywords. The closer the literal meanings, the smaller the Jaro distance. The Jaro distance calculation formula is as follows:
[0104]
[0105] Among them, s1 and s2 represent a demand keyword respectively, m represents the number of repeated characters contained in the two demand keywords, and t represents the number of characters that need to be modified in the process of converting one demand keyword into another demand keyword.
[0106] Furthermore, the Jaro-Winkler distance method can be used for calculation, and the formula is as follows:
[0107]
[0108] The Jaro-Winkler distance is obtained after the Jaro distance is calculated, and it also takes into account the number of characters p corresponding to the same prefix of the two demand keywords, that is, the two demand keywords have p consecutive characters that are the same starting from the first character.
[0109] Another similarity determination method used in the present disclosure is to calculate the cosine distance between two demand keywords. First, a word2vec (a word vector mapping algorithm) model is trained based on the product titles on the e-commerce platform, and then the trained word2vec model is used to map the two demand keywords to be calculated for similarity into word vectors, and the cosine distance between the two word vectors is compared as a similarity representation.
[0110] Before training the word2vec model, you can set the word2vec model as follows:
[0111] Parameter name meaning S 0, sg=0 means CBOW model, sg=1 means Skip-gram model Size 128, set the dimension of the word vector window 10. Set the maximum window length between the current word and the predicted word in the text alpha 0.03, set the learning rate of the model min_count 1, if the word frequency is less than min_count, it will be discarded. The default value is 5 iter 5, represents the number of iterations of the model negative 5. Set the number of negative samples to indicate how many noise words are contained
[0112] In addition, before calculating the cosine distance between each demand keyword, the edit distance between each demand keyword can be calculated first, that is, the minimum number of edit operations required to convert one demand keyword into another is calculated. Grouping several demand keywords with an edit distance less than a specified distance into a group, and then calculating the cosine distance between demand keywords in each group can effectively reduce the amount of cosine distance calculation.
[0113] In addition, the present disclosure also provides a method for determining the similarity between demand keywords. It should be noted that the method for determining the similarity between demand keywords can be applied to the embodiments described above to determine the similarity between two demand keywords, or may not be applied to the embodiments described above. In other words, the demand keywords described in the method for determining the similarity between demand keywords may be demand keywords identified from search statements in the embodiments described above, or may not be demand keywords identified from search statements, but may be keywords related to user shopping needs obtained from other channels (e.g., from a questionnaire survey of a group of users), or may be demand keywords generated based on certain demand keyword generation rules.
[0114] The method for determining the similarity between the demand keywords may be:
[0115] Based on the first demand keyword, searching for products on the e-commerce platform, and concatenating the product name of each product in at least part of the retrieved products into a first product name text corresponding to the first demand keyword;
[0116] Based on the second demand keyword, searching for products on the e-commerce platform, and concatenating the product name of each product in at least part of the retrieved products into a second product name text corresponding to the second demand keyword;
[0117] Based on the text encoding model, a first text matrix corresponding to the first product name text and a second text matrix corresponding to the second product name text are obtained, and a combined matrix formed by splicing the first text matrix and the second text matrix is input into a pre-trained text classification model to obtain a probability of belonging to a positive classification; wherein, when training the text classification model, a combined matrix formed by splicing text matrices of product name texts corresponding to two demand keywords marked as similar is used as an input corresponding to the positive classification; a combined matrix formed by splicing text matrices of product name texts corresponding to two demand keywords marked as dissimilar is used as an input corresponding to the negative classification;
[0118] The obtained probability is determined as the similarity between the first requirement keyword and the second requirement keyword.
[0119] The above method actually converts the similarity calculation problem between two demand keywords into a text classification problem, and uses the text classification method to indirectly solve the similarity calculation problem.
[0120] The key point of the above method is that, on the one hand, the demand keywords are used to search on the e-commerce platform, and the product names in the search results are combined into name texts, which can be used as the features of the demand keywords. On the other hand, two different name texts are spliced into one text, and the classification is defined as positive classification (the label can be 1) and negative classification (the label can be 0). The positive classification indicates that the two parts of the text are similar, and the negative classification indicates that the two parts of the text are dissimilar.
[0121] In the model training stage, the text classification model is made to learn the similarity rules between the two parts contained in the spliced text. In the model application stage, after the text spliced together from the two name texts that need to calculate the similarity is input into the text classification model, the output probability of belonging to the positive classification can represent the similarity between the two name texts, that is, the similarity between the demand keywords corresponding to the two name texts.
[0122] The function of the text encoding model is to map the product name text into a text matrix, where each row in the text matrix represents a vector corresponding to a word in the text, or each column represents a vector corresponding to a word in the text.
[0123] In the above method for determining the similarity between the required keywords, there may be multiple classification algorithms adopted by the text classification model, and there may also be multiple encoding algorithms adopted by the text encoding model.
[0124] In some embodiments, the text classification model may include: a fully connected layer, or at least two connected fully connected layers, wherein each fully connected layer is used to perform vector compression (the vectors of each row in the text matrix are fully connected and then compressed), and the last fully connected layer contains an activation function, which is used to map the vector output by the corresponding fully connected layer into a probability of belonging to a positive classification and a probability of belonging to a negative classification.
[0125] In some embodiments, the text encoding model may include: a Bert algorithm layer, a BiLSTM algorithm layer, and a self-attention algorithm layer connected in sequence. The text encoding model may further include a maximum pooling layer connected after the self-attention algorithm layer.
[0126] The reason for introducing the self-attention algorithm layer is that, on the one hand, different words in the product name text have different importance in representing shopping needs, and the self-attention algorithm can give different attention weights to different words in the text. On the other hand, the self-attention algorithm can capture the long-distance dependencies between words in the text, thereby improving the encoding effect of the text encoding model.
[0127] The role of the maximum pooling layer is to reduce the amount of encoded data and prevent overfitting.
[0128] In some embodiments, an integrated model may be constructed, and the training of a text encoding model and a text classification model may be completed at the same time through the process of training the integrated model.
[0129] Specifically, the integrated model may include a text classification model, a matrix concatenation layer, and two text encoding models. The text classification model uses the combination matrix output by the matrix concatenation layer as input; the matrix concatenation layer uses the text matrix output by each text encoding model as input; and the two text encoding models use different product name texts as input.
[0130] Figure 5 Schematic diagram of an integrated model provided in the embodiment of this specification. Figure 5 As shown in the figure, the integrated model includes a text classification model (i.e., a fully connected layer), a matrix layer, a text encoding model 1, and a text encoding model 2. Among them, the text encoding model further includes a BERT algorithm layer, a BiLSTM algorithm layer, a self-attention algorithm layer, and a maximum pooling layer.
[0131] In the training phase of the combined model, several positive samples and negative samples are obtained. Each positive sample can be the product name text corresponding to two demand keywords marked as similar; each negative sample can be the product name text corresponding to two demand keywords marked as dissimilar. It can be understood that the probability that a positive sample belongs to the positive classification is 1, and the probability that a negative sample belongs to the positive classification is 0.
[0132] After the combined model is trained, in the application stage of the combined model, for the first demand keyword and the second demand keyword that need to be calculated for similarity, the first product name text corresponding to the first demand keyword is obtained, and the second product name text corresponding to the second demand keyword is obtained. The first product name text and the second product name text are input into the trained integrated model, and the probability of belonging to the positive classification is output, which can be used as a representation of the similarity between the first demand keyword and the second demand keyword.
[0133] It should be noted that when at least one fully connected layer (for example, two) is used as a text classification model, the process of training the text classification model is actually the process of iteratively adjusting the parameters in the fully connected layer. The target of iterative adjustment can be defined as the objective function:
[0134] L(sim,g)=glog(sim)+(1-g)log(1-sim);
[0135] Among them, sim represents the probability of belonging to the positive classification, and g represents whether the sample belongs to the positive classification (1) or the negative classification (0). It can be understood that by maximizing the value of the above objective function and iteratively adjusting the parameters in the fully connected layer, a text classification model with better effect can be trained.
[0136] For the aforementioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should know that the present disclosure is not limited by the described order of actions, because according to the present disclosure, certain steps can be performed in other orders or simultaneously.
[0137] Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present disclosure.
[0138] Corresponding to the aforementioned application function implementation method embodiment, the present disclosure also provides an application function implementation device and a corresponding terminal embodiment.
[0139] Figure 6 This is a schematic diagram of a device for associating shopping needs with commodities provided in this specification, including:
[0140] An acquisition module 601 acquires a product title corresponding to a product to be associated with a shopping demand on an e-commerce platform;
[0141] The identification module 602 inputs the obtained product title into a shopping demand identification model to identify the shopping demand satisfied by the product name in the obtained product title;
[0142] An association module 603 is used to establish an association between the identified shopping demand and the commodity;
[0143] Among them, the training method of the shopping demand identification model includes: obtaining product title samples, taking the product names contained in the product title samples as named entities, taking the shopping needs satisfied by the product names in the product title samples as named entity types, and performing model training based on the named entity type identification NER algorithm.
[0144] Figure 7 This is a schematic diagram of a device for recommending products to users provided in this specification, which is applied to an e-commerce platform. The device includes:
[0145] The acquisition module 701 acquires the search statement input by the user and determines the matching shopping demand according to the search statement;
[0146] The recommendation module 702 recommends at least some of the commodities associated with the determined shopping demand to the user.
[0147] Figure 8 This is a schematic diagram of a device for determining a user's shopping needs provided in this specification, which is applied to an e-commerce platform. The device includes:
[0148] Acquisition module 801, acquiring a search statement input by a user;
[0149] The recognition module 802 inputs the search sentence into the demand keyword recognition model to recognize the demand keywords; wherein the training method of the demand keyword recognition model includes: obtaining multiple search sentence samples, taking the demand keywords contained in each search sentence sample as named entities, and performing model training based on the named entity recognition (NER) algorithm;
[0150] The determination module 803 determines the matching shopping demand according to the identified demand keywords.
[0151] Fig. 9 This is a schematic diagram of a structure of a device for determining a demand representation word for a shopping demand provided in this specification, comprising:
[0152] An acquisition module 901 acquires a plurality of historical search statements;
[0153] Identification module 902, for each historical search sentence, inputs the historical search sentence into a demand keyword identification model to identify the demand keyword;
[0154] An adding module 903 adds each identified demand keyword to a candidate set of demand representation words;
[0155] A division module 904 divides the set into a plurality of sub-sets according to the similarity between the demand keywords in the set; the similarity between the demand keywords in the same sub-set is greater than a specified threshold;
[0156] The determination module 905 determines different demand representation words based on different subsets.
[0157] Fig.10 This specification provides a device for determining similarity between demand keywords, the device comprising:
[0158] The first acquisition module 101 searches for products on the e-commerce platform based on the first demand keyword, and concatenates the product name of each product among at least part of the retrieved products into a first product name text corresponding to the first demand keyword;
[0159] The second acquisition module 1002 searches for products on the e-commerce platform based on the second demand keyword, and concatenates the product name of each product in at least part of the retrieved products into a second product name text corresponding to the second demand keyword;
[0160] The calculation module 1003 obtains a first text matrix corresponding to the first product name text and a second text matrix corresponding to the second product name text based on a text encoding model, and inputs a combined matrix formed by splicing the first text matrix and the second text matrix into a pre-trained text classification model to obtain a probability belonging to a positive classification; wherein, when training the text classification model, a combined matrix formed by splicing text matrices of two different product name texts corresponding to the same demand keyword is the input corresponding to the positive classification; a combined matrix formed by splicing text matrices of product name texts corresponding to two different demand keywords is the input corresponding to the negative classification; and the obtained probability is determined as the similarity between the first demand keyword and the second demand keyword.
[0161] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can refer to the partial description of the method embodiments. The device embodiments described above are only schematic, wherein the units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the disclosed solution. A person of ordinary skill in the art may understand and implement it without creative work.
[0162] Fig.11 1 is a schematic diagram of the structure of an electronic device 1500 according to an exemplary embodiment. For example, the device 1500 may be a user device, and may specifically be a mobile phone, a computer, a digital broadcast terminal, a message transceiver device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, a wearable device such as a smart watch, a smart glasses, a smart bracelet, a smart running shoe, etc.
[0163] Reference Fig.11 , device 1500 may include one or more of the following components: a processing component 1502 , a memory 1504 , a power component 1506 , a multimedia component 1508 , an audio component 1510 , an input / output (I / O) interface 1512 , a sensor component 1514 , and a communication component 1516 .
[0164] The processing component 1502 generally controls the overall operation of the device 1500, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 1502 may include one or more processors 1520 to execute instructions to perform all or part of the steps of the above-described method. In addition, the processing component 1502 may include one or more modules to facilitate interaction between the processing component 1502 and other components. For example, the processing component 1502 may include a multimedia module to facilitate interaction between the multimedia component 1508 and the processing component 1502.
[0165] The memory 1504 is configured to store various types of data to support operations on the device 1500. Examples of such data include instructions for any application or method operating on the device 1500, contact data, phone book data, messages, pictures, videos, etc. The memory 1504 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0166] The power supply component 1506 provides power to the various components of the device 1500. The power supply component 1506 can include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 1500.
[0167] The multimedia component 1508 includes a screen that provides an output interface between the above-mentioned device 1500 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The above-mentioned touch sensor can not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the above-mentioned touch or slide operation. In some embodiments, the multimedia component 1508 includes a front camera and / or a rear camera. When the device 1500 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have a focal length and optical zoom capability.
[0168] The audio component 1510 is configured to output and / or input audio signals. For example, the audio component 1510 includes a microphone (MIC), and when the device 1500 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 1504 or sent via the communication component 1516. In some embodiments, the audio component 1510 also includes a speaker for outputting audio signals.
[0169] I / O interface 1512 provides an interface between processing component 1502 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.
[0170] The sensor assembly 1514 includes one or more sensors for providing various aspects of status assessment for the device 1500. For example, the sensor assembly 1514 can detect the open / closed state of the device 1500, the relative positioning of components, such as the display and keypad of the device 1500, the sensor assembly 1514 can also detect the position change of the device 1500 or a component of the device 1500, the presence or absence of user contact with the device 1500, the orientation or acceleration / deceleration of the device 1500, and the temperature change of the device 1500. The sensor assembly 1514 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 1514 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1514 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0171] The communication component 1516 is configured to facilitate wired or wireless communication between the device 1500 and other devices. The device 1500 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, 4G LTE, 5G NR, or a combination thereof. In an exemplary embodiment, the communication component 1516 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1516 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0172] In an exemplary embodiment, device 1500 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0173] In an exemplary embodiment, a non-transitory computer-readable storage medium is also provided, such as a memory 1504 including instructions, which, when executed by a processor 1520 of the device 1500, enables the device 1500 to execute the methods of the various embodiments of this specification.
[0174] The non-transitory computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
[0175] like Fig.12 As shown, Fig.12 FIG. 1 is a schematic diagram of a structure of another electronic device 1600 according to an exemplary embodiment. For example, the device 1600 may be provided as an application server. Figure 7 , the device 1600 includes a processing component 1622, which further includes one or more processors, and a memory resource represented by a memory 1616 for storing instructions, such as applications, that can be executed by the processing component 1622. The application stored in the memory 1616 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1622 is configured to execute instructions to perform the above method.
[0176] The device 1600 may also include a power component 1626 configured to perform power management of the device 1600, a wired or wireless network interface 1650 configured to connect the device 1600 to a network, and an input / output (I / O) interface 1658. The device 1600 may operate based on an operating system stored in the memory 1616, such as Android, iOS, Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, or the like.
[0177] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 1616 including instructions, which can be executed by a processing component 1622 of the device 1600 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0178] When the instructions in the memory 1616 are executed by the processing component 1622, the device 1600 is enabled to execute the methods of the embodiments of this specification.
[0179] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0180] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for associating shopping needs with commodities, characterized in that: include: For the products to be associated with the shopping demand on the e-commerce platform, obtain the product titles corresponding to the products; Inputting the obtained product title into a shopping demand identification model to identify the shopping demand satisfied by the product name in the obtained product title; Establishing an association between the identified shopping demand and the product; Among them, the training method of the shopping demand identification model includes: obtaining product title samples, taking the product names contained in the product title samples as named entities, taking the shopping needs satisfied by the product names in the product title samples as named entity types, and performing model training based on the named entity type identification NER algorithm.
2. The method according to claim 1, characterized in that: The shopping demand identification model includes a BERT algorithm layer, a BiLSTM algorithm layer and a CRF algorithm layer connected in sequence.
3. The method according to claim 1, characterized in that: Get sample product titles, including: Get the actual product title; According to the shopping demand satisfied by the product name in the actual product title, at least one other product name satisfying the shopping demand is determined, and the at least one other product name is added to the actual product title to obtain the product title sample.
4. The method according to claim 1, characterized in that: The shopping needs satisfied by the product names in the product title samples are named entity types, including: For the product title sample, if any two product names in the product title sample satisfy different shopping needs, different named entity types are determined for the two product names.
5. A method for recommending products to a user, characterized in that: Applied to an e-commerce platform, the method includes: Obtaining a search statement input by a user, and determining matching shopping needs based on the search statement; Recommending at least part of the commodities associated with the determined shopping demand to the user; wherein the association between the shopping demand and the commodities is determined by the method according to any one of claims 1 to 4.
6. The method according to claim 5, characterized in that According to the search statement, matching shopping needs are determined, including: Demand keywords are extracted from the search statement, and the matching shopping demand is determined based on the extracted demand keywords.
7. The method according to claim 6, characterized in that According to the extracted demand keywords, the matching shopping needs are determined, including: Assign demand representation words to shopping demands in advance; If there is a demand representation word that is the same as the extracted demand keyword, determining the shopping demand corresponding to the demand representation word as the matched shopping demand; If there is no demand representation word identical to the extracted demand keyword, a demand representation word closest in meaning to the extracted demand keyword is determined from the demand table testimony, and the shopping demand corresponding to the closest demand representation word is determined as the matched shopping demand.
8. The method according to claim 6, characterized in that: According to the search statement, matching shopping needs are determined, including: The search statement is input into a demand keyword recognition model, and the matching shopping demand is determined based on the recognized demand keyword.
9. The method according to claim 8, characterized in that The training method of the demand keyword recognition model includes: A search sentence sample is obtained, and the demand keywords contained in the search sentence sample are used as named entities, and model training is performed based on the NER algorithm.
10. The method according to claim 9, characterized in that The demand keyword recognition model includes a BERT algorithm layer, a BiLSTM algorithm layer and a CRF algorithm layer connected in sequence.
11. The method according to claim 6, characterized in that: According to the search statement, matching shopping needs are determined, including: Segmenting the search sentence, and inputting the segmented words into a word classification model; The matched shopping demand is determined according to the segmented words classified as the demand keywords.
12. The method according to claim 11, characterized in that: The training method of the word classification model includes: Obtaining a search sentence sample, and extracting demand keywords from the search sentence sample; The extracted demand keywords are used as white samples and a classification algorithm is used to perform model training.
13. The method according to claim 12, characterized in that: The word classification model includes a BERT algorithm layer, a BiLSTM algorithm layer and a fully connected layer connected in sequence.
14. A device for associating shopping needs with commodities, characterized in that: include: An acquisition module, for obtaining the product title corresponding to the product to be associated with the shopping demand on the e-commerce platform; an identification module, inputting the obtained product title into a shopping demand identification model, and identifying the shopping demand satisfied by the product name in the obtained product title; An association module, establishing an association between the identified shopping demand and the commodity; Among them, the training method of the shopping demand identification model includes: obtaining product title samples, taking the product names contained in the product title samples as named entities, taking the shopping needs satisfied by the product names in the product title samples as named entity types, and performing model training based on the named entity type identification NER algorithm.
15. A device for recommending products to users, characterized in that: Applied to an e-commerce platform, the device comprises: An acquisition module, which acquires a search statement input by a user and determines matching shopping needs according to the search statement; A recommendation module recommends at least part of the commodities associated with the determined shopping demand to the user; wherein the association between the shopping demand and the commodities is determined by the method described in any one of claims 1-4.
16. An electronic device, characterized in that: include: processor; A memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement the method as claimed in any one of claims 1-13.
17. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 13 is implemented.
Citation Information
Patent Citations
Method and device for identifying commodity with labels and method for commodity navigation
CN103678335A
Commodity recommendation method and device
CN104915860A
Method and device for recognizing commodity name from text
CN105045909A
Property acquisition method and device
CN107203548A
Goods association method and device and computer readable storage medium
CN107464162A
