A method and device for calculating user preference
By processing the feature text in the user search log data, we calculate the user's semantic similarity and relevance score for the item category, which solves the problem of being unable to obtain the user's preference for the item category in the existing technology and achieves more accurate user preferences. Calculate and recommend results.
Patent Information
- Application Number
- CN201810420441.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-05-04
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2038-05-04
AI Technical Summary
The existing technology only focuses on the user's preferences for certain items when calculating user preferences, and cannot obtain the user's preferences for item categories, resulting in recommendation results that are not comprehensive and accurate enough to meet the needs of users.
By obtaining the log data generated by users in the process of searching for items, extracting feature text, using language model processing to obtain semantic similarity scores and relevance scores, and weighted calculations to obtain user preference scores, including semantic similarity scores and click preference scores. Comprehensively understand user preferences for item categories.
It improves the accuracy of user preference calculation, can better meet user needs, fully explore users' preferences for certain categories of products, and the calculation results are more accurate and closer to users' real thoughts.
Smart Images

Figure CN110516033B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and device for calculating user preferences. Background Art
[0002] The current Internet industry generally estimates user interest preferences based on the log data generated by users during searches, in order to provide recommended information that meets user needs and improve user experience. Most existing methods for implementing this process use prior knowledge and rules to mine user interests.
[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:
[0004] Existing technologies usually only focus on the preferences expressed by users for certain items, but are unable to obtain users' preferences for item categories, resulting in incomplete and inaccurate recommendation results that are difficult to meet user needs. Summary of the invention
[0005] In view of this, an embodiment of the present invention provides a method and device for calculating user preferences, which can improve the calculation accuracy of user preferences and better meet user needs.
[0006] To achieve the above object, according to one aspect of an embodiment of the present invention, a method for calculating user preferences is provided, comprising:
[0007] Obtaining log data generated by the user in the process of searching for items, and extracting feature text from the log data;
[0008] Processing the feature text using a language model to obtain text feature data, and classifying the text feature data to obtain a semantic similarity score for each item category;
[0009] Constructing keyword vectors corresponding to each item category according to the feature text, and processing the keyword vectors using a pre-trained relevance classification model to obtain a semantic relevance score for each item category;
[0010] Performing a weighted summation on the evaluation scores corresponding to each item category, and using the calculation result as the user preference score corresponding to each item category; wherein the evaluation score includes the semantic similarity score and the semantic association score;
[0011] A user preference is determined based on the user preference score.
[0012] Optionally, the log data includes click log data, and the evaluation score also includes a click preference score; before the step of weighted summing the evaluation scores corresponding to the item categories to obtain the user preference scores corresponding to the item categories, the method further includes:
[0013] Determine the number of clicks on each item name based on the click log data;
[0014] Determine the number of clicks for each item category based on the number of clicks for each item name and the correspondence between the item name and the item category;
[0015] The number of clicks for each item category is divided by the total number of clicks for all item categories to obtain the click preference score for each item category.
[0016] Optionally, the step of using a language model to process the feature text to obtain text feature data, and classifying the text feature data to obtain a semantic similarity score for each item category includes:
[0017] The feature texts are processed respectively using at least two language models to obtain at least two text feature data; each of the text feature data is input into a pre-trained similarity classification model corresponding to each of the language models to obtain a language model score for each item category; and the language model scores for each item category are fused using a pre-trained fusion model to obtain a semantic similarity score for each item category.
[0018] Optionally, before the step of inputting the text feature data into the pre-trained similarity classification models corresponding to the language models to obtain the language model scores of the item categories, the method further includes:
[0019] Obtaining log data and click log data generated by multiple other users in the process of searching for items;
[0020] Performing word segmentation processing on the log data and click log data of the plurality of other users to obtain training texts;
[0021] Processing the training text using a language model to obtain training feature data;
[0022] Using the item category as a classification label and the training feature data to train a classification model, to obtain a similarity classification model corresponding to the language model;
[0023] The above steps are performed for each language model to obtain a pre-trained similarity classification model corresponding to each language model.
[0024] Optionally, the steps of fusing the language model scores of each item category using a pre-trained fusion model to obtain the semantic similarity scores of each item category include:
[0025] Multiply the language model scores of an item category by two to obtain the nonlinear transformation feature value;
[0026] Inputting each of the language model scores and each of the nonlinear transformation feature values into a pre-trained fusion model to obtain a semantic similarity score for the item category;
[0027] The above steps are performed for each item category to obtain the semantic similarity score of each item category.
[0028] Optionally, the language model includes:
[0029] Glove, its corresponding text feature data is the word vector of each keyword in the feature text;
[0030] N-Gram, the corresponding text feature data is the context information of each keyword in the feature text;
[0031] Doc2vec, the corresponding text feature data is the document vector of the feature text.
[0032] Optionally, the step of constructing a keyword vector corresponding to each item category according to the feature text includes:
[0033] Count the number of occurrences of keywords under an item category;
[0034] Get the keywords with the highest number of occurrences in the top N, and use the obtained keywords as elements to construct an N-dimensional keyword vector corresponding to the item category;
[0035] The above process is performed for each item category to obtain a keyword vector corresponding to each item category.
[0036] To achieve the above object, according to another aspect of an embodiment of the present invention, a device for calculating user preferences is provided, comprising:
[0037] A feature extraction module is used to obtain log data generated by the user in the process of searching for items, and extract feature text from the log data;
[0038] A similarity score calculation module, used for processing the feature text using a language model to obtain text feature data, and classifying the text feature data to obtain a semantic similarity score for each item category;
[0039] A relevance score calculation module, used to construct a keyword vector corresponding to each item category according to the feature text, and process the keyword vector using a pre-trained relevance classification model to obtain a semantic relevance score for each item category;
[0040] A comprehensive calculation module, used to perform a weighted summation of the evaluation scores corresponding to each item category, and use the calculation result as the user preference score corresponding to each item category; wherein the evaluation score includes the semantic similarity score and the semantic association score;
[0041] A preference determination module is used to determine user preferences based on the user preference scores.
[0042] Optionally, the log data includes click log data, and the evaluation score also includes a click preference score; and the device further includes:
[0043] The click preference score calculation module is used to determine the number of clicks on each item name based on the click log data; determine the number of clicks on each item category based on the number of clicks on each item name and the correspondence between the item name and the item category; and divide the number of clicks on each item category by the total number of clicks on all item categories to obtain the click preference score for each item category.
[0044] Optionally, the similarity score calculation module is further used to:
[0045] The feature texts are processed respectively using at least two language models to obtain at least two text feature data; each of the text feature data is input into a pre-trained similarity classification model corresponding to each of the language models to obtain a language model score for each item category; and the language model scores for each item category are fused using a pre-trained fusion model to obtain a semantic similarity score for each item category.
[0046] Optionally, the similarity score calculation module is further used to:
[0047] Obtaining log data and click log data generated by multiple other users in the process of searching for items;
[0048] Performing word segmentation processing on the log data and click log data of the plurality of other users to obtain training texts;
[0049] Processing the training text using a language model to obtain training feature data;
[0050] Using the item category as a classification label and the training feature data to train a classification model, to obtain a similarity classification model corresponding to the language model;
[0051] The above steps are performed for each language model to obtain a pre-trained similarity classification model corresponding to each language model.
[0052] Optionally, the similarity score calculation module is further configured to:
[0053] Multiply the language model scores of an item category by two to obtain the nonlinear transformation feature value;
[0054] Inputting each of the language model scores and each of the nonlinear transformation feature values into a pre-trained fusion model to obtain a semantic similarity score for the item category;
[0055] The above steps are performed for each item category to obtain the semantic similarity score of each item category.
[0056] Optionally, the language model includes:
[0057] Glove, its corresponding text feature data is the word vector of each keyword in the feature text;
[0058] N-Gram, the corresponding text feature data is the context information of each keyword in the feature text;
[0059] Doc2vec, the corresponding text feature data is the document vector of the feature text.
[0060] Optionally, the association score calculation module is further used for:
[0061] Count the number of occurrences of keywords under an item category;
[0062] Get the keywords with the highest number of occurrences in the top N, and use the obtained keywords as elements to construct an N-dimensional keyword vector corresponding to the item category;
[0063] The above process is performed for each item category to obtain a keyword vector corresponding to each item category.
[0064] To achieve the above object, according to another aspect of an embodiment of the present invention, an electronic device for calculating user preferences is provided, comprising:
[0065] one or more processors;
[0066] a storage device for storing one or more programs,
[0067] When the one or more programs are executed by the one or more processors, the one or more processors at least implement:
[0068] Obtaining log data generated by the user in the process of searching for items, and extracting feature text from the log data;
[0069] Processing the feature text using a language model to obtain text feature data, and classifying the text feature data to obtain a semantic similarity score for each item category;
[0070] Constructing keyword vectors corresponding to each item category according to the feature text, and processing the keyword vectors using a pre-trained relevance classification model to obtain a semantic relevance score for each item category;
[0071] Performing a weighted summation on the evaluation scores corresponding to each item category, and using the calculation result as the user preference score corresponding to each item category; wherein the evaluation score includes the semantic similarity score and the semantic association score;
[0072] A user preference is determined based on the user preference score.
[0073] To achieve the above object, according to another aspect of an embodiment of the present invention, a computer readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, at least the following is implemented:
[0074] Obtaining log data generated by the user in the process of searching for items, and extracting feature text from the log data;
[0075] Processing the feature text using a language model to obtain text feature data, and classifying the text feature data to obtain a semantic similarity score for each item category;
[0076] Constructing keyword vectors corresponding to each item category according to the feature text, and processing the keyword vectors using a pre-trained relevance classification model to obtain a semantic relevance score for each item category;
[0077] Performing a weighted summation on the evaluation scores corresponding to each item category, and using the calculation result as the user preference score corresponding to each item category; wherein the evaluation score includes the semantic similarity score and the semantic association score;
[0078] A user preference is determined based on the user preference score.
[0079] One embodiment of the above invention has the following advantages or beneficial effects: Based on big data and machine learning technology, with the user's search log and click log as the basis, comprehensive quantification is performed from aspects such as the similarity between text semantics and user preferences, and the association between keywords contained in the text and user preferences, so as to obtain an evaluation score as a comparison basis, and weighted calculation is performed to obtain a user preference score. Compared with the prior art, this method can fully explore the user's preference for certain categories of goods, and because various factors are combined, the calculation result is more accurate and closer to the user's real thoughts.
[0080] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0081] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0082] Figure 1 is a schematic diagram of main steps of a method for calculating user preferences according to an embodiment of the present invention;
[0083] Figure 2 is a schematic diagram of main modules of an apparatus for calculating user preferences according to an embodiment of the present invention;
[0084] Figure 3 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0085] Figure 4 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0086] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0087] Figure 1 is a schematic diagram of main steps of a method for calculating user preferences according to an embodiment of the present invention.
[0088] like Figure 1 As shown, the method for calculating user preferences provided by an embodiment of the present invention includes:
[0089] S100, obtaining log data generated by the user in the process of searching for items, and extracting characteristic text from the log data. The log data is the words, phrases or phrases that the user interacts with in the process of searching for items. For example, the log data may include the search keywords entered by the user, and may also include the search results selected by the user by clicking or the like. After obtaining the log data, the text content in the log data is further segmented using a segmentation tool such as Jieba segmentation to obtain characteristic text; before segmentation, the obtained words may be cleaned, for example, removing data that does not correspond to a user name (i.e., data generated by temporary users, which can be considered to have a lower reference value than the data of logged-in users), removing data whose source cannot be determined (e.g., data that is missing and incomplete), and blacklist data (e.g., the physical address or Internet Protocol address of the user who generated the data has been added to the blacklist).
[0090] S101, using a language model to process the feature text to obtain text feature data, and classifying the text feature data to obtain the semantic similarity scores of each item category. Before using the language model to process the feature text, the feature text can also be processed with stop words to remove words such as adverbs, prepositions, conjunctions and interjections that contribute less to the amount of information in the text. The words contained in the feature text after the stop word processing are called keywords. The language model is an abstract mathematical modeling of language based on objective language facts, which can be roughly regarded as a correspondence: different language models establish the correspondence between text content and mathematical content from different perspectives. For example, the word2vec model mainly predicts the words around each keyword, and is more inclined to represent the semantic information of the word in the entire paragraph; the GloVe (Global vectors for word representation, global vector for word representation) model is used to represent the semantic information of the keyword dimension; N-gram is used to represent the contextual information of the keyword, that is, the semantic information before and after the keyword. The above language models can be used alone or in combination to more comprehensively reflect the similarity of semantics and user preferences, which will be specifically described in the subsequent embodiments.
[0091] In this step, the feature text is processed using a language model to obtain text feature data used to represent the semantics of the feature text, and then the text feature data is classified to further obtain the correspondence between each item category and the user's preference (the user's preference for each category is represented by the semantic similarity score). In addition, the "semantic similarity" in the feature "semantic similarity score" that appears in this step refers to the similarity between the user's preference and the semantics of the feature text.
[0092] S102, construct the keyword vectors corresponding to each item category according to the feature text, use the pre-trained association classification model to process the keyword vectors, and obtain the semantic association scores of each item category. Keyword vector refers to a vector composed of keywords as elements in the vector, and the "semantic association" in this step refers to the degree of association between the semantics contained in the keywords and user preferences. For example, when constructing a keyword vector, the following method can be used: count the number of occurrences of keywords under an item category; obtain the keywords with the first N occurrences (N is a natural number, such as 50, 70 or 100, etc.), and use the obtained keywords as elements to construct an N-dimensional keyword vector corresponding to the item category; perform the above process for each item category to obtain the keyword vector corresponding to each item category.
[0093] S103, performing weighted summation of the evaluation scores corresponding to each item category, and using the calculation result as the user preference score corresponding to each item category; wherein the evaluation score includes the semantic similarity score and the semantic association score. The specific weight value corresponding to each evaluation score can be determined according to the actual working environment.
[0094] S104, determining the user preference based on the user preference score. Generally, the item categories can be sorted in descending order according to the user preference score, and it is determined that the user prefers the products in the higher-ranked item categories.
[0095] In this embodiment and subsequent embodiments, a variety of pre-trained models appear. In actual operation, the pre-trained models can be obtained by obtaining log data of multiple other users and using these log data to train the corresponding models. The training process of some key models will be specifically described in subsequent embodiments.
[0096] In summary, it can be seen that the method provided in this embodiment is based on big data and machine learning technology, and takes the user's search log and click log as the basis, and comprehensively quantifies the similarity between text semantics and user preferences, the association between keywords contained in the text and user preferences, etc., to obtain an evaluation score as a comparison basis, and weighted calculation to obtain a user preference score. The method in this embodiment can calculate the user's preference at the item category level. For example, if the user has searched for milk powder, the method of the prior art will push milk powder of various brands. Using the method of this embodiment, it will also push baby toys, care products, complementary foods and other infant daily necessities. It can be seen that compared with the prior art, this method can fully explore the user's preference for certain categories of goods, and because various factors are combined, the calculation result is more accurate and closer to the user's real thoughts.
[0097] In some optional embodiments, the log data includes click log data, and the evaluation score also includes a click preference score; before the step of performing weighted summation on the evaluation scores corresponding to the item categories to obtain the user preference scores corresponding to the item categories in S103, the method further includes:
[0098] The number of clicks on each item name is determined according to the click log data; the number of clicks on each item category is determined according to the number of clicks on each item name and the correspondence between the item name and the item category; the number of clicks on each item category is divided by the total number of clicks on all item categories to obtain a click preference score for each item category.
[0099] This step provides another method for calculating the evaluation score, the click preference score, which is used to describe which search results the user is more inclined to click on, thereby reflecting the user's preference.
[0100] In some optional embodiments, S101, the step of using a language model to process the feature text to obtain text feature data, and classifying the text feature data to obtain a semantic similarity score for each item category includes:
[0101] Use at least two language models to process the feature texts respectively to obtain at least two text feature data; input each of the text feature data into a pre-trained similarity classification model corresponding to each of the language models to obtain the language model scores of each item category; use the pre-trained fusion model to fuse the language model scores of each item category to obtain the semantic similarity scores of each item category. When using different language models to process feature texts, the text feature data obtained are different; for example, when using the Glove model for processing, the corresponding text feature data is the word vector of each keyword in the feature text; when using the N-Gram model for processing, the corresponding text feature data is the context information of each keyword in the feature text; when using the Doc2vec model for processing, the corresponding text feature data is the document vector of the feature text.
[0102] In this embodiment, before the step of inputting the text feature data into the pre-trained similarity classification models corresponding to the language models to obtain the language model scores of the item categories, the following steps may be further included:
[0103] Obtaining log data and click log data generated by multiple other users in the process of searching for items;
[0104] Performing word segmentation processing on the log data and click log data of the plurality of other users to obtain training texts;
[0105] Processing the training text using a language model to obtain training feature data;
[0106] Using the item category as a classification label and the training feature data to train a classification model, to obtain a similarity classification model corresponding to the language model;
[0107] The above steps are performed for each language model to obtain a pre-trained similarity classification model corresponding to each language model.
[0108] The above steps describe a method for training a similarity classification model. This training step does not need to be performed during the preference calculation for a single user, but can be performed regularly when the server pressure is low, so that the latest classification model can be obtained in a timely manner through data analysis of a large number of users.
[0109] In this embodiment, the steps of fusing the language model scores of each item category using the pre-trained fusion model to obtain the semantic similarity scores of each item category include:
[0110] Multiply the language model scores of an item category by two to obtain the nonlinear transformation feature value;
[0111] Inputting each of the language model scores and each of the nonlinear transformation feature values into a pre-trained fusion model to obtain a semantic similarity score for the item category;
[0112] The above steps are performed for each item category to obtain the semantic similarity score of each item category.
[0113] In the above steps, before calculating each language model score, they are first multiplied two by two to obtain nonlinear transformation feature values, and then the nonlinear transformation feature values and the language model scores are input into the fusion model for classification calculation. This is to solve the collinearity problem in the classification process. The variables in this embodiment have a certain correlation. In order to avoid strong collinearity between these variables (equivalent to a significant increase in the weight of a certain variable) and affect the accuracy of the classification results, this embodiment further performs nonlinear transformation processing on these language model scores, so that the final semantic similarity score is more accurate.
[0114] The application of the above method is further described below by an embodiment applied to an e-commerce scenario. The steps in this embodiment mainly include the following parts:
[0115] 1. Data cleaning
[0116] A) Input data: log data
[0117] Log data of users using search engines on e-commerce websites and terminal products, such as search log data containing search keywords entered by users and click log data containing product names clicked by users.
[0118] B) Output data: legal log data
[0119] After cleaning the log data in this step, data without user IDs, data whose sources cannot be determined, and data from blacklisted IP addresses are removed, and the remaining data is considered to be legitimate log data.
[0120] 2. Category preference calculation
[0121] This step mainly includes four sub-steps:
[0122] (1) Click preference score calculation
[0123] Calculate the user's click preference score Score using the following formula i :
[0124]
[0125] where click_times i is the number of times the user clicks on the i-th category, m represents the total number of categories, is the total number of clicks of the user, and Score i represents the user's preference degree for category i.
[0126] (2) Semantic similarity score calculation
[0127] Perform word segmentation (using Jieba segmentation) and stop word processing (filtering auxiliary words and punctuation marks such as "de", "ma", etc.) on the legal log data to obtain feature text; this feature text consists of keywords.
[0128] A) Score calculation based on the Glove model
[0129] Use the feature text obtained from and processed from a large number of other users to train the Glove model to obtain a trained Glove model; input the feature text of a large number of other users into the trained Glove model to output word vectors, which form training data; use this training data to train the GBDT (Gradient Boosting Decision Tree) model to obtain a trained classification model corresponding to the Glove model.
[0130] Input the feature text of this user into the trained Glove model to output word vectors, which form text feature data. Input this text feature data into the trained classification model corresponding to the Glove model to output the Glove model score Score glove|j .
[0131] B) Score calculation based on the N-Gram model
[0132] Obtain the feature text from a large number of other users and process it to extract the Bi-Gram (i.e., in N-Gram, the occurrence of a word only depends on the word that appeared immediately before it) features of this feature text to form training data; use this training data to train the GBDT model to obtain a trained classification model corresponding to the N-Gram model.
[0133] Extract the Bi-Gram features of the feature text of this user to form text feature data. Input this text feature data into the trained classification model corresponding to the N-Gram model to output the N-Gram model score Scoren-gram|j 。
[0134] C) Score calculation based on the Doc2vec model
[0135] Train the Doc2vec model using the feature texts obtained and processed from a large number of other users to obtain a trained Doc2vec model; input the feature texts of a large number of other users into the trained Doc2vec model to output document vectors, which form the training data; use this training data to train the GBDT model to obtain a trained classification model corresponding to the Doc2vec model.
[0136] Input the feature text of this user into the trained Doc2vec model to output document vectors, which form the text feature data. Input this text feature data into the trained classification model corresponding to the Doc2vec model to output the Doc2vec model score Score doc2vec|j 。
[0137] D) Model fusion
[0138] Use the model scores output by the above Glove, N-gram, and Doc2vec, as well as the products of each model score with each other as features, and input them into the fusion model for fusion to output the final score Score j 。This fusion model is based on the SVM (Support Vector Machine) model or the LR (Logistic Regression) model and is trained by using the corresponding data of a large number of other users.
[0139] In the above model, if a label is used during training and classification, the label adopts the product category information.
[0140] (3) Semantic association degree score calculation
[0141] Perform word segmentation (using Jieba segmentation) and stop word processing (filtering auxiliary words and punctuation marks such as "de", "ma", etc.) on the legal log data to obtain the feature text; this feature text consists of keywords.
[0142] Perform correlation analysis on the keywords in the feature texts obtained from a large number of other users (for example, the corresponding relationship between keywords and categories can be pre-saved), and respectively obtain the top 100 (only an example, the specific quantity can be determined according to the actual scenario) keywords with the highest frequency (the most times) under each category in the feature text. Use these keywords as the elements of the vector to form the keyword vectors corresponding to each category as the training data; use the training data to train the GBDT classification model to obtain a trained association degree classification model.
[0143] Perform association analysis on the keywords in the user's feature text, construct keyword vectors for each category corresponding to the user according to the above method, input the trained association classification model, and output the semantic association score of each category of the user. k .
[0144] (4) Calculate user preference scores
[0145] Finally, the user's final score S is output:
[0146] S=0.4*score i +0.4*score j +0.2*score k
[0147] Among them, score i is the user's click behavior category preference, score j is the user semantic similarity, score k It is the correlation between users and categories. 0.4, 0.4, and 0.2 are selected based on experience and verified by experiments to be the best values for the scenario (in e-commerce scenarios). They can be re-determined as needed in actual use.
[0148] After obtaining the user's preference scores for each category, each category can be sorted according to the scores, and products in the product categories that the user cares about most can be recommended to the user in that order.
[0149] Figure 2 4 is a schematic diagram of main modules of an apparatus for calculating user preferences according to an embodiment of the present invention.
[0150] like Figure 2 As shown, according to another embodiment of the present invention, a device 200 for calculating user preferences is provided, comprising:
[0151] A feature extraction module 201 is used to obtain log data generated by the user in the process of searching for items, and extract feature text from the log data;
[0152] A similarity score calculation module 202 is used to process the feature text using a language model to obtain text feature data, and classify the text feature data to obtain a semantic similarity score for each item category;
[0153] A relevance score calculation module 203 is used to construct a keyword vector corresponding to each item category according to the feature text, and process the keyword vector using a pre-trained relevance classification model to obtain a semantic relevance score for each item category;
[0154] A comprehensive calculation module 204 is used to perform a weighted summation of the evaluation scores corresponding to each item category, and use the calculation result as the user preference score corresponding to each item category; wherein the evaluation score includes the semantic similarity score and the semantic association score;
[0155] The preference determination module 205 is configured to determine the user preference based on the user preference score.
[0156] In some optional embodiments, the log data includes click log data, and the evaluation score also includes a click preference score; the device 200 further includes:
[0157] The click preference score calculation module 206 is used to determine the number of clicks on each item name based on the click log data; determine the number of clicks on each item category based on the number of clicks on each item name and the correspondence between the item name and the item category; and divide the number of clicks on each item category by the total number of clicks on all item categories to obtain the click preference score for each item category.
[0158] In some optional embodiments, the similarity score calculation module 202 is further used to:
[0159] Using at least two language models to process the feature texts respectively to obtain at least two text feature data; inputting each of the text feature data into a pre-trained similarity classification model corresponding to each of the language models to obtain a language model score for each item category; using a pre-trained fusion model to fuse the language model scores for each item category to obtain a semantic similarity score for each item category;
[0160] In some optional embodiments, the similarity score calculation module 202 is further used to:
[0161] Obtaining log data and click log data generated by multiple other users in the process of searching for items;
[0162] Performing word segmentation processing on the log data and click log data of the plurality of other users to obtain training texts;
[0163] Processing the training text using a language model to obtain training feature data;
[0164] Using the item category as a classification label and the training feature data to train a classification model, to obtain a similarity classification model corresponding to the language model;
[0165] The above steps are performed for each language model to obtain a pre-trained similarity classification model corresponding to each language model.
[0166] In some optional embodiments, the similarity score calculation module 202 is further configured to:
[0167] Multiply the language model scores of an item category by two to obtain the nonlinear transformation feature value;
[0168] Inputting each of the language model scores and each of the nonlinear transformation feature values into a pre-trained fusion model to obtain a semantic similarity score for the item category;
[0169] The above steps are performed for each item category to obtain the semantic similarity score of each item category.
[0170] In some optional embodiments, the language model includes:
[0171] Glove, its corresponding text feature data is the word vector of each keyword in the feature text;
[0172] N-Gram, the corresponding text feature data is the context information of each keyword in the feature text;
[0173] Doc2vec, the corresponding text feature data is the document vector of the feature text.
[0174] In some optional embodiments, the association score calculation module 203 is further used for:
[0175] Count the number of occurrences of keywords under an item category;
[0176] Get the keywords with the highest number of occurrences in the top N, and use the obtained keywords as elements to construct an N-dimensional keyword vector corresponding to the item category;
[0177] The above process is performed for each item category to obtain a keyword vector corresponding to each item category.
[0178] In summary, the device provided in this embodiment is based on big data and machine learning technology, and takes the user's search log and click log as the basis, and comprehensively quantifies the similarity between text semantics and user preferences, the association between keywords contained in the text and user preferences, etc., to obtain an evaluation score as a comparison basis, and performs weighted calculation to obtain a user preference score. Compared with the prior art, the device can fully explore the user's preference for certain categories of goods, and because it combines various factors, the calculation result is more accurate and closer to the user's real thoughts.
[0179] Figure 3 An exemplary system architecture 300 is shown to which the method for calculating user preferences or the apparatus for calculating user preferences according to the embodiments of the present invention can be applied.
[0180] like Figure 3As shown, the system architecture 300 may include terminal devices 301, 302, 303, a network 304 and a server 305. The network 304 is used to provide a medium for communication links between the terminal devices 301, 302, 303 and the server 305. The network 304 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0181] Users can use terminal devices 301, 302, 303 to interact with server 305 through network 304 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 301, 302, 303, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0182] The terminal devices 301 , 302 , and 303 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers, etc.
[0183] Server 305 may be a server that provides various services, such as a background management server that provides support for shopping websites browsed by users using terminal devices 301, 302, 303. The background management server may receive and save log data generated by users in the process of searching for goods.
[0184] It should be noted that the method for calculating user preferences provided in the embodiment of the present invention is generally executed by the server 305 , and accordingly, the device for calculating user preferences is generally set in the server 305 .
[0185] It should be understood that Figure 3 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0186] According to an embodiment of the present invention, the present invention also provides an electronic device and a readable storage medium.
[0187] Figure 4 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention.
[0188] Reference below Figure 4 , which shows a schematic diagram of the structure of a computer system 400 of a terminal device suitable for implementing an embodiment of the present invention. Figure 4 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0189] like Figure 4As shown, the computer system 400 includes a central processing unit (CPU) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage part 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the system 400 are also stored. The CPU 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0190] The following components are connected to the I / O interface 405: an input section 406 including a keyboard, a mouse, etc.; an output section 407 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 408 including a hard disk, etc.; and a communication section 409 including a network interface card such as a LAN card, a modem, etc. The communication section 409 performs communication processing via a network such as the Internet. A drive 410 is also connected to the I / O interface 405 as needed. A removable medium 411, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 410 as needed, so that a computer program read therefrom is installed into the storage section 408 as needed.
[0191] In particular, according to an embodiment of the present invention, the process described in the schematic diagram of the main steps above can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the schematic diagram of the main steps. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 409, and / or installed from the removable medium 411. When the computer program is executed by the central processing unit (CPU) 401, the above-mentioned functions defined in the system of the present invention are executed.
[0192] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0193] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0194] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor, for example, it may be described as: a processor including a feature extraction module, a similarity score calculation module, a correlation score calculation module, a comprehensive calculation module and a preference determination module. The names of these modules do not constitute a limitation on the modules themselves in some cases. For example, the feature extraction module may also be described as "a module for obtaining log data generated by users in the process of searching for items and extracting feature text from the log data".
[0195] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes:
[0196] Obtaining log data generated by the user in the process of searching for items, and extracting feature text from the log data;
[0197] Processing the feature text using a language model to obtain text feature data, and classifying the text feature data to obtain a semantic similarity score for each item category;
[0198] Constructing keyword vectors corresponding to each item category according to the feature text, and processing the keyword vectors using a pre-trained relevance classification model to obtain a semantic relevance score for each item category;
[0199] Performing a weighted summation on the evaluation scores corresponding to each item category, and using the calculation result as the user preference score corresponding to each item category; wherein the evaluation score includes the semantic similarity score and the semantic association score;
[0200] A user preference is determined based on the user preference score.
[0201] According to the technical solution of the embodiment of the present invention, based on big data and machine learning technology, with the user's search log and click log as the basis, comprehensive quantification is performed from aspects such as the similarity between text semantics and user preferences, the association between keywords contained in the text and user preferences, etc., to obtain an evaluation score as a comparison basis, and weighted calculation is performed to obtain a user preference score. Compared with the prior art, this method can fully explore the user's preference for certain categories of goods, and because various factors are combined, the calculation result is more accurate and closer to the user's real thoughts.
[0202] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for calculating user preferences, characterized in that: include: Obtaining log data generated by the user in the process of searching for items, and extracting feature text from the log data; Processing the feature text using a language model to obtain text feature data, and classifying the text feature data to obtain a semantic similarity score for each item category; Constructing keyword vectors corresponding to each item category according to the feature text, processing the keyword vectors using a pre-trained relevance classification model, and obtaining a semantic relevance score of each item category corresponding to the user feature text; Performing a weighted summation on the evaluation scores corresponding to each item category, and using the calculation result as the user preference score corresponding to each item category; wherein the evaluation score includes the semantic similarity score and the semantic association score; determining a user preference based on the user preference score; The step of constructing a keyword vector corresponding to each item category according to the feature text includes: Count the number of occurrences of keywords under an item category; Get the keywords with the highest number of occurrences in the top N, and use the obtained keywords as elements to construct an N-dimensional keyword vector corresponding to the item category; The above process is performed for each item category to obtain a keyword vector corresponding to each item category.
2. The method according to claim 1, characterized in that The log data includes click log data, and the evaluation score also includes a click preference score; Before the step of weighted summing of the evaluation scores corresponding to the item categories to obtain the user preference scores corresponding to the item categories, the method further includes: Determine the number of clicks on each item name based on the click log data; Determine the number of clicks for each item category based on the number of clicks for each item name and the correspondence between the item name and the item category; The number of clicks for each item category is divided by the total number of clicks for all item categories to obtain the click preference score for each item category.
3. The method according to claim 1, characterized in that The steps of using a language model to process the feature text to obtain text feature data, and classifying the text feature data to obtain a semantic similarity score of each item category include: The feature texts are processed respectively using at least two language models to obtain at least two text feature data; each of the text feature data is input into a pre-trained similarity classification model corresponding to each of the language models to obtain a language model score for each item category; and the language model scores for each item category are fused using a pre-trained fusion model to obtain a semantic similarity score for each item category.
4. The method according to claim 3, characterized in that Before the step of inputting the text feature data into the pre-trained similarity classification models corresponding to the language models to obtain the language model scores of the item categories, the method further includes: Obtaining log data and click log data generated by multiple other users in the process of searching for items; Performing word segmentation processing on the log data and click log data of the plurality of other users to obtain training texts; Processing the training text using a language model to obtain training feature data; Using the item category as a classification label and the training feature data to train a classification model, to obtain a similarity classification model corresponding to the language model; The above steps are performed for each language model to obtain a pre-trained similarity classification model corresponding to each language model.
5. The method according to claim 3, characterized in that: The steps of using the pre-trained fusion model to fuse the language model scores of each item category to obtain the semantic similarity scores of each item category include: Multiply the language model scores of an item category by two to obtain the nonlinear transformation feature value; Inputting each of the language model scores and each of the nonlinear transformation feature values into a pre-trained fusion model to obtain a semantic similarity score for the item category; The above steps are performed for each item category to obtain the semantic similarity score of each item category.
6. The method according to claim 3, characterized in that: The language model includes: Glove, its corresponding text feature data is the word vector of each keyword in the feature text; N-Gram, the corresponding text feature data is the context information of each keyword in the feature text; Doc2vec, the corresponding text feature data is the document vector of the feature text.
7. A device for calculating user preferences, characterized in that: include: A feature extraction module is used to obtain log data generated by the user in the process of searching for items, and extract feature text from the log data; A similarity score calculation module, used for processing the feature text using a language model to obtain text feature data, and classifying the text feature data to obtain a semantic similarity score for each item category; A relevance score calculation module is used to construct a keyword vector corresponding to each item category according to the feature text, process the keyword vector using a pre-trained relevance classification model, and obtain a semantic relevance score of each item category corresponding to the user feature text; and is also used to: count the number of occurrences of keywords under an item category; obtain the keywords with the top N occurrences, and use the obtained keywords as elements to construct an N-dimensional keyword vector corresponding to the item category; The above process is performed for each item category to obtain the keyword vector corresponding to each item category; A comprehensive calculation module, used to perform a weighted summation of the evaluation scores corresponding to each item category, and use the calculation result as the user preference score corresponding to each item category; wherein the evaluation score includes the semantic similarity score and the semantic association score; A preference determination module is used to determine user preferences based on the user preference scores.
8. The device according to claim 7, characterized in that The log data includes click log data, and the evaluation score also includes a click preference score; the device also includes: The click preference score calculation module is used to determine the number of clicks on each item name based on the click log data; determine the number of clicks on each item category based on the number of clicks on each item name and the correspondence between the item name and the item category; and divide the number of clicks on each item category by the total number of clicks on all item categories to obtain the click preference score for each item category.
9. The device according to claim 7, characterized in that The similarity score calculation module is also used for: The feature texts are processed respectively using at least two language models to obtain at least two text feature data; each of the text feature data is input into a pre-trained similarity classification model corresponding to each of the language models to obtain a language model score for each item category; and the language model scores for each item category are fused using a pre-trained fusion model to obtain a semantic similarity score for each item category.
10. The device according to claim 9, characterized in that The similarity score calculation module is also used for: Obtaining log data and click log data generated by multiple other users in the process of searching for items; Performing word segmentation processing on the log data and click log data of the plurality of other users to obtain training texts; Processing the training text using a language model to obtain training feature data; Using the item category as a classification label and the training feature data to train a classification model, to obtain a similarity classification model corresponding to the language model; The above steps are performed for each language model to obtain a pre-trained similarity classification model corresponding to each language model.
11. The device according to claim 9, characterized in that The similarity score calculation module is further used for: Multiply the language model scores of an item category by two to obtain the nonlinear transformation feature value; Inputting each of the language model scores and each of the nonlinear transformation feature values into a pre-trained fusion model to obtain a semantic similarity score for the item category; The above steps are performed for each item category to obtain the semantic similarity score of each item category.
12. The device according to claim 9, characterized in that The language model includes: Glove, its corresponding text feature data is the word vector of each keyword in the feature text; N-Gram, the corresponding text feature data is the context information of each keyword in the feature text; Doc2vec, the corresponding text feature data is the document vector of the feature text.
13. An electronic device for calculating user preferences, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.
14. A computer readable 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 6 is implemented.
