Item recommendation method and device
By building an interest tree and optimizing it to expand the scope of recommendations, the problem of novelty and low accuracy of recommendation results in existing recommendation systems is solved, and a better user experience is achieved.
Patent Information
- Application Number
- CN202010023700.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-01-09
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2040-01-09
AI Technical Summary
The existing recommendation system limits the recommended items to items with interactive behaviors when recommending items, resulting in poor novelty, low accuracy and poor user experience.
Build an interest tree by obtaining the historical evaluation set of items, and optimize the interest tree based on user behavior data, expanding the recommendation range to items in multiple categories.
It improves the novelty and accuracy of recommended results, expands the range of recommendations, and improves the user experience.
Smart Images

Figure CN113094576B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an item recommendation method and device. Background Art
[0002] As an intelligent application of e-commerce, the recommendation system can recommend relevant products to users based on their needs and preferences.
[0003] At present, recommendation systems are generally based on statistical algorithms, which determine the correlation between products based on the user's historical behavior data, and then recommend products to users based on the correlation between products and the user's behavior data. For example, based on the user's historical behavior data, using statistical algorithms such as Apriori or FP-growth, it is calculated that when a user browses product A, they are likely to browse product B, and are less likely to browse product C, that is, the correlation between product A and product B is strong, and the correlation between product A and product C is weak. Then, when a new user browses product A, product B is recommended to the new user.
[0004] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:
[0005] Since existing recommendation systems determine recommended items from items corresponding to user behavior data, when recommending items, the recommended items are limited to items with which the user has interacted, resulting in poor novelty in the recommendation results. Furthermore, since users are likely to select items outside the interaction range, the recommendation accuracy of this recommendation method is low, resulting in a poor user experience. Summary of the invention
[0006] In view of this, an embodiment of the present invention provides an item recommendation method, which can expand the set of items to be recommended to users from items that have interactive behaviors with users to items of multiple categories, thereby improving the novelty and accuracy of recommendation results, thereby improving user experience.
[0007] To achieve the above objective, according to one aspect of an embodiment of the present invention, a method for recommending an item is provided.
[0008] An item recommendation method according to an embodiment of the present invention includes:
[0009] Acquire a historical evaluation set of an item, wherein evaluation data in the historical evaluation set indicates a first item attribute of the item;
[0010] constructing an interest tree according to the first item attribute and the frequency of occurrence of the first item attribute in the historical evaluation set, wherein different nodes in the interest tree correspond to different first item attributes;
[0011] Acquire first behavior data of a first user within a set period, and optimize the interest tree according to the first behavior data;
[0012] When the second behavior data of the second user is obtained, the target item attributes related to the second behavior data are determined using the optimized interest tree, and the items to be recommended to the second user are determined according to the target item attributes.
[0013] Optionally,
[0014] The optimizing the interest tree according to the first behavior data includes:
[0015] Determining a characteristic value and a weight value of the first item attribute;
[0016] Determining a second item attribute for interest tree optimization from the interest tree according to the feature value and the weight value, and the position of the first item attribute in the interest tree;
[0017] The interest tree is optimized according to the first behavior data, the second item attribute and the structure of the interest tree.
[0018] Optionally,
[0019] The determining, from the interest tree, a second item attribute for interest tree optimization includes:
[0020] According to the characteristic value and weight value of the first item attribute corresponding to the first behavior data in the interest tree, and the first connection paths of multiple first item attributes in the interest tree, the first connection probabilities of multiple first item attributes in the interest tree are calculated, and the multiple first item attributes corresponding to the maximum first connection probability are used as the second item attributes.
[0021] Optionally,
[0022] The optimizing the interest tree according to the first behavior data, the second item attribute and the structure of the interest tree includes:
[0023] The first behavior data, the second item attribute and the interest tree are used as inputs of a deep neural network, and an error ratio between a predicted value output by the deep neural network and a preset target value is calculated; when the error ratio is greater than a preset threshold, the weight value and feature value of the second item attribute in the interest tree are adjusted; wherein the deep neural network includes a Relu layer and a softmax layer.
[0024] Optionally,
[0025] Determining the target item attribute related to the second behavior data using the optimized interest tree includes:
[0026] Determine multiple third item attributes related to the second behavior data, and based on the characteristic value and weight value of the first item attribute that is the same as the third item attribute in the interest tree, and the multiple third item attributes corresponding to at least one second connection path of the interest tree, respectively calculate the second connection probability corresponding to the at least one second connection path, and use the first item attribute on the second connection path corresponding to the maximum second connection probability as the target item attribute.
[0027] Optionally,
[0028] The adjusting the weight value and the feature value of the second item attribute in the interest tree includes:
[0029] The weight value and feature value of the second item attribute are adjusted using a gradient descent algorithm.
[0030] To achieve the above objective, according to another aspect of an embodiment of the present invention, a device for recommending items is provided.
[0031] An item recommendation device according to an embodiment of the present invention comprises: an acquisition module, a construction module, an optimization module and a recommendation module; wherein:
[0032] The acquisition module is used to acquire a historical evaluation set of an item, wherein the evaluation data in the historical evaluation set indicates a first item attribute of the item;
[0033] The construction module is used to construct an interest tree according to the first item attribute and the frequency of occurrence of the first item attribute in the historical evaluation set, where different nodes in the interest tree correspond to different first item attributes;
[0034] The optimization module is used to obtain first behavior data of a first user within a set period, and optimize the interest tree according to the first behavior data;
[0035] The recommendation module is used to determine the target item attributes related to the second behavior data using the optimized interest tree when the second behavior data of the second user is obtained, and determine the items to be recommended to the second user according to the target item attributes.
[0036] Optionally,
[0037] The optimization module is used to determine the characteristic value and weight value of the first item attribute; determine the second item attribute for interest tree optimization from the interest tree according to the characteristic value and weight value, and the position of the first item attribute in the interest tree; and optimize the interest tree according to the first behavior data, the second item attribute and the structure of the interest tree.
[0038] Optionally,
[0039] The optimization module is used to calculate the first connection probabilities of multiple first item attributes in the interest tree according to the feature value and weight value of the first item attribute corresponding to the first behavior data in the interest tree, and the first connection paths of multiple first item attributes in the interest tree, and use the multiple first item attributes corresponding to the maximum first connection probability as the second item attributes.
[0040] Optionally,
[0041] The optimization module is used to use the first behavior data, the second item attribute and the interest tree as inputs of a deep neural network, and calculate the error ratio between the predicted value output by the deep neural network and a preset target value. When the error ratio is greater than a preset threshold, the weight value and feature value of the second item attribute in the interest tree are adjusted; wherein the deep neural network includes a Relu layer and a softmax layer.
[0042] Optionally, the recommendation module is used to determine multiple third item attributes related to the second behavior data, and based on the feature value and weight value of the first item attribute that is the same as the third item attribute in the interest tree, and the multiple third item attributes corresponding to at least one second connection path of the interest tree, respectively calculate the second connection probability corresponding to the at least one second connection path, and take the first item attribute on the second connection path corresponding to the maximum second connection probability as the target item attribute.
[0043] Optionally,
[0044] The optimization module is used to adjust the weight value and feature value of the second item attribute by using a gradient descent algorithm.
[0045] To achieve the above objective, according to another aspect of an embodiment of the present invention, an electronic device for recommending items is provided.
[0046] An electronic device for item recommendation according to an embodiment of the present invention comprises: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement an item recommendation method according to an embodiment of the present invention.
[0047] To achieve the above objective, according to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided.
[0048] A computer-readable storage medium according to an embodiment of the present invention stores a computer program, which, when executed by a processor, implements an item recommendation method according to an embodiment of the present invention.
[0049] One embodiment of the above invention has the following advantages or beneficial effects: an interest tree is constructed based on the historical evaluation set of the item, and the interest tree is optimized based on the user's first behavior data. When the user's second behavior data is received again, the interest tree can be used to determine the target item attributes related to the second behavior data, and then the item to be recommended to the second user is determined based on the target item attributes. Since when recommending items, the user's attribute preferences (target item attributes) are predicted based on the user's second behavior data, and items are recommended to the user based on the attribute preferences, the recommended items can be expanded to all categories of items, which are not necessarily items with which the user has interactive behavior, thereby expanding the scope of recommendation, improving the novelty and accuracy of the recommendation results, and helping to improve the user experience.
[0050] 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
[0051] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0052] Figure 1 is a schematic diagram of main steps of an item recommendation method according to an embodiment of the present invention;
[0053] Figure 2 is a schematic diagram of an interest tree architecture according to an embodiment of the present invention;
[0054] Figure 3 is a schematic diagram of another architecture of an interest tree according to an embodiment of the present invention;
[0055] Figure 4 is a schematic diagram of main modules of an item recommendation device according to an embodiment of the present invention;
[0056] Figure 5 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0057] Figure 6 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
[0058] 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.
[0059] It should be pointed out that the embodiments of the present invention and the technical features therein may be combined with each other without conflict.
[0060] Existing recommendation systems determine recommended items from items corresponding to user behavior data. When recommending items, the recommended items are limited to items with which the user has interacted, resulting in poor novelty in the recommendation results. In addition, since users are likely to choose items outside the interaction range, the recommendation accuracy of this recommendation method is low, resulting in a poor user experience.
[0061] Data exploration shows that users' behaviors and preferences on e-commerce platforms are often cross-category. For example, users will browse / add items of different categories at the same time (within one day), such as T-shirts, watches, mouse pads, laundry detergent and other cross-category items. If you want to improve the accuracy of recommendations, you need to adopt a method to describe user preferences at the cross-category level. However, the amount of calculation required to perform statistics and representation of all user preferences on the massive data of all categories of items is unacceptable. Therefore, at a higher level of abstraction, the user's preference for items actually represents the user's preference for specific attributes of items. For example: a user's home decoration style is black. When he buys a wardrobe, he will prefer black with the same style, rather than green or blue; for another example, a user bought an oversized TV. It is likely that the space at home is relatively large. When he buys an air conditioner or air purifier, he will prefer items with larger coverage and greater power. The significance (frequency of occurrence) of item attributes can be extracted and filtered from the evaluation data of the item through NLP technology. After filtering, the attribute types of the items and the data level are controllable. Therefore, based on the evaluation data of items, the item attributes can be matched with the user's preferences to improve the accuracy and novelty of item recommendations. For example, based on the evaluation data of items, it can be known that the T-shirts and watches purchased by the user are all Doraemon-themed, so a mouse pad or laundry detergent with the same Doraemon theme but without any interaction with the user can be recommended to the user, thereby improving the novelty of item recommendations and user experience.
[0062] Based on this, in order to improve the novelty and accuracy of item recommendations, such as Figure 1 As shown, an embodiment of the present invention provides an item recommendation method, which mainly includes the following steps:
[0063] Step S101: obtaining a historical evaluation set of an item, wherein evaluation data in the historical evaluation set indicates a first item attribute of the item.
[0064] After obtaining the review data of the item, we can first filter out the dirty data that cannot represent the meaning of the item attributes, such as "the user did not comment on time, the system defaults to a good comment" and "seeing this comment means that I am a fairy blabla". Then, for the filtered data, we use the attribute + emotion fixed sentence pattern for syntactic analysis, call the general open source interface (such as Jieba word segmentation, etc.), and use the NLP (Natural Language Processing) model to extract the first item attribute from the review data.
[0065] When the item recommendation method provided by the embodiment of the present invention is applied to an e-commerce platform, since the e-commerce platform generally has a large number of items in multiple categories, for example, a certain e-commerce platform has 6,000 categories with billions of items, but the items in the 700 categories with higher sales can basically cover more than 90% of the GMV (Gross Merchandise Volume, transaction amount), therefore, in the case of limited computing resources, the items in the long-tail categories can be ignored. In other words, only the review data of the items with higher sales except the long-tail categories is used to extract the first item attribute.
[0066] Step S102: construct an interest tree according to the first item attribute and the frequency of occurrence of the first item attribute in the historical evaluation set, where different nodes in the interest tree correspond to different first item attributes.
[0067] After extracting the first item attribute from the comment data in the historical evaluation set, an interest tree can be constructed based on the first item attribute and the frequency of occurrence of the first item attribute. The architecture of the interest tree can adopt a tree structure such as a Huffman tree or a maximum heap tree. The specific tree structure can be selected according to the application scenario. The embodiment of the present invention takes the structure of the Huffman tree as an example to illustrate the construction process of the interest tree.
[0068] In one embodiment of the present invention, it is assumed that the first item attributes extracted from the historical evaluation set and their occurrence frequencies are as shown in Table 1, wherein the extracted first item attributes include: reaction speed, color, clarity, shooting performance, charging performance and sound quality, and their corresponding nodes in the Huffman tree are a, b, c, d, e, and f, respectively, and their occurrence frequencies (here only for examples) are 20, 4, 8, 6, 16, and 3, respectively. The characteristic values of each first item attribute will be further introduced in subsequent implementations.
[0069] Table 1
[0070]
[0071] Next, a Huffman tree is constructed based on the extracted 6 first item attributes. During the construction, the order of the Huffman tree can be calculated based on the frequency of occurrence of each first item attribute, and the first item attribute with a greater frequency of occurrence is placed closer to the root node of the Huffman tree. Specifically, the node corresponding to each first item attribute is treated as a separate tree, that is, 6 trees are generated first, and then the two trees with the smallest frequency of occurrence are merged. The weight of the root node of the new tree generated after the merger is the sum of the weights of the two trees, and the two trees with the smallest frequency of occurrence are used as the left and right subtrees of the new tree, and the weight of the right subtree is greater than the weight of the left subtree. This rule is repeated until the 6 trees are merged into one tree, that is, a Huffman tree is generated. The generated Huffman tree is as follows: Figure 2 As shown in the figure. Since the Huffman tree is a binary tree, the amount of calculation is greatly reduced in scenarios with extremely large amounts of calculation, such as from O(N) to O(log2N). Therefore, the amount of calculation required to query the first item attribute in the Huffman tree is much faster than traversal. In addition, in the Huffman tree, the child nodes closer to the root node correspond to the first item attributes with higher occurrence frequency. For example, Figure 2 In the Huffman tree shown, the child nodes closer to the root node are a, c, and e nodes, which correspond to the three first item attributes with higher frequency of occurrence: reaction speed, charging performance, and clarity. Since the frequency of occurrence of the first item attribute can characterize the importance of the item attribute, that is, the item attribute with a high frequency of occurrence is more important than the item attribute with a low frequency of occurrence. Therefore, in the search process, the search starts from the root node of the Huffman tree, that is, the first item attribute with high importance is searched first, so as to facilitate the earlier and faster search of the target item attribute. In other words, the first item attribute with a higher frequency of occurrence is closer to the root node of the Huffman tree, so it is easier to find, which is in line with the greedy idea of business scenario query.
[0072] Step S103: Acquire first behavior data of the first user within a set period, and optimize the interest tree according to the first behavior data.
[0073] It is understandable that the first behavior data of the first user indicates the decision-making behavior of the first user. When the user recommendation behavior is applied to the e-commerce platform, the decision-making behavior is ordering and payment, etc. In addition, the first behavior data is a period within a set period, and the period can be customized. Preferably, the period should not be too far from the current time. Generally, the first behavior data of the last few days is selected, for example, the first behavior data of browsing, adding to cart, following and ordering of the first user in the last 3 days is selected.
[0074] When optimizing the interest tree according to the first behavior data, the characteristic value and weight value of the first item attribute may be determined first; then, based on the characteristic value and weight value, and the position of the first item attribute in the interest tree, the second item attribute used for interest tree optimization may be determined from the interest tree; then, the interest tree may be optimized according to the first behavior data, the second item attribute and the structure of the interest tree.
[0075] Specifically, when determining the second item attribute for interest tree optimization from the interest tree, the first connection probability of multiple first item attributes in the interest tree can be calculated based on the feature value and weight value of the first item attribute corresponding to the first behavior data in the interest tree, and the first connection paths of multiple first item attributes in the interest tree, and the multiple first item attributes corresponding to the largest first connection probability are used as the second item attribute.
[0076] Still taking the Huffman tree as an example of the structure of the interest tree, in the Huffman tree, the architecture of the Huffman tree reflects the frequency ranking of each first item attribute, that is, it reflects the order of each first item attribute. However, when recommending items, it is more desirable to know the importance ranking of each first item attribute. Although the frequency of occurrence can reflect the importance of the first item attribute to a certain extent, if the importance of the first item attribute is only represented by the frequency of occurrence, it is not accurate enough, which may easily lead to inaccurate recommendations. Therefore, in an embodiment of the present invention, the importance of the first item attribute is represented in combination with the weight value of each node.
[0077] In order to achieve better training results, multidimensional vectors are used to represent weight values. At the same time, multidimensional vectors are also used to represent the characteristic values of each first item attribute. During the training process, segmentation and high-order operations are performed through multidimensional characteristic values and multidimensional weight values, which can more accurately fit the characteristics of the first item attributes, thereby improving the training effect. For example, for the first item attribute of "reaction speed", it does not change in proportion. For example, if it is greater than the threshold (such as 30 seconds), it is completely unbearable, and if it is less than the threshold (such as 10 milliseconds), it is completely imperceptible. The user's perception will not change for smaller values below this. By using a nonlinear multidimensional representation method, multiple aspects of the first item attribute can be expressed through multiple numerical values. Therefore, the user's perception can be accurately fitted, thereby improving the training effect.
[0078] As shown in Table 1, a five-dimensional vector is used to represent the eigenvalue of the first item attribute. It can be understood that the five-dimensional eigenvalues represent the five aspects of the first item's characteristics. Therefore, the selection of the dimension is related to the characteristics of the first item attribute. For example, for the first item attribute "color", the corresponding characteristics are "red", "yellow" and "blue". Correspondingly, the dimension of the selected eigenvalue is also related to the number of features (here 3). Of course, when there are multiple first item attributes, in order to facilitate the calculation of the training process, the dimension of the eigenvalue of each first item attribute should be the same. At this time, it can be comprehensively determined based on the number of features of multiple first item attributes. For example, the dimension of the eigenvalue is determined based on the average number of features of multiple first item attributes. This is because when the number of features is relatively small, if more dimensions are selected, for example, the number of features is 10, and the dimension of the eigenvalue is selected as 200 dimensions, then in the later optimization process, it is possible that 190 dimensions are close to 0. In other words, based on the current limited feature data, the content learned by the model is limited. Greatly expanding the dimension will only affect the subsequent calculation speed and will not improve the model training accuracy.
[0079] At the beginning of training, the feature value and weight value of the first item attribute can be set arbitrarily. For example, the initial feature value of "reaction speed" is set to [1, 10, 100, 444, 9999]. During the optimization process of the interest tree, the initially set feature value and weight value will be continuously corrected through gradients. When the optimization is completed, the feature value and weight value will form a relatively stable value. For example, when the optimization is completed, the feature value of "reaction speed" is [0.191166386, 0.632886, 0.311412, 0.435296, 0.513149].
[0080] The following is a detailed description of the adjustment process of the eigenvalues and weight values. Since the Huffman tree is a binary tree, the binary logistic regression method is applicable. That is, if the left subtree is negative and the right subtree is positive, the method for distinguishing positive and negative classes can use the binary classification function sigmoid function, and its function expression can be shown in the following formula (1). In other words, the weight value corresponding to each eigenvalue can be obtained by maximum likelihood estimation;
[0081]
[0082] Among them, X w The eigenvalue vector matrix representing the attribute of the first item, θ represents the weight value vector of the attribute of the first item.
[0083] The reason for choosing the sigmoid function is that: as a curve function, the sigmoid function is more accurate in fitting than the linear function, and its value range is (0,1), which is equivalent to a binary function, matching the logic of the binary tree, and conforming to the logic of calculating the first connection probability by multiplication in the embodiment of the present invention. At the same time, its calculation is simple, fast and has good performance.
[0084] In the process of optimizing the interest tree, the first item attribute corresponding to the first behavior data may be determined first, that is, the first item attribute of the item targeted by the first behavior data may be determined, and then the first connection paths of the determined multiple first item attributes in the interest tree may be calculated based on the randomly set feature values and weight values of the first item attributes. For example, when Figure 3 When all nodes in are the first item attributes corresponding to the first line of data, for Figure 3 The first connection path between the a2 node in the interest tree shown and the root node n(a2,1) of the interest tree is n(a2,1)-n(a2,2)-n(a2,3)-a2. Then, the first connection probability of the first connection path can be calculated based on the characteristic values and weight values of each first item attribute on the first connection path.
[0085] Specifically, in the interest tree, the probability of the path through the left subtree is f(x), and the probability of the path through the right subtree is 1-f(x). Then, according to the inverse of the sigmoid function f'(x)=f(x)(1-f(x)), the first connection probability of the first connection path can be calculated using the following calculation formula (2):
[0086]
[0087] in, Characterize the connection probability, l w represents the total number of levels of the interest tree, Indicates the path direction of the jth node in the interest tree relative to the j-1th node. When the path direction is left is 0, when the path direction is right, it is 1, X w The eigenvalue vector representing the j-1th node in the interest tree, A weight value vector representing the j-1th node in the interest tree, Represents the product of the transpose of the eigenvalue vector and the weight value vector.
[0088] For the first connection path of n(a2,1)-n(a2,2)-n(a2,3)-a2, the feature value vector and weight value vector of each node can be brought into the above calculation formula (2) to calculate the first connection probability of the first connection path. Similarly, it can be calculated as follows Figure 3The first connection probabilities of other first connection paths (such as n(a2,1)-n(a2,2)-n(a2,3)-a1 or n(a2,1)-n(a2,2)-a3) in the interest tree shown.
[0089] Then, according to the calculated first connection probabilities corresponding to the multiple first connection paths, the first item attribute corresponding to the largest first connection probability is used to optimize the interest tree, that is, the multiple first item attributes corresponding to the largest first connection probability are used as the second item attribute, and the interest tree is optimized according to the second item attribute. Since it is necessary to determine the largest first connection probability, in order to reduce the amount of calculation, the above calculation formula (2) can be transformed to obtain the following calculation formula (3), so that the continuous multiplication is changed to multiplication and addition, which is convenient for calculation and does not affect monotonicity.
[0090]
[0091] Among them, l w represents the total number of levels corresponding to the interest tree, Indicates the path direction of the jth node in the interest tree relative to the j-1th node. When the path direction is left is 0, when the path direction is right, it is 1, X w The matrix corresponding to the eigenvalue of the j-1th node in the interest tree, A matrix corresponding to the weight value of the j-1th node in the interest tree, Represents the product of the transpose of the eigenvalue vector and the weight value vector.
[0092] Since DNN (Deep Neural Network) has been proven to be able to achieve logically nonlinear high-order features by adding hidden layers, adding Relu activation functions and their parameters, and optimizing process parameters. Therefore, after calculating the maximum first connection probability, the first behavior data, the first connection path (or second item attribute) corresponding to the maximum first connection probability, and the structure of the interest tree can be horizontally spliced together to form a new vector. The format of the new vector can be [first behavior vector, first connection path, interest tree basic weight]. Then, the new vector is used as the input of a deep neural network including a Relu layer and a softmax layer, so that the deep neural network outputs a predicted value of the new vector. The predicted value has a value range of (0,1), and the predicted value corresponds to the decision behavior of the first user. For example, when the predicted value is (0,0.5), it indicates that the decision behavior of the first user is not to purchase. When the predicted value is [0.5,1), it indicates that the decision behavior of the user is to purchase.
[0093] Of course, since the weight values and characteristic values of each first item attribute are randomly set in the early stage of training, the predicted value cannot accurately reflect the user's decision-making behavior in the early stage of training. That is to say, the error ratio between the predicted value and the target value characterizing the user's decision-making behavior is large. The error ratio can be (Y-Y') / Y, where Y is the target value and Y' is the predicted value. The target value can be determined according to the decision behavior indicated by the first behavior data. For example, if the decision behavior indicated by the first behavior data is purchase, the target value is 1; if the decision behavior indicated by the first behavior data is not purchase, the target value is 0.
[0094] Then, the eigenvalues and weight values of each node in the interest tree are reversely adjusted according to the error ratio. Specifically, the optimization gradients corresponding to the eigenvalues and weight values can be obtained by respectively taking the partial derivatives of the eigenvalues and weight values. The optimization gradient corresponding to the eigenvalues is shown in the following formula (4), and the optimization gradient corresponding to the weight value is shown in the following formula (5):
[0095]
[0096] Among them, l w represents the total number of levels corresponding to the interest tree, Indicates the path direction of the jth node in the interest tree relative to the j-1th node. When the path direction is left is 0, when the path direction is right, it is 1, X w The matrix corresponding to the eigenvalue of the j-1th node in the interest tree, A matrix corresponding to the weight value of the j-1th node in the interest tree.
[0097]
[0098] in, Characterizes the first gradient corresponding to the j-1th node in the interest tree, Indicates the path direction of the jth node in the interest tree relative to the j-1th node. When the path direction is left is 0, when the path direction is right, it is 1, X w The matrix corresponding to the eigenvalue of the j-1th node in the interest tree, A matrix corresponding to the weight value of the j-1th node in the interest tree.
[0099] After calculating the optimization gradients corresponding to the eigenvalues and weight values, the BP algorithm (Error BackPropagation) and the GD algorithm (Gradient Descent) can be used to adjust the weight values and eigenvalues of each node in the interest tree.
[0100] The above process of adjusting the weight value and eigenvalue of each node can be repeated for multiple times until the error ratio between the predicted value and the target value output by the DNN is less than the error threshold or the number of iterations reaches the number threshold, then the optimization is terminated, and at this time, relatively stable eigenvalues and weight values of each node in the interest tree are obtained. For example, for the first item attribute "reaction speed", the final eigenvalue is [0.191166386, 0.632886, 0.311412, 0.435296, 0.513149]. At this time, the optimized interest tree can be used for prediction to obtain a more accurate prediction value.
[0101] Since user behavior data is volatile, such as major promotional activities on e-commerce platforms or seasonal factors, which may cause user behavior data to be unstable, in order to improve the stability of the model, the time sliding window method can be used to take the first behavior data corresponding to different time periods as the input of the DNN for training. For example, training is performed based on the first behavior data corresponding to the last 3 days, the last 5 days, and the last 7 days, respectively. The input of the DNN is [3-day user behavior vector, 3-day connection path, 3-day interest tree basic weight, 5-day user behavior vector, 5-day connection path, 5-day interest tree basic weight, 7-day user behavior vector, 7-day connection path, 7-day interest tree basic weight]. By superposition, the attributes of items that appear repeatedly in different periods are strengthened, that is, the attributes of items that users are most interested in are strengthened, and the changing trend of the behavior data within the set period can be captured, thereby improving the stability of the model.
[0102] Step S104: when the second behavior data of the second user is obtained, the target item attributes related to the second behavior data are determined using the optimized interest tree, and the items to be recommended to the second user are determined according to the target item attributes.
[0103] When determining the second behavior data of the second user, multiple third item attributes related to the second behavior data can be determined, and based on the characteristic value and weight value of the first item attribute that is the same as the third item attribute in the interest tree, and the multiple third item attributes corresponding to at least one second connection path of the interest tree, the second connection probability corresponding to the at least one second connection path is calculated respectively, and the first item attribute on the second connection path corresponding to the maximum second connection probability is used as the target item attribute.
[0104] In the embodiment of the present invention, the process of determining the second connection probability is similar to the process of determining the first connection probability, and will not be described in detail here. The first user and the second user may be the same user or different users. When the first user and the second user are the same user, the time periods corresponding to the first behavior data and the second behavior data are different.
[0105] Further, after obtaining the second connection path, the second behavior data, the second connection path and the interest tree can be used as inputs of the DNN to obtain a corresponding prediction value, which can characterize the possibility of whether the second user will perform the corresponding decision behavior, for example, predicting whether the second user will perform decision behaviors such as purchase. It can be understood that the type of predicted decision behavior is the same as the type of decision behavior indicated by the first behavior data. For example, when the first behavior data includes: the behavior data of the first user from 2019-09-01 to 2019-09-30 for 30 days, and the decision behavior of whether the user will place an order to purchase simulated based on the behavior data of the first user from 2019-10-01 to 2019-10-03, then when the second behavior data of the second user from 2020-09-01 to 2020-09-30 for 30 days is received, it can be predicted whether the second user will place an order to purchase the corresponding item from 2020-10-01 to 2020-10-03.
[0106] It can be seen from the item recommendation method according to the embodiment of the present invention that an interest tree is constructed based on the historical evaluation set of the item, and the interest tree is optimized based on the user's first behavior data. When the user's second behavior data is received again, the interest tree can be used to determine the target item attributes related to the second behavior data, and then the item to be recommended to the second user is determined based on the target item attributes. Since when recommending items, the user's attribute preferences (target item attributes) are predicted based on the user's second behavior data, and items are recommended to the user based on the attribute preferences, the recommended items can be expanded to all categories of items, which are not necessarily items with which the user has interactive behavior, thereby expanding the scope of recommendation, improving the novelty and accuracy of the recommendation results, and helping to improve the user experience.
[0107] Moreover, the design of binary tree and sigmoid function can greatly save the amount of calculation, and realize the recommendation of items that are not limited to specific categories or departments or whether there is interaction, so it is suitable for application scenarios of item recommendation in a wider range. In addition, the use of DNN to realize nonlinear fitting of multi-dimensional feature space improves the model accuracy compared with the linear similarity calculation of matrix inner product in the existing technology.
[0108] Figure 4 4 is a schematic diagram of main modules of an item recommendation device according to an embodiment of the present invention.
[0109] like Figure 4 As shown, the item recommendation device 400 of the embodiment of the present invention includes: an acquisition module 401, a construction module 402, an optimization module 403 and a recommendation module 404; wherein,
[0110] The acquisition module 401 is used to acquire a historical evaluation set of an item, wherein the evaluation data in the historical evaluation set indicates a first item attribute of the item;
[0111] The construction module 402 is used to construct an interest tree according to the first item attribute and the frequency of occurrence of the first item attribute in the historical evaluation set, where different nodes in the interest tree correspond to different first item attributes;
[0112] The optimization module 403 is used to obtain the first behavior data of the first user within a set period, and optimize the interest tree according to the first behavior data;
[0113] The recommendation module 404 is used to determine the target item attributes related to the second behavior data using the optimized interest tree when the second behavior data of the second user is obtained, and determine the items to be recommended to the second user according to the target item attributes.
[0114] In one embodiment of the present invention, the optimization module 403 is used to determine the characteristic value and weight value of the first item attribute; determine the second item attribute for interest tree optimization from the interest tree according to the characteristic value and weight value, and the position of the first item attribute in the interest tree; and optimize the interest tree according to the first behavior data, the second item attribute and the structure of the interest tree.
[0115] In one embodiment of the present invention, the optimization module 403 is used to calculate the first connection probabilities of multiple first item attributes in the interest tree based on the feature values and weight values of the first item attributes corresponding to the first behavior data in the interest tree, and the first connection paths of multiple first item attributes in the interest tree, and use the multiple first item attributes corresponding to the maximum first connection probability as the second item attributes.
[0116] In one embodiment of the present invention, the optimization module 403 is used to use the first behavior data, the second item attribute and the interest tree as inputs of a deep neural network, and calculate the error ratio between the predicted value output by the deep neural network and a preset target value. When the error ratio is greater than a preset threshold, the weight value and feature value of the second item attribute in the interest tree are adjusted; wherein the deep neural network includes a Relu layer and a softmax layer.
[0117] In one embodiment of the present invention, the recommendation module 404 is used to determine multiple third item attributes related to the second behavior data, and according to the feature value and weight value of the first item attribute that is the same as the third item attribute in the interest tree, and the multiple third item attributes corresponding to at least one second connection path of the interest tree, respectively calculate the second connection probability corresponding to the at least one second connection path, and use the first item attribute on the second connection path corresponding to the maximum second connection probability as the target item attribute.
[0118] It can be seen from the item recommendation device according to the embodiment of the present invention that an interest tree is constructed based on the historical evaluation set of the item, and the interest tree is optimized based on the user's first behavior data. When the user's second behavior data is received again, the interest tree can be used to determine the target item attributes related to the second behavior data, and then the item to be recommended to the second user is determined based on the target item attributes. Since when recommending items, the user's attribute preferences (target item attributes) are predicted based on the user's second behavior data, and items are recommended to the user based on the attribute preferences, the recommended items can be expanded to all categories of items, which are not necessarily items with which the user has interactive behavior, thereby expanding the scope of recommendations, improving the novelty and accuracy of the recommendation results, and helping to improve the user experience.
[0119] Figure 5 An exemplary system architecture 500 is shown to which the item recommendation method or item recommendation apparatus according to the embodiments of the present invention can be applied.
[0120] like Figure 5 As shown, system architecture 500 may include terminal devices 501, 502, 503, a network 504 and a server 505. Network 504 is used to provide a medium for communication links between terminal devices 501, 502, 503 and server 505. Network 504 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0121] Users can use terminal devices 501, 502, 503 to interact with server 505 through network 504 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 501, 502, 503, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0122] The terminal devices 501 , 502 , and 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0123] The server 505 may be a server that provides various services, such as a backend management server that provides support for shopping websites browsed by users using the terminal devices 501, 502, and 503. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as target push information and product information) to the terminal device.
[0124] It should be noted that the item recommendation method provided in the embodiment of the present invention is generally executed by the server 505 , and accordingly, the item recommendation device is generally disposed in the server 505 .
[0125] It should be understood that Figure 5 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.
[0126] Reference below Figure 6 , which shows a schematic diagram of the structure of a computer system 600 of a terminal device suitable for implementing an embodiment of the present invention. Figure 6 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.
[0127] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0128] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.
[0129] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-mentioned functions defined in the system of the present invention are executed.
[0130] 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.
[0131] 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.
[0132] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The modules described may also be set in a processor. For example, they may be described as follows: a processor includes an acquisition module, a construction module, an optimization module, and a recommendation module. The names of these modules do not, in some cases, constitute limitations on the modules themselves. For example, the acquisition module may also be described as a "module for acquiring a historical evaluation set of an item."
[0133] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it 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: obtaining a historical evaluation set of an item, wherein the evaluation data in the historical evaluation set indicates a first item attribute of the item; constructing an interest tree according to the first item attribute and the frequency of occurrence of the first item attribute in the historical evaluation set, wherein different nodes in the interest tree correspond to different first item attributes; obtaining the first behavior data of the first user within a set period, and optimizing the interest tree according to the first behavior data; when the second behavior data of the second user is obtained, using the optimized interest tree to determine the target item attribute related to the second behavior data, and determining the item to be recommended to the second user according to the target item attribute.
[0134] According to the technical solution of the embodiment of the present invention, an interest tree is constructed based on the historical evaluation set of the item, and the interest tree is optimized based on the user's first behavior data. When the user's second behavior data is received again, the interest tree can be used to determine the target item attributes related to the second behavior data, and then the item to be recommended to the second user is determined based on the target item attributes. Since when recommending items, the user's attribute preferences (target item attributes) are predicted based on the user's second behavior data, and items are recommended to the user based on the attribute preferences, the recommended items can be expanded to all categories of items, which are not necessarily items with which the user has interactive behavior, thereby expanding the scope of recommendations, improving the novelty and accuracy of the recommendation results, and helping to improve the user experience.
[0135] 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. An item recommendation method, characterized in that: include: Acquire a historical evaluation set of an item, wherein evaluation data in the historical evaluation set indicates a first item attribute of the item; constructing an interest tree according to the first item attribute and the frequency of occurrence of the first item attribute in the historical evaluation set, wherein different nodes in the interest tree correspond to different first item attributes; Acquire first behavior data of a first user within a set period, and optimize the interest tree according to the first behavior data; When the second behavior data of the second user is obtained, the target item attributes related to the second behavior data are determined using the optimized interest tree, and the items to be recommended to the second user are determined according to the target item attributes.
2. The method according to claim 1, characterized in that The optimizing the interest tree according to the first behavior data includes: Determining a characteristic value and a weight value of the first item attribute; Determining a second item attribute for interest tree optimization from the interest tree according to the feature value and the weight value, and the position of the first item attribute in the interest tree; The interest tree is optimized according to the first behavior data, the second item attribute and the structure of the interest tree.
3. The method according to claim 2, characterized in that The determining, from the interest tree, a second item attribute for interest tree optimization includes: According to the characteristic value and weight value of the first item attribute corresponding to the first behavior data in the interest tree, and the first connection paths of multiple first item attributes in the interest tree, the first connection probabilities of multiple first item attributes in the interest tree are calculated, and the multiple first item attributes corresponding to the maximum first connection probability are used as the second item attributes.
4. The method according to claim 2, characterized in that: The optimizing the interest tree according to the first behavior data, the second item attribute and the structure of the interest tree includes: The first behavior data, the second item attribute and the interest tree are used as inputs of a deep neural network, and an error ratio between a predicted value output by the deep neural network and a preset target value is calculated; when the error ratio is greater than a preset threshold, a weight value and a feature value of the second item attribute in the interest tree are adjusted; wherein the deep neural network includes a Relu layer and a softmax layer.
5. The method according to claim 4, characterized in that Determining the target item attribute related to the second behavior data using the optimized interest tree includes: Determine multiple third item attributes related to the second behavior data, and based on the characteristic value and weight value of the first item attribute that is the same as the third item attribute in the interest tree, and the multiple third item attributes corresponding to at least one second connection path of the interest tree, respectively calculate the second connection probability corresponding to the at least one second connection path, and use the first item attribute on the second connection path corresponding to the maximum second connection probability as the target item attribute.
6. The method according to claim 4, characterized in that The adjusting the weight value and the characteristic value of the second item attribute in the interest tree includes: The weight value and feature value of the second item attribute are adjusted using a gradient descent algorithm.
7. An item recommendation device, characterized in that: include: Acquisition module, construction module, optimization module and recommendation module; among them, The acquisition module is used to acquire a historical evaluation set of an item, wherein the evaluation data in the historical evaluation set indicates a first item attribute of the item; The construction module is used to construct an interest tree according to the first item attribute and the frequency of occurrence of the first item attribute in the historical evaluation set, where different nodes in the interest tree correspond to different first item attributes; The optimization module is used to obtain first behavior data of a first user within a set period, and optimize the interest tree according to the first behavior data; The recommendation module is used to determine the target item attributes related to the second behavior data using the optimized interest tree when the second behavior data of the second user is obtained, and determine the items to be recommended to the second user according to the target item attributes.
8. The device according to claim 7, characterized in that The optimization module is used to determine the characteristic value and weight value of the first item attribute; determine the second item attribute for interest tree optimization from the interest tree according to the characteristic value and weight value, and the position of the first item attribute in the interest tree; and optimize the interest tree according to the first behavior data, the second item attribute and the structure of the interest tree.
9. An electronic device, 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.
10. 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.
Citation Information
Patent Citations
Information recommendation method, server and computer readable medium
CN109559208A
Item comment personalized recommendation method and system, electronic equipment and storage medium
CN109960777A