Recommendation method and system integrated with label weight and readable storage medium
By establishing the frequency matrix of users and tags and products and tags, introducing tag weight and TF-IDF algorithm to calculate user similarity, it solves the problem of data sparsity and cold start in the e-commerce platform, and improves the accuracy and real-time performance of the recommendation system. sex.
Patent Information
- Application Number
- CN202410783728.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-18
- Publication Date
- 2024-08-27
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
There are data sparsity, real-time and scalability problems in e-commerce platforms, which lead to reduced recommendation accuracy and difficult to solve cold start problems.
By establishing a frequency matrix between users and tags and products and tags, the concept of tag weight is introduced, the TF-IDF algorithm is used to calculate the weight of user-favored products, and the similarity is calculated using Euclidean distance to predict and recommend the ratings of unrated products.
It improves the accuracy of recommendation results, alleviates the cold start problem, and optimizes the real-time and scalability of the recommendation system.
Smart Images

Figure CN118552283A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field related to recommendation algorithms, and in particular to a recommendation method, system and readable storage medium incorporating tag weights. Background Art
[0002] There are two main ways to solve the problem of information overload in the prior art: search engines and recommendation systems. Among them, search engines push results and related information to users through keywords. The recommendation system determines the user's interests or attributes based on a series of self-operation behavior records of the user, and finally recommends the items or information that are predicted to be in line with the user's interests to the user to achieve the recommendation effect. In the recommendation system, the recommendation algorithm plays an important role. The recommendation algorithm can analyze the user's behavior characteristics based on some prior information, such as the like behavior of short videos, the rating of movies, the rating of products, etc., simulate user behavior, and select items or information that match the user's needs to present to specific users. This process does not require users to know the required project information in advance, and does not require users to search by themselves. Therefore, the recommendation system can effectively solve the problem of information overload.
[0003] At present, the user recommendation technology based on e-commerce platforms adopts the traditional collaborative filtering recommendation algorithm, but the traditional collaborative filtering recommendation algorithm has the following problems:
[0004] 1. E-commerce platforms have a wide variety of products and are huge in scale. Relatively speaking, there is less information on user behavior data, which leads to data sparsity. This has always been a difficult point in research in this field. Data sparsity will have a great impact on the accuracy of recommendations.
[0005] 2. At present, the real-time and scalability of the e-commerce platform recommendation system still need to be further optimized. New products are added to the platform almost every day, and the platform data is updated in real time. The large amount of data and products generated in real time will increase the complexity of the recommendation algorithm on the one hand, and on the other hand, it will cause deviations in the accuracy of the recommendation effect.
[0006] 3. Cold start problem: New products and users added to the e-commerce platform have not yet taken any action, so there is little relevant data to analyze, making it impossible to accurately extract product feature values and predict user preferences for the products. Summary of the invention
[0007] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention proposes a recommendation method incorporating label weights, which can obtain a better neighbor set, make the recommendation result more accurate, and alleviate the cold start problem.
[0008] The present invention also provides a recommendation system, a control device and a computer-readable storage medium incorporating tag weights.
[0009] The recommendation method incorporating tag weights according to the first aspect of the present invention comprises the following steps:
[0010] In response to the input user historical behavior data, a rating matrix between users and products, a first frequency matrix between users and tags, and a second frequency matrix between products and tags are established, and a set of common tags that the first user and the second user have given to all products is obtained, where the first user and the second user are any two of all users;
[0011] Obtaining an average label weight according to the first frequency matrix;
[0012] Based on the TF-IDF algorithm, obtaining the weight parameters of the preferred products according to the first frequency matrix and the second frequency matrix;
[0013] Obtaining a first total label weight of all the first user's favorite products and a second total label weight of all the second user's favorite products according to the label average weight and the favorite product weight parameter;
[0014] Calculate the frequency difference of each common tag typed by the first user and the second user using Euclidean distance according to the first frequency matrix and the common tag set;
[0015] Calculate the similarity between the first user and the second user according to the first total tag weight, the second total tag weight and the frequency difference;
[0016] The scores of multiple unrated products are predicted based on the similarity, the score matrix and the preset number of neighbors, and the multiple unrated products with high scores are recommended to the user according to a preset number of recommendations.
[0017] The recommendation method incorporating tag weights according to an embodiment of the present invention has at least the following beneficial effects:
[0018] By establishing the first frequency matrix between users and tags and the second frequency matrix between products and tags, the tags are quantified, a new user preference model is constructed, and the concept of tag weight is introduced. The total tag weights of different users are calculated by the TF-IDF algorithm, and the frequency difference of each common tag used by two users is calculated using the Euclidean distance. A new similarity calculation method is established based on the total tag weights and frequency difference, and then experimental analysis is conducted on different values of the adjustment factor and the user's neighbor set in the similarity calculation formula. Finally, the optimal value corresponding to the most accurate recommendation result is obtained, which can obtain a better neighbor set and more accurate recommendation results. The similarity calculation method is used to predict the ratings of multiple unrated products, and multiple unrated products with high ratings are recommended to users according to the preset recommendation quantity, which can alleviate the cold start problem.
[0019] According to some embodiments of the present invention, the constraint formula of the average tag weight is:
[0020]
[0021] Where n is the total number of users, t g is the total number of tags, and both the total number of users and the total number of tags are obtained according to the first frequency matrix.
[0022] According to some embodiments of the present invention, the constraint formula of the preferred product weight parameter is:
[0023]
[0024] in, is the number of target tags in the first user’s favorite products, is the total number of tags in the first user's favorite products, n is the total number of users, t is the total number of favorite products containing the target tag, and the favorite products are obtained from all products based on the TF-IDF algorithm according to the first frequency matrix and the second frequency matrix.
[0025] According to some embodiments of the present invention, obtaining a first total label weight of all the first user's favorite products and a second total label weight of all the second user's favorite products according to the label average weight and the favorite product weight parameter comprises the following steps:
[0026] Multiplying the tag average weight and the favorite product weight parameter to obtain a first weight of the target tag for the first user's favorite product;
[0027] Obtaining the first total label weight of all favorite products of the first user according to the first weight;
[0028] Multiplying the tag average weight and the favorite product weight parameter to obtain a second weight of the target tag for the favorite product of the second user;
[0029] The second total label weight of all the second user's favorite products is obtained according to the second weight.
[0030] According to some embodiments of the present invention, the constraint formula of the first weight is:
[0031]
[0032] Among them, w(t g ,u n ) is the weight parameter of the preferred product, is the average weight of the tags;
[0033] The constraint formula of the first total label weight is:
[0034]
[0035] Among them, m is the total number of the first user's favorite products, g is the total number of labels of the i-th favorite product, and j represents the j-th specific product in the category of the i-th favorite product.
[0036] According to some embodiments of the present invention, the constraint formula of the frequency difference is:
[0037]
[0038] Where h is the number of common tags used by the first user and the second user, k is the target common tag, and q uk The frequency with which the first user has typed the target common tag, q vk is the frequency with which the second user has typed the target common tag, the number of common tags typed by the first user and the second user is obtained according to the common tag set, and the frequency with which the first user has typed the target common tag and the frequency with which the second user has typed the target common tag are obtained according to the first frequency matrix.
[0039] According to some embodiments of the present invention, the constraint formula of the similarity is:
[0040]
[0041] Among them, β is the preset adjustment coefficient, M(u n ,I m ) is the first total label weight, M(u n ,I n ) is the second total label weight, d uvis the frequency difference.
[0042] According to some embodiments of the present invention, the step of predicting the scores of multiple unrated products based on the similarity, the score matrix and a preset number of nearest neighbors, and recommending the multiple unrated products with high scores to the user according to a preset number of recommendations, comprises the following steps:
[0043] Predicting scores of multiple unrated products based on the similarity, the score matrix and a preset number of neighbors;
[0044] sorting the ratings of the plurality of unrated products in descending order;
[0045] According to the preset recommendation quantity and the scores of the sorted multiple unrated products, multiple unrated products with high scores are screened out and recommended to the user.
[0046] According to a second aspect of the present invention, a recommendation system incorporating tag weights includes:
[0047] a data preprocessing unit, configured to establish, in response to the input user historical behavior data, a rating matrix between users and products, a first frequency matrix between users and tags, and a second frequency matrix between products and tags, and obtain a set of common tags given by a first user and a second user to all products, wherein the first user and the second user are any two of all users;
[0048] a label average weight determination unit, configured to obtain a label average weight according to the first frequency matrix;
[0049] a preferred product weight parameter determination unit, configured to obtain the preferred product weight parameter according to the first frequency matrix and the second frequency matrix based on a TF-IDF algorithm;
[0050] a total label weight determination unit, configured to obtain a first total label weight of all the first user's favorite products and a second total label weight of all the second user's favorite products according to the label average weight and the favorite product weight parameter;
[0051] a frequency difference calculation unit, configured to calculate the frequency difference of each common tag typed by the first user and the second user using Euclidean distance according to the first frequency matrix and the common tag set;
[0052] a similarity calculation unit, configured to calculate the similarity between the first user and the second user according to the first total tag weight, the second total tag weight and the frequency difference;
[0053] The recommendation result output unit is used to predict the scores of multiple unrated products based on the similarity, the scoring matrix and a preset number of neighbors, and recommend multiple unrated products with high scores to the user according to a preset recommendation number.
[0054] The recommendation system incorporating tag weights according to an embodiment of the present invention has at least the following beneficial effects:
[0055] By establishing the first frequency matrix between users and tags and the second frequency matrix between products and tags, the tags are quantified, a new user preference model is constructed, and the concept of tag weight is introduced. The total tag weights of different users are calculated by the TF-IDF algorithm, and the frequency difference of each common tag used by two users is calculated using the Euclidean distance. A new similarity calculation method is established based on the total tag weights and frequency difference, and then experimental analysis is conducted on different values of the adjustment factor and the user's neighbor set in the similarity calculation formula. Finally, the optimal value corresponding to the most accurate recommendation result is obtained, which can obtain a better neighbor set and more accurate recommendation results. The similarity calculation method is used to predict the ratings of multiple unrated products, and multiple unrated products with high ratings are recommended to users according to the preset recommendation quantity, which can alleviate the cold start problem.
[0056] According to the third aspect of the present invention, the control device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the recommendation method for incorporating label weights as described in the first aspect of the present invention when executing the computer program. Since the control device adopts all the technical solutions of the recommendation method for incorporating label weights in the above-mentioned embodiment, it has at least all the beneficial effects brought by the technical solutions of the above-mentioned embodiment.
[0057] According to the computer-readable storage medium of the fourth aspect embodiment of the present invention, computer-executable instructions are stored, and the computer-executable instructions are used to execute the recommendation method incorporating label weights as described in the first aspect embodiment. Since the computer-readable storage medium adopts all the technical solutions of the recommendation method incorporating label weights of the above embodiment, it at least has all the beneficial effects brought by the technical solutions of the above embodiment.
[0058] Other features and advantages of the present invention will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0060] Figure 1is a flow chart of a recommendation method incorporating tag weights according to an embodiment of the present invention;
[0061] Figure 2 This is a comparison chart of indicators between a recommendation method incorporating label weights according to an embodiment of the present invention and an existing algorithm. DETAILED DESCRIPTION
[0062] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0063] In the description of the present invention, if there is a description of first, second, etc., it is only for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.
[0064] In the description of the present invention, it should be noted that, unless otherwise clearly defined, terms such as setting, installing, connecting, etc. should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meanings of the above terms in the present invention in combination with the specific content of the technical solution.
[0065] The following will be combined Figure 1 and Figure 2 A clear and complete description is given of the recommendation method for incorporating tag weights according to an embodiment of the present invention. Obviously, the embodiment described below is only a part of the embodiments of the present invention, but not all of the embodiments.
[0066] The recommendation method incorporating tag weights according to the first aspect of the present invention comprises the following steps:
[0067] In response to the input user historical behavior data, a rating matrix between users and products, a first frequency matrix between users and tags, and a second frequency matrix between products and tags are established, and a set of common tags that the first user and the second user have marked on all products is obtained, where the first user and the second user are any two of all users;
[0068] Obtain the average label weight according to the first frequency matrix;
[0069] Based on the TF-IDF algorithm, the weight parameters of preferred products are obtained according to the first frequency matrix and the second frequency matrix;
[0070] Obtain a first total label weight of all the first user's favorite products and a second total label weight of all the second user's favorite products according to the label average weight and the favorite product weight parameter;
[0071] Calculate the frequency difference of each common tag typed by the first user and the second user using Euclidean distance according to the first frequency matrix and the common tag set;
[0072] Calculate the similarity between the first user and the second user according to the first total tag weight, the second total tag weight and the frequency difference;
[0073] The scores of multiple unrated products are predicted based on similarity, a rating matrix and a preset number of nearest neighbors, and multiple unrated products with high scores are recommended to users according to a preset number of recommendations.
[0074] User historical behavior data includes but is not limited to the labels that different users give to different products, as well as the ratings given to different products. Through the input user historical behavior data, we can establish a rating matrix between users and products, a first frequency matrix between users and labels, and a second frequency matrix between products and labels. The first frequency matrix is the frequency of different users giving different labels, and the second frequency matrix is the frequency of different products giving different labels. Through the above data, we can get the total number of users, the total number of products, the total number of labels, and the set of common labels given by any two users to all products.
[0075] For a certain label, the same favorite products may appear in different users, but the weight of the label is different. For example, users u and v have both labeled the same product "summer sneakers", but user u may focus on comfort, while user v may care more about the style of the sneakers. That is, the same label "summer sneakers" has different importance for users u and v, so the concept of average label weight is introduced. When calculating the average label weight, the importance of labels that appear in the favorite products of most users is less than the importance of labels that appear in the favorite products of fewer users. For example, label t i ,t j All appear in the favorite products of users u and v, and 5,000 users have marked them with the label t i , and only 50 users have labeled t j , when calculating the similarity of users u and v, label t j The average weight of the label is greater than that of the label t i , label t i Being tagged by 5,000 or more users may be due to the tag t i It is universal. For example, the label "skirt" can be called a skirt regardless of whether it is a dress or a half-length skirt. However, the labels in the favorite products of fewer users are targeted and specific, such as: floral skirt, waist-hugging, cotton and linen material, etc. Therefore, the labels in the favorite products of fewer users are of great importance.
[0076] The constraint formula for the average label weight is:
[0077]
[0078] Where n is the total number of users, t g is the total number of tags. Both the total number of users and the total number of tags are obtained according to the first frequency matrix.
[0079] The number of times a tag appears in a favorite product can be calculated using TF. The more frequently a user has marked a tag, the more the user likes the product with this tag. IDF represents the classification ability of a tag, and the category can reflect the user's preference for the product. Favorite products can be all products involved in the user's historical behavior data, or some of them. For example, if a user has never marked a product with a certain tag, the product is not considered to be a favorite product. It should be noted that the TF-IDF algorithm is a prior art known to those skilled in the art, and the specific process and principle will not be described in detail here.
[0080] The constraint formula of the preferred product weight parameter is:
[0081]
[0082] in, is the number of target tags in the first user’s favorite products, is the total number of tags in the first user's favorite products, n is the total number of users, t is the total number of favorite products containing the target tag, and the favorite products are obtained from all products based on the TF-IDF algorithm according to the first frequency matrix and the second frequency matrix.
[0083] It should be noted that the above constraint formula of the weight parameters of the preferred products takes the relevant parameters of the first user as an example. The constraint formula of the weight parameters of the preferred products of the second user is similar and will not be repeated here.
[0084] In some embodiments of the present invention, obtaining a first total label weight of all favorite products of a first user and a second total label weight of all favorite products of a second user according to the label average weight and the favorite product weight parameter includes the following steps:
[0085] Multiply the average tag weight and the favorite product weight parameter to obtain the first weight of the target tag for the first user's favorite product;
[0086] Obtaining a first total label weight of all favorite products of the first user according to the first weight;
[0087] The second weight of the target tag to the second user's favorite product is obtained by multiplying the tag average weight and the favorite product weight parameter;
[0088] A second total label weight of all favorite products of the second user is obtained according to the second weight.
[0089] The constraint formula for the first weight is:
[0090]
[0091] Among them, w(t g ,u n ) is the weight parameter of the preferred product, is the average weight of the labels;
[0092] The constraint formula of the first total label weight is:
[0093]
[0094] Among them, m is the total number of favorite products of the first user, g is the total number of labels of the i-th favorite product, and j represents the j-th specific product in the category of the i-th favorite product.
[0095] It should be noted that the constraint formula of the first weight and the constraint formula of the first total label weight are based on the relevant parameters of the first user. The constraint formula of the second weight is similar to the constraint formula of the second total label weight, which will not be repeated here. In addition, the meaning of i and j can be understood as follows: for example, the first user likes brand i shoes, and brand i contains j different styles.
[0096] In some embodiments of the present invention, the frequency difference of each common tag typed by the first user and the second user is calculated using the Euclidean distance. The constraint formula of the frequency difference is:
[0097]
[0098] Among them, h is the number of common tags used by the first user and the second user, k is the target common tag, and q uk The frequency of the target common label for the first user, q vk The frequency of the target common tag being hit by the second user, the number of common tags hit by the first user and the second user is obtained according to the common tag set, and the frequency of the target common tag being hit by the first user and the frequency of the target common tag being hit by the second user are obtained according to the first frequency matrix.
[0099] The constraint formula for similarity is:
[0100]
[0101] Among them, β is the preset adjustment coefficient, M(u n ,I m ) is the first total label weight, M(u n ,Im ) is the second total label weight, d uv is the frequency difference.
[0102] A new similarity calculation method is established based on the total label weight and frequency difference, and then experimental analysis is conducted on different values of the adjustment factor and the user's neighbor set in the similarity calculation formula. Finally, the optimal value corresponding to the most accurate recommendation result is obtained, which can obtain a better neighbor set and more accurate recommendation results.
[0103] It should be noted that the principle and function of similarity are prior arts known to those skilled in the art and will not be elaborated herein.
[0104] In some embodiments of the present invention, the scores of multiple unrated products are predicted based on similarity, a score matrix and a preset number of neighbors, and multiple unrated products with high scores are recommended to the user according to a preset number of recommendations, including the following steps:
[0105] The ratings of multiple unrated products are predicted based on similarity, rating matrix and the preset number of nearest neighbors;
[0106] Sort the ratings of multiple unrated products from highest to lowest;
[0107] According to the preset number of recommendations and the ratings of the sorted multiple unrated products, multiple unrated products with the highest ratings are selected and recommended to the user.
[0108] After calculating the similarity of users u and v, the score matrix is decomposed according to the input number of neighbors (an adjustment coefficient used to control variables), and the matrix is obtained by iteratively converging the loss function to predict the score of user u for other unrated products. The number of neighbors and the number of recommendations are input at the same time as the user's historical behavior data, but can also be determined by setting default values, which cannot be regarded as a limitation of the present invention.
[0109] After predicting the scores of multiple unrated products, the scores of the multiple unrated products are sorted in descending order. Products with high scores indicate that users are more interested in the products. By screening out multiple unrated products with high scores and recommending them to users, the cold start problem can be alleviated.
[0110] In order to better reflect the advantages of the recommendation method incorporating tag weights according to the embodiment of the present invention, refer to Figure 2 The MAE (mean absolute error), accuracy, and recall of the recommendation method incorporating tag weights in the embodiment of the present invention are compared with those of the existing simple product tagging algorithm and the tagging algorithm based on TF-IDF. Figure 2It can be seen that the MAE of the simple product labeling algorithm and the labeling algorithm based on TF-IDF are not much different, but the accuracy and recall of the labeling algorithm based on TF-IDF are higher than those of the simple product labeling algorithm. It can be concluded that the recommendation performance of the labeling algorithm based on TF-IDF is better than that of the simple product labeling algorithm. The MAE of the recommendation method incorporating label weights proposed in the embodiment of the present invention is lower than that of the simple product labeling algorithm and the labeling algorithm based on TF-IDF, but the accuracy and recall are higher than those of the simple product labeling algorithm and the labeling algorithm based on TF-IDF. Therefore, it can be concluded that the recommendation performance of the recommendation method incorporating label weights proposed in the embodiment of the present invention is better than that of the simple product labeling algorithm and the labeling algorithm based on TF-IDF.
[0111] According to the recommendation method incorporating label weights according to an embodiment of the present invention, by establishing a first frequency matrix between users and labels and a second frequency matrix between products and labels, labels are quantified, a new user preference model is constructed, the concept of label weights is introduced, the total label weights of different users are calculated by the TF-IDF algorithm, the frequency difference of each common label used by two users is calculated using the Euclidean distance, a new similarity calculation method is established based on the total label weights and the frequency difference, and then experimental analysis is performed on different values of the adjustment factor and the user's neighbor set in the similarity calculation formula, and finally the optimal value corresponding to the most accurate recommendation result is obtained, a better neighbor set can be obtained, and the recommendation result is more accurate. The similarity calculation method is used to predict the ratings of multiple unrated products, and multiple unrated products with high ratings are recommended to users according to a preset number of recommendations, which can alleviate the cold start problem.
[0112] According to the second aspect of the present invention, the recommendation system incorporating label weights includes a data preprocessing unit, a label average weight determination unit, a preferred product weight parameter determination unit, a total label weight determination unit, a frequency difference calculation unit, a similarity calculation unit, and a recommendation result output unit.
[0113] A data preprocessing unit, configured to establish, in response to the input user historical behavior data, a rating matrix between users and products, a first frequency matrix between users and tags, and a second frequency matrix between products and tags, and obtain a set of common tags that the first user and the second user have marked on all products, wherein the first user and the second user are any two of all users;
[0114] A label average weight determination unit, used to obtain the label average weight according to the first frequency matrix;
[0115] A preferred product weight parameter determination unit, configured to obtain the preferred product weight parameters according to the first frequency matrix and the second frequency matrix based on a TF-IDF algorithm;
[0116] A total label weight determination unit, used to obtain a first total label weight of all the first user's favorite products and a second total label weight of all the second user's favorite products according to the label average weight and the favorite product weight parameter;
[0117] A frequency difference calculation unit, configured to calculate the frequency difference of each common tag typed by the first user and the second user using the Euclidean distance according to the first frequency matrix and the common tag set;
[0118] A similarity calculation unit, configured to calculate the similarity between the first user and the second user according to the first total tag weight, the second total tag weight and the frequency difference;
[0119] The recommendation result output unit is used to predict the scores of multiple unrated products based on similarity, the score matrix and the preset number of neighbors, and recommend multiple unrated products with high scores to the user according to the preset number of recommendations.
[0120] The constraint formula for the average label weight is:
[0121]
[0122] Where n is the total number of users, t g is the total number of tags. Both the total number of users and the total number of tags are obtained according to the first frequency matrix.
[0123] The number of times a tag appears in a favorite product can be calculated using TF. The more frequently a user has marked a tag, the more the user likes the product with this tag. IDF represents the classification ability of a tag, and the category can reflect the user's preference for the product. Favorite products can be all products involved in the user's historical behavior data, or some of them. For example, if a user has never marked a product with a certain tag, the product is not considered to be a favorite product. It should be noted that the TF-IDF algorithm is a prior art known to those skilled in the art, and the specific process and principle will not be described in detail here.
[0124] The constraint formula of the preferred product weight parameter is:
[0125]
[0126] in, is the number of target tags in the first user’s favorite products, is the total number of tags in the first user's favorite products, n is the total number of users, t is the total number of favorite products containing the target tag, and the favorite products are obtained from all products based on the TF-IDF algorithm according to the first frequency matrix and the second frequency matrix.
[0127] It should be noted that the above constraint formula of the weight parameters of the preferred products takes the relevant parameters of the first user as an example. The constraint formula of the weight parameters of the preferred products of the second user is similar and will not be repeated here.
[0128] In some embodiments of the present invention, obtaining a first total label weight of all favorite products of a first user and a second total label weight of all favorite products of a second user according to the label average weight and the favorite product weight parameter includes the following steps:
[0129] Multiply the average tag weight and the favorite product weight parameter to obtain the first weight of the target tag for the first user's favorite product;
[0130] Obtaining a first total label weight of all favorite products of the first user according to the first weight;
[0131] The second weight of the target tag to the second user's favorite product is obtained by multiplying the tag average weight and the favorite product weight parameter;
[0132] A second total label weight of all favorite products of the second user is obtained according to the second weight.
[0133] The constraint formula for the first weight is:
[0134]
[0135] Among them, w(t g ,u n ) is the weight parameter of the preferred product, is the average weight of the labels;
[0136] The constraint formula of the first total label weight is:
[0137]
[0138] Among them, m is the total number of favorite products of the first user, g is the total number of labels of the i-th favorite product, and j represents the j-th specific product in the category of the i-th favorite product.
[0139] It should be noted that the constraint formula of the first weight and the constraint formula of the first total label weight are based on the relevant parameters of the first user as an example. The constraint formula of the second weight and the constraint formula of the second total label weight are similar and will not be repeated here.
[0140] The frequency difference of each common tag typed by the first user and the second user is calculated using the Euclidean distance. The constraint formula for the frequency difference is:
[0141]
[0142] Among them, h is the number of common tags used by the first user and the second user, k is the target common tag, and q uk The frequency of the target common label for the first user, q vk The frequency of the target common tag being hit by the second user, the number of common tags hit by the first user and the second user is obtained according to the common tag set, and the frequency of the target common tag being hit by the first user and the frequency of the target common tag being hit by the second user are obtained according to the first frequency matrix.
[0143] The constraint formula for similarity is:
[0144]
[0145] Among them, β is the preset adjustment coefficient, M(u n ,I m ) is the first total label weight, M(u n ,I m ) is the second total label weight, d uv is the frequency difference.
[0146] A new similarity calculation method is established based on the total label weight and frequency difference, and then experimental analysis is conducted on different values of the adjustment factor and the user's neighbor set in the similarity calculation formula. Finally, the optimal value corresponding to the most accurate recommendation result is obtained, which can obtain a better neighbor set and more accurate recommendation results.
[0147] After calculating the similarity of users u and v, the score matrix is decomposed according to the input number of neighbors (an adjustment coefficient used to control variables), and the matrix is obtained by iteratively converging the loss function to predict the score of user u for other unrated products. The number of neighbors and the number of recommendations are input at the same time as the user's historical behavior data, but can also be determined by setting default values, which cannot be regarded as a limitation of the present invention.
[0148] After predicting the scores of multiple unrated products, the scores of the multiple unrated products are sorted in descending order. Products with high scores indicate that users are more interested in the products. By screening out multiple unrated products with high scores and recommending them to users, the cold start problem can be alleviated.
[0149] According to the recommendation system incorporating label weights according to an embodiment of the present invention, by establishing a first frequency matrix between users and labels and a second frequency matrix between products and labels, labels are quantified, a new user preference model is constructed, the concept of label weights is introduced, the total label weights of different users are calculated by the TF-IDF algorithm, the frequency difference of each common label used by two users is calculated using the Euclidean distance, a new similarity calculation method is established based on the total label weights and the frequency difference, and then experimental analysis is performed on different values of the adjustment factor and the user's neighbor set in the similarity calculation formula, and finally the optimal value corresponding to the most accurate recommendation result is obtained, a better neighbor set can be obtained, and the recommendation result is more accurate. The similarity calculation method is used to predict the ratings of multiple unrated products, and multiple unrated products with high ratings are recommended to users according to a preset number of recommendations, which can alleviate the cold start problem.
[0150] In addition, the third aspect of the present invention also provides a control device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor and the memory may be connected via a bus or other means.
[0151] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0152] The non-transitory software program and instructions required to implement the recommendation method integrating tag weights of the above embodiment are stored in the memory, and when executed by the processor, the recommendation method integrating tag weights of the above embodiment is executed.
[0153] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0154] In addition, the fourth aspect of the present invention also provides a computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions are executed by a processor or controller, for example, by a processor of the above-mentioned control device, so that the above-mentioned processor can execute the recommendation method incorporating label weights in the above-mentioned embodiment.
[0155] It will be appreciated by those skilled in the art that all or some of the steps and systems in the disclosed method above may be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that may be used to store desired information and may be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0156] The embodiments of the present invention are described in detail above in conjunction with the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge scope of ordinary technicians in the relevant technical field without departing from the purpose of the present invention.
Claims
1. A recommendation method incorporating label weights, characterized in that: The following steps are involved: In response to the input user historical behavior data, a rating matrix between users and products, a first frequency matrix between users and tags, and a second frequency matrix between products and tags are established, and a set of common tags that the first user and the second user have given to all products is obtained, where the first user and the second user are any two of all users; Obtaining an average label weight according to the first frequency matrix; Based on the TF-IDF algorithm, obtaining the weight parameters of the preferred products according to the first frequency matrix and the second frequency matrix; Obtaining a first total label weight of all the first user's favorite products and a second total label weight of all the second user's favorite products according to the label average weight and the favorite product weight parameter; Calculate the frequency difference of each common tag typed by the first user and the second user using Euclidean distance according to the first frequency matrix and the common tag set; Calculate the similarity between the first user and the second user according to the first total tag weight, the second total tag weight and the frequency difference; The scores of multiple unrated products are predicted based on the similarity, the score matrix and the preset number of neighbors, and the multiple unrated products with high scores are recommended to the user according to a preset number of recommendations.
2. The recommendation method incorporating tag weights according to claim 1, characterized in that: The constraint formula of the label average weight is: Where n is the total number of users, t g is the total number of tags, and both the total number of users and the total number of tags are obtained according to the first frequency matrix.
3. The recommendation method incorporating tag weights according to claim 2, characterized in that: The constraint formula of the preferred product weight parameter is: in, is the number of target tags in the first user’s favorite products, is the total number of tags in the first user's favorite products, n is the total number of users, t is the total number of favorite products containing the target tag, and the favorite products are obtained from all products based on the TF-IDF algorithm according to the first frequency matrix and the second frequency matrix.
4. The recommendation method incorporating tag weights according to claim 3, characterized in that: The step of obtaining a first total label weight of all the first user's favorite products and a second total label weight of all the second user's favorite products according to the label average weight and the favorite product weight parameter comprises the following steps: Multiplying the tag average weight and the favorite product weight parameter to obtain a first weight of the target tag for the first user's favorite product; Obtaining the first total label weight of all favorite products of the first user according to the first weight; Multiplying the tag average weight and the favorite product weight parameter to obtain a second weight of the target tag for the favorite product of the second user; The second total label weight of all the second user's favorite products is obtained according to the second weight.
5. The recommendation method incorporating tag weights according to claim 4, characterized in that: The constraint formula of the first weight is: Among them, w(t g ,u n ) is the weight parameter of the preferred product, is the average weight of the tags; The constraint formula of the first total label weight is: Among them, m is the total number of the first user's favorite products, g is the total number of labels of the i-th favorite product, and j represents the j-th specific product in the category of the i-th favorite product.
6. The recommendation method incorporating tag weights according to claim 5, characterized in that: The constraint formula of the frequency difference is: Where h is the number of common tags used by the first user and the second user, k is the target common tag, and q uk The frequency with which the first user has typed the target common tag, q vk is the frequency with which the second user has typed the target common tag, the number of common tags typed by the first user and the second user is obtained according to the common tag set, and the frequency with which the first user has typed the target common tag and the frequency with which the second user has typed the target common tag are obtained according to the first frequency matrix.
7. The recommendation method incorporating tag weights according to claim 6, characterized in that: The constraint formula of the similarity is: Among them, β is the preset adjustment coefficient, M(u n ,I m ) is the first total label weight, M(u n ,I m ) is the second total label weight, d uv is the frequency difference.
8. The recommendation method incorporating tag weights according to claim 1, characterized in that: The step of predicting the scores of multiple unrated products based on the similarity, the score matrix and the preset number of neighbors, and recommending the multiple unrated products with high scores to the user according to the preset number of recommendations, comprises the following steps: Predicting scores of multiple unrated products based on the similarity, the score matrix and a preset number of neighbors; sorting the ratings of the plurality of unrated products in descending order; According to the preset recommendation quantity and the scores of the sorted multiple unrated products, multiple unrated products with high scores are screened out and recommended to the user.
9. A recommendation system incorporating tag weights, characterized in that: include: a data preprocessing unit, configured to establish, in response to the input user historical behavior data, a rating matrix between users and products, a first frequency matrix between users and tags, and a second frequency matrix between products and tags, and obtain a set of common tags given by a first user and a second user to all products, wherein the first user and the second user are any two of all users; a label average weight determination unit, configured to obtain a label average weight according to the first frequency matrix; a preferred product weight parameter determination unit, configured to obtain the preferred product weight parameter according to the first frequency matrix and the second frequency matrix based on a TF-IDF algorithm; a total label weight determination unit, configured to obtain a first total label weight of all the first user's favorite products and a second total label weight of all the second user's favorite products according to the label average weight and the favorite product weight parameter; a frequency difference calculation unit, configured to calculate the frequency difference of each common tag typed by the first user and the second user using Euclidean distance according to the first frequency matrix and the common tag set; a similarity calculation unit, configured to calculate the similarity between the first user and the second user according to the first total tag weight, the second total tag weight and the frequency difference; The recommendation result output unit is used to predict the scores of multiple unrated products based on the similarity, the scoring matrix and a preset number of neighbors, and recommend multiple unrated products with high scores to the user according to a preset recommendation number.
10. A computer-readable storage medium storing computer-executable instructions, characterized in that: The computer executable instructions are used to execute the recommendation method incorporating tag weights as described in any one of claims 1 to 8.
