Object recommendation method and device, equipment and storage medium
By analyzing the number of score occurrences and rating values in user rating records and calculating the rating preferences and preference similarities between users, the problem of inaccurate user similarity in traditional collaborative filtering algorithms is solved, and more accurate object recommendations are achieved.
Patent Information
- Application Number
- CN202510510799.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-22
- Publication Date
- 2025-09-23
AI Technical Summary
Traditional collaborative filtering recommendation algorithms fail to deeply consider user rating preferences, resulting in inaccurate calculation of similarities between users, which in turn affects the accuracy of recommendation results.
By analyzing the number of occurrences of different scores in user rating records, the similarity of users in rating preferences is determined. Combined with the user's rating values of the object, the third similarity between users is calculated, considering the impact of rating preferences on user relationships.
The accuracy of similarity evaluation between users is improved, ensuring the accuracy and effectiveness of recommendation results.
Smart Images

Figure CN120689111A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an object recommendation method, apparatus, device, and storage medium. Background Art
[0002] User ratings are usually used to express how much users like a product. User ratings are expressed using different scales. For example, some large shopping websites generally use a five-star rating mechanism, and users can give products scores from one star to five stars.
[0003] Traditional collaborative filtering recommendation algorithms use the scores generated by users rating items as modeling data. By calculating the similarity between different users, they then identify and recommend items that the target user has not purchased, among items purchased by users similar to the target user. However, when expressing their preference for a particular item, each user has their own rating preferences. Some users tend to give ratings that are too high or too low compared to others. This rating preference can affect relationships between users, making the recommendations based on these collaborative filtering algorithms inaccurate. Summary of the Invention
[0004] The purpose of the embodiments of the present application is to provide an object recommendation method, apparatus, device and storage medium for considering the impact of different rating preferences among users on the similarity between users when making object recommendations, thereby improving the recommendation accuracy.
[0005] In order to achieve the above objectives, the embodiments of the present application adopt the following technical solutions: In a first aspect, an embodiment of the present application provides an object recommendation method, comprising: Determining a first similarity in rating preferences between the first user and the second user based on the number of times each score appears in a first rating record of the first user and the number of times each score appears in a second rating record of the second user; Determining a second similarity between the first user and the second user in their preferences for the first object based on a first score obtained by the first user rating the first object and a second score obtained by the second user rating the first object; determining a third similarity between the first user and the second user based on the first similarity and the second similarity; Based on the third similarity and the second rating record, a second object is determined to be recommended to the first user.
[0006] In a second aspect, an embodiment of the present application provides an object recommendation device, comprising: a first determining module, configured to determine a first similarity in rating preferences between the first user and the second user based on the number of times each score appears in a first rating record of the first user and the number of times each score appears in a second rating record of the second user; a second determining module, configured to determine a second similarity between the first user and the second user in their preferences for the first object based on a first score obtained by the first user rating the first object and a second score obtained by the second user rating the first object; a third determining module, configured to determine a third similarity between the first user and the second user based on the first similarity and the second similarity; A fourth determining module is configured to determine a second object to be recommended to the first user based on the third similarity and the second rating record.
[0007] In a third aspect, an embodiment of the present application provides an electronic device, including: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the object recommendation method provided in the first aspect.
[0008] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the object recommendation method provided in the first aspect.
[0009] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute some or all of the steps in the object recommendation method provided in the first aspect.
[0010] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects: Considering that the number of times different scores appear in a user's rating record can reflect the user's rating preference, such as whether the user prefers to give high or low scores, the first similarity between the first user and the second user in rating preferences can be determined based on the number of times each score appears in the first user's rating record and the second user's rating record respectively; secondly, since the score obtained by a user for rating an object reflects the user's preference for the object, if different users give similar scores to the first object that they jointly rated, it means that these users have similar preferences for the first object, therefore, based on the scores obtained by the first user and the second user for the first object, the second similarity between the first user and the second user in preferences for the first object can be determined; combining the first similarity and the second similarity, the third similarity between the first user and the second user is determined. The third similarity contains the impact of rating preferences on the relationship between the first user and the second user and is more accurate; on this basis, based on the third similarity between the first user and the second user and the second user's rating record, the second object recommended to the first user can be accurately obtained. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings: Figure 1 A schematic diagram of an implementation environment provided for one embodiment of the present application; Figure 2 A flowchart of an object recommendation method provided in one embodiment of the present application; Figure 3 A schematic structural diagram of an object recommendation device provided in one embodiment of the present application; Figure 4 A schematic structural diagram of an electronic device provided in accordance with an embodiment of the present application. DETAILED DESCRIPTION
[0012] To make the purpose, technical solutions, and advantages of this application more clear, the technical solutions of this application will be clearly and completely described below in conjunction with the specific embodiments of this application and the corresponding drawings. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0013] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, and this is merely a way of distinguishing the objects of the same attributes when describing them in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0014] Key terms explained: Pearson Correlation Coefficient: A statistic that measures the strength and direction of the linear relationship between two variables, with a value between -1 and 1.
[0015] As mentioned above, the traditional collaborative filtering recommendation algorithm uses the scores obtained from users' product ratings as modeling data. By calculating the similarity between different users, it then searches for products that the target user has not purchased among the products liked by users similar to the target user and recommends them.
[0016] However, when users express their preference for a product, each has their own rating preferences. Some users tend to give ratings that are too high or too low compared to others, and this rating preference can affect relationships between users. The aforementioned collaborative filtering recommendation algorithm doesn't fully consider this factor when calculating inter-user similarity. It doesn't distinguish between those who prefer high and low ratings, and it doesn't consider that when users with a high and low preference give the same median rating to a product, they have completely different preferences for that product. This leads to inaccurate calculated inter-user similarity, and consequently, inaccurate recommendations based on this inter-user similarity.
[0017] In view of the above problems, the embodiment of the present application proposes an object recommendation method, which takes into account the rating preferences of different users, fully explores the real user preference information hidden behind the scores obtained by users' product ratings, and introduces the real user preference information into the evaluation process of the similarity between users, thereby solving the impact of users' rating preferences on the relationship between users, and thus more accurately evaluating the similarity between users; on this basis, object recommendations are made based on the similarity between users to improve the recommendation accuracy.
[0018] Specifically, considering that the number of times different scores appear in a user's rating records can reflect the user's rating preferences, such as whether the user prefers to give high or low scores, the first similarity of different users' rating preferences can be determined based on the number of times each score appears in different users' rating records; secondly, since the score obtained by a user for rating an object reflects the user's preference for the object, if different users give similar scores to a jointly rated object, it means that these users have similar preferences for the object, therefore, based on the scores given by different users to the jointly rated first object, the second similarity of different users' preferences for the first object can be determined; combining the first similarity and the second similarity, the third similarity between different users is determined. The third similarity contains the impact of rating preferences on the relationship between users and is more accurate; on this basis, based on the third similarity between the first user and the second user and the second user's rating record, the second object recommended to the first user can be accurately obtained.
[0019] It should be understood that the object recommendation method proposed in the embodiments of the present application can be executed by an electronic device. As an example, it can be executed by software in the electronic device. The electronic devices mentioned here can include terminal devices, such as smartphones, tablets, laptops, desktop computers, intelligent voice interaction devices, smart home appliances, smart watches, vehicle terminals, aircraft, etc.; or the electronic device can also include a server, such as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
[0020] Before introducing the object recommendation method provided by the embodiment of the present application in detail, a brief introduction to the implementation environment involved in the embodiment of the present application is given. Figure 1 , is a schematic diagram of an implementation environment provided by an embodiment of the present application, the implementation environment includes a terminal 10, or the implementation environment includes a terminal 10 and a server 20. The terminal 10 is connected to the server 20 via a wireless network or a wired network.
[0021] Terminal 10 can be a terminal device, such as at least one of a smartphone, tablet computer, laptop computer, desktop computer, intelligent voice interaction device, smart home appliance, smartwatch, vehicle-mounted terminal, and aircraft. Terminal 10 installs and runs an application that supports object display and rating. For example, this application can be a system application or a shopping application. Server 20 includes at least one of a single server, multiple servers, a cloud computing platform, and a virtualization center. Server 20 provides backend services for the application that supports object display and rating.
[0022] Specifically, a user can access objects through the terminal 10 and rate them. For example, a user can purchase a desired product through a shopping app on the terminal 10 and rate the product after the transaction is complete. The terminal 10 collects the user's rating records and uploads them to the server 20 for processing.
[0023] The server 20 receives and stores the user rating records uploaded by the terminal 10. To recommend objects of interest to a user, the server 20 uses a collaborative filtering recommendation algorithm to determine the similarity between the user and other users based on the user's rating records and the rating records of other users, thereby obtaining similar users of the user. Furthermore, the server 20 recommends objects that the user has not visited and that are of interest to similar users.
[0024] Based on the implementation environment introduced above, the object recommendation method provided by the embodiment of the present application is described in detail with reference to the accompanying drawings.
[0025] Please refer to Figure 2 , is a flow chart of an object recommendation method provided in one embodiment of the present application, the method comprising the following steps: S202 : Determine a first similarity in rating preferences between the first user and the second user based on the number of times each score appears in the first rating record of the first user and the number of times each score appears in the second rating record of the second user.
[0026] The first user and the second user are different users. The first user can be the user to be recommended, and the second user can be a user other than the first user. The number of second users can be multiple. For example, the user set contains multiple users. If you want to recommend an object to one of the users, you can determine that user as the first user, and the other users as the second users. The objects in the embodiments of the present application can be commodities, resources, application services, etc., and can be set specifically according to the application scenario. For example, in an e-commerce scenario, the object can be a commodity; in an advertising push scenario, The first rating record includes the objects rated by the first user and the scores obtained by the first user for these objects. The second rating record includes the objects rated by the second user and the scores obtained by the second user for these objects.
[0027] The user's rating for each object falls within a preset score range. The score range defines the highest and lowest scores that users can choose when rating an item. The score range contains multiple optional scores, which are also called rating scales. For example, if a five-star rating system is used, the score range is 1 to 5 stars, which contains 5 optional scores, with the highest score being 5 stars and the lowest score being 1 star. For another example, if a 10-point rating system is used, the score range is 1 to 10, which contains 10 optional scores, with the highest score being 10 and the lowest score being 1.
[0028] When expressing their preference for an object, some users tend to give it an excessively high score, while others tend to give it an excessively low score. This tendency to give an excessively high or low score is called the user's rating preference. The number of times different scores within a score range appear in a user's rating records can reflect the user's rating preference, that is, whether the user prefers to give high or low scores. Therefore, based on the number of times different scores within a score range appear in different users' rating records, the first similarity in rating preferences of different users can be determined.
[0029] In one implementation, the above S202 includes the following steps: constructing a first vector based on the number of times each score within the score range appears in the first rating record, and constructing a second vector based on the number of times each score within the score range appears in the second rating record, wherein the length of the first vector is equal to the length of the second vector, and both are equal to the number of scores included in the score range; then, the similarity between the first vector and the second vector, such as cosine similarity, is determined as the first similarity in rating preferences between the first user and the second user.
[0030] For example, in a five-star rating mechanism, the first vector is represented as A={a1,a2,a3,a4,a5}, where ai represents the number of times the i-th score appears in the first rating record; the second vector is represented as B={b1,b2,b3,b4,b5}, where bi represents the number of times the i-th score appears in the second rating record.
[0031] In another implementation, the above S202 includes the following steps: S221 : Determine a first difference in rating preferences between the first user and the second user based on the number of times each score appears in the first rating record and the number of times each score appears in the second rating record.
[0032] As an example, for each score within the score range, the second degree of difference between the first user and the second user in the score is determined based on the absolute value of the difference between the number of times the score appears in the first rating record and the number of times the score appears in the second rating record; and the first degree of difference in rating preferences between the first user and the second user is determined based on the sum of the second degrees of difference between the first user and the second user in each score.
[0033] Specifically, assuming that the set of the number of times each score within the score range appears in the rating records of user u is used to represent it, its representation is: , where the i-th element in the set Indicates the number of times score i appears in the rating records of user u, Indicates the minimum score in the score range. Represents the maximum score within the score range. For example, assuming a five-star rating mechanism, the set of scores obtained by the first user rating 10 objects is represented as , the set of scores obtained by the second user for rating 10 objects is expressed as , then each score in the score range is the first user The set of the number of times that appears in the rating records of , each score in the score range is The set of the number of times that appears in the rating records of .
[0034] Furthermore, the first difference between the first user and the second user in the rating preference is determined by the following formula (1): (1) in, Indicates the first user and the second user The first difference in rating preference, Indicates score The number of times it appears in the first scoring record, Indicates score The number of times it appears in the second scoring record, Indicates the first user and the second user In the score The second difference on Indicates the minimum score in the score range. Indicates the maximum score in the score range.
[0035] As another example, considering that there is a difference in the number of rated objects between the first user and the second user, this difference will affect the calculation result of the first difference degree. In order to more accurately determine the first difference degree in the rating preferences of the first user and the second user, the above S221 includes the following steps: for each score, based on the number of times the score appears in the first rating record and the number of objects rated in the first rating record, determine the first frequency of the score; and, based on the number of times the score appears in the second rating record and the number of objects rated in the second rating record, determine the second frequency of the score; and, based on the first frequency and second frequency of the score, determine the second difference degree between the first user and the second user on the score; determine the first difference degree based on the sum of the second difference degrees of the first user and the second user on each score.
[0036] Specifically, the first difference between the first user and the second user in rating preference is determined by the following formula (2): (2) in, Indicates the first user and the second user The first difference in rating preference, Indicates score The number of times it appears in the first scoring record, Indicates the number of objects scored in the first scoring record, Indicates score The first frequency, Indicates score The number of times it appears in the second scoring record, Indicates the number of scored objects in the second scoring record, Indicates score The second frequency, Indicates the first user and the second user In the score The second difference on Indicates the minimum score in the score range. Indicates the maximum score in the score range.
[0037] S222: Perform a first operation on the first difference to obtain a first similarity between the first user and the second user in rating preferences.
[0038] The first operation can be set according to actual needs. For example, the first operation is a reciprocal operation or a reciprocal operation is performed on the sum of the first difference and a preset value, etc. This embodiment of the present application does not limit this.
[0039] As an example, the first similarity is determined by the following formula (3): (3) in, Indicates the first user and the second user The first similarity in rating preference, Indicates the first user and the second user The first degree of difference in rating preferences.
[0040] The first similarity obtained by the above method is negatively correlated with the first difference, that is, the greater the first difference, the smaller the first similarity; conversely, the smaller the first difference, the greater the first similarity. And through the above method, it can also ensure that the first similarity is The value in .
[0041] In the above implementation, the difference in rating preferences between the first user and the second user is first determined, and then the similarity in rating preferences between the two is determined based on the difference. This can reduce the impact of extreme scores and improve the accuracy of the similarity assessment between users.
[0042] The above describes some implementations of S202. Of course, it should be understood that S202 can also be implemented in other ways, which are not limited in this embodiment of the present application.
[0043] S204 : Determine a second similarity between the first user and the second user in their preferences for the first object based on a first score obtained by the first user scoring the first object and a second score obtained by the second user scoring the first object.
[0044] The first object is an object rated by the first user and the second user. For example, if the objects rated in the first rating record include objects 1 to 10, and the objects rated in the second rating record include objects 2 to 10, then the first object includes objects 2 to 10.
[0045] Since the score obtained by a user for rating an object reflects the user's preference for the object, if different users give similar scores to the first object that they have rated together, it means that these users have similar preferences for the first object. Therefore, based on the scores of the first user and the second user for the first object, the second similarity of the first user and the second user in their preferences for the first object can be determined.
[0046] In one implementation, a third vector is constructed based on a first score obtained by a first user for rating the first object, and a fourth vector is constructed based on a second score obtained by a second user for rating the first object, wherein the length of the third vector is equal to the length of the fourth vector and both are equal to the number of first objects; then, the similarity between the third vector and the fourth vector is determined as the second similarity between the first user and the second user in their preferences for the first object.
[0047] In another implementation, the above S204 includes the following steps: S241 : Determine a third difference in preferences for the first object between the first user and the second user based on a difference between the first score and the second score.
[0048] As an example, when there are multiple first objects, for each first object, the absolute value of the difference between the first score of the first user for the first object and the second score of the second user for the first object is determined as the third difference in the preferences of the first user and the second user for the first object.
[0049] As another example, considering that there may be differences in the score ranges of the first user and the second user when rating the first object, such differences will affect the calculation results of the third degree of difference. In order to more accurately determine the third degree of difference, the above S241 includes the following steps: first, the first score and the second score are normalized respectively; then, the absolute value of the difference between the normalized first score and the normalized second score is determined as the third degree of difference in the preferences of the first user and the second user for the first object.
[0050] Specifically, the normalization of the scores can be achieved through the following formula (4): (4) in, represents the normalized score, represents the score before normalization, Indicates the maximum score in the scoring record. Indicates the minimum score in the scoring record.
[0051] Furthermore, the third difference between the first user and the second user in their preferences for the first object is determined by the following formula (5): (5) in, represents the third degree of difference, Represents the first object, represents the first score after normalization, Represents the normalized second score.
[0052] S242 : Perform a second operation on the third difference to obtain a second similarity between the first user and the second user in terms of preferences for the first object.
[0053] The second operation can be set according to actual needs. For example, the second operation is a reciprocal operation or the difference between a preset value and a third difference degree is calculated, etc. This embodiment of the present application does not limit this.
[0054] As an example, the second difference is determined by the following formula (6): (6) in, represents the second similarity between the first user and the second user in their preferences for the first object, Indicates a third difference between the first user and the second user in preferences for the first object. The value range is In the embodiment of the present application, the value range is divided into two intervals according to the middle value, namely and .if lie in If the first user For the first object The first score and the second user score For the first object The second score obtained by scoring is similar, that is, ,and The smaller, The bigger; if lie in If the first user For the first object The first score and the second user score For the first object The second score obtained by the scoring is quite different, that is, ,and The bigger, The smaller.
[0055] In the above implementation, the difference between the first user and the second user in their preferences for the first object is first determined, and then the similarity between the two users in their preferences for the first object is determined based on the difference. This can reduce the impact of extreme scores and improve the accuracy of similarity assessment.
[0056] The above describes some implementations of the above S204. Of course, it should be understood that the above S204 can also be implemented in other ways, which are not limited in the present embodiment.
[0057] S206 : Determine a third similarity between the first user and the second user based on the first similarity and the second similarity.
[0058] The first similarity and the second similarity are combined to determine a third similarity between the first user and the second user. The third similarity includes the influence of the rating preference on the relationship between the first user and the second user and is more accurate.
[0059] In one implementation, the above S206 includes the following step: determining a weighted sum of the first similarity and the second similarity as a third similarity between the first user and the second user.
[0060] In another implementation, the above S206 includes the following steps: S261: Determine a first weight corresponding to the first object based on the first similarity and the second similarity.
[0061] The first weight indicates the degree of influence of the scores obtained by the first user and the second user for rating the first object on the similarity between the first user and the second user.
[0062] In the case where the first similarity is less than the first similarity threshold and the second similarity is greater than or equal to the second similarity threshold, the first weight is a negative value. This allows two users with different rating preferences to give similar scores to the same object, but these two scores weaken the similarity between the users, thereby enabling a more accurate assessment of the third similarity between the users.
[0063] When the first similarity is greater than or equal to the first similarity threshold, and the second similarity is greater than or equal to the second similarity, the first weight is a positive value. In this way, when two users with similar rating preferences give similar scores to the same object, these two scores enhance the similarity between the users, thereby enabling a more accurate assessment of the third similarity between the users.
[0064] When the second similarity is less than the second similarity, the first weight is negative. Thus, when two users give very different scores to the same object, regardless of whether the two users have similar rating preferences, they both exhibit completely opposite preferences for the object. The scores given by the two users to the object weaken the similarity between the users, thereby enabling a more accurate assessment of the third similarity between the users.
[0065] Specifically, the first similarity is expressed as , the first similarity threshold is .when hour, Take negative value; when hour, Take a positive value. That is, The positive and negative signs of respectively indicate that the first user and the second user are similar and dissimilar in their rating preferences.
[0066] Furthermore, the second similarity is expressed as , the second similarity threshold is 0. When , the first weight corresponding to the first object is determined by the following formula (7): (7) in, Represents the first object The corresponding first weight. It can be seen that when hour, , which means that when two users with similar rating preferences give similar scores to the same object, these two scores enhance the similarity between users, thus enabling a more accurate evaluation of the third similarity between users. Conversely, when hour, , which means that when two users with dissimilar rating preferences give similar scores to the same object, these two scores have a weakening effect on the similarity between users, thereby enabling a more accurate evaluation of the third similarity between users.
[0067] when When , the first weight corresponding to the first object is determined by the following formula (8): (8) in, Represents the first object The corresponding first weight. It can be seen that no matter still , This means that when two users give very different scores to the same object, regardless of whether the two users are similar in their rating preferences, they show completely opposite preferences for the object. The scores given by the two users to the object have a weakening effect on the similarity between users, thereby enabling a more accurate assessment of the third similarity between users.
[0068] S262: Determine a first correlation between the first user and the second user in scoring the first object based on the first score and the second score.
[0069] Specifically, the Pearson correlation coefficient can be used to determine the first correlation between the first user and the second user in scoring the first object. That is, for each first object, the first correlation between the first user and the second user in scoring the first object is ,in, represents all first objects rated by the first user and the second user, represents the kth first object, represents the first score obtained by the first user for rating the kth first object, represents the mean score of all objects in the first scoring record, represents the second score obtained by the second user for rating the kth first object, Represents the mean of the scores of all objects in the second scoring record.
[0070] S263: Determine a third similarity based on the first correlation and the first weight corresponding to the first object.
[0071] As an example, when the number of first objects is one, the product of the first correlation and the first weight corresponding to the first object is determined as the third similarity; when the number of first objects is multiple, based on the first weight corresponding to the first object, the first correlations of the first user and the second user in scoring each first object are weightedly summed to obtain the third similarity.
[0072] As another example, based on the first correlation and the first weight corresponding to the first object, the second correlation between the first user and the second user is determined; based on the number of first objects, the number of objects rated in the first rating record, and the number of objects rated in the second rating record, the trust between the first user and the second user is determined; and the product of the second correlation and the trust is determined as the third similarity.
[0073] Specifically, when there is only one first object, the product of the first relevance and the first weight corresponding to the first object is determined as the second relevance; when there are multiple first objects, based on the first weight corresponding to the first object, the first relevance of the first user and the second user in scoring each first object is weighted and summed to obtain the second relevance. For example, the second relevance is expressed as ,in, represents all first objects rated by the first user and the second user, represents the kth first object, represents the first weight corresponding to the kth first object, represents the first score obtained by the first user for rating the kth first object, represents the mean score of all objects in the first scoring record, represents the second score obtained by the second user for rating the kth first object, Represents the mean of the scores of all objects in the second scoring record.
[0074] In this application example, if two users jointly rate an object, then a trust relationship exists between the two users, and the size of this trust relationship is the degree of trust between the two users. Based on this, the degree of trust between the first user and the second user represents the size of the trust relationship between the first user and the second user, which reflects the mutual credibility between the score obtained by the first user's rating and the score obtained by the second user's rating, which can be determined by the following formula (9): (9) in, represents the trust between the first user and the second user, represents the number of first objects rated by the first user and the second user, Indicates the number of objects rated in the first rating record (i.e., the number of objects rated by the first user). Indicates the number of objects rated in the second rating record (that is, the number of objects rated by the second user).
[0075] It can be seen that the more objects two users rate together, the more "interactions" there are between the two users, and the more reliable the similarity judgment based on their behaviors. Therefore, the greater the trust between the two users, that is, the greater the credibility of the mutual reference between the scores of the two users.
[0076] Furthermore, the third similarity can be determined by the following formula (10): (10) in, represents the third similarity, represents the trust between the first user and the second user, represents all first objects rated by the first user and the second user, represents the kth first object, represents the first weight corresponding to the kth first object, represents the first score obtained by the first user for rating the kth first object, represents the mean score of all objects in the first scoring record, represents the second score obtained by the second user for rating the kth first object, Represents the mean of the scores of all objects in the second scoring record.
[0077] Traditional collaborative filtering recommendation algorithms determine user similarity based on the scores of different users rating the same object. This can lead to overestimation of user similarity if the number of objects rated by users is small. The above approach, when calculating the third similarity, takes into account the influence of trust between the first and second users and the similarity of their rating preferences on the relationship between them, based on the first correlation between the two users for the first object. This solves the problem of the first correlation overestimating user similarity when data is sparse, resulting in a more accurate third similarity.
[0078] The above describes some implementations of the above S206. Of course, it should be understood that the above S206 can also be implemented in other ways, which are not limited in the present embodiment.
[0079] S208: Determine a second object to be recommended to the first user based on the third similarity and the second scoring record.
[0080] In one implementation, the above S208 includes the following steps: based on the third similarity, determining a second user similar to the first user from the second users as the third user, for example, determining a second user whose third similarity with the first user is greater than or equal to a similarity threshold as the third user; then, determining an object in the second rating record of the third user whose score is greater than or equal to the score threshold and has not been rated by the first user as the second object recommended to the first user.
[0081] In another implementation, the above S208 includes the following steps: S281 : Determine, based on the third similarity, a third user similar to the first user from among the second users.
[0082] Specifically, a second user whose third similarity with the first user is greater than or equal to a similarity threshold is determined as the third user.
[0083] S282: Determine, from the second rating record of the third user, a third object that has not been rated by the first user and a third score obtained by the third user for rating the third object.
[0084] Specifically, the third user's second rating record includes the objects rated by the third user and the scores obtained by the third user for these objects. Furthermore, any objects in the third user's second rating record that do not appear in the first rating record are identified as third objects not rated by the first user, and the score assigned to the third user by the third user (i.e., the third score) is obtained.
[0085] S283: Determine the first user's interest in the third object based on the third similarity between the third user and the first user and the third score.
[0086] Specifically, the first user's interest in the third object can be determined by the following formula (11): (11) in, Indicates the first user To the third party interest, represents the mean score of all objects in the first scoring record, Indicates the first user and third users The third similarity between Represents the set of all third objects, Indicates the third user For the first object The third score obtained by scoring is Indicates the third user The mean of the scores of all objects in the second scoring record.
[0087] S284: Determine the third object whose interest level is greater than or equal to the interest level threshold as the second object recommended to the first user.
[0088] In the above implementation, a third user who is similar to the first user is first determined, and then a third object that has been rated by the third user and not rated by the first user is determined. Then, based on the first user's interest in the third object, a second object recommended to the first user is determined. This ensures that the second object is an object of interest to the first user, thereby improving the recommendation success rate.
[0089] The above describes some implementations of the above S208. Of course, it should be understood that the above S208 can also be implemented in other ways, which are not limited in the present embodiment.
[0090] The object recommendation method provided in the embodiment of the present application takes into account that the number of times different scores appear in the user's rating records can reflect the user's rating preferences, such as whether the user prefers to give high or low scores. Therefore, based on the number of times each score appears in the first user's rating records and the second user's rating records, the first similarity between the first user and the second user in rating preferences can be determined; secondly, since the score obtained by the user for rating an object reflects the user's preference for the object, if different users give similar scores to the first object that is rated together, it means that these users have similar preferences for the first object. Therefore, based on the scores obtained by the first user and the second user for the first object, the second similarity between the first user and the second user in preference for the first object can be determined; the first similarity and the second similarity are combined to determine the third similarity between the first user and the second user. The third similarity contains the impact of the rating preference on the relationship between the first user and the second user and is more accurate; on this basis, based on the third similarity between the first user and the second user and the second user's rating record, the second object recommended to the first user can be accurately obtained.
[0091] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0092] Based on the same inventive concept, the present application also provides an object recommendation device. Figure 3 , is a structural diagram of an object recommendation device 300 provided in an embodiment of the present application, the device 300 includes: a first determination module 310, a second determination module 320, a third determination module 330 and a fourth determination module 340.
[0093] The first determination module 310 is configured to determine a first similarity in rating preferences between the first user and the second user based on the number of times each score appears in the first rating record of the first user and the number of times each score appears in the second rating record of the second user.
[0094] The second determination module 320 is used to determine a second similarity between the first user and the second user in their preferences for the first object based on a first score obtained by the first user rating the first object and a second score obtained by the second user rating the first object.
[0095] The third determining module 330 is configured to determine a third similarity between the first user and the second user based on the first similarity and the second similarity.
[0096] The fourth determining module 340 is configured to determine a second object to be recommended to the first user based on the third similarity and the second rating record.
[0097] In another embodiment, the first determining module is configured to: Determining a first difference in rating preferences between the first user and the second user based on the number of times each score appears in the first rating record and the number of times each score appears in the second rating record; A first operation is performed on the first difference to obtain a first similarity in rating preferences between the first user and the second user.
[0098] In another embodiment, when determining the first difference in rating preferences between the first user and the second user based on the number of times each score appears in the first rating record and the number of times each score appears in the second rating record, the first determining module performs the following steps: For each score, determining a first frequency of the score based on the number of times the score appears in the first scoring record and the number of scored objects in the first scoring record; and, determining a second frequency of the score based on the number of times the score appears in the second scoring record and the number of scored objects in the second scoring record; and, determining a second difference in the scores between the first user and the second user based on the first frequency and the second frequency of the scores; The first difference is determined based on the sum of the second difference between the first user and the second user in each score.
[0099] In another embodiment, the second determining module is configured to: determining a third difference between the first user and the second user in preferences for the first object based on a difference between the first score and the second score; A second operation is performed on the third difference to obtain the second similarity.
[0100] In another embodiment, the third determining module is configured to: Determining a first weight corresponding to the first object based on the first similarity and the second similarity, the first weight representing the degree of influence of scores obtained by the first user and the second user rating the first object on the similarity between the first user and the second user; Determining a first correlation between the first user and the second user in rating the first object based on the first score and the second score; The third similarity is determined based on the first relevance and a first weight corresponding to the first object.
[0101] In another embodiment, when the first similarity is less than a first similarity threshold and the second similarity is greater than or equal to a second similarity threshold, the first weight is a negative value; When the first similarity is greater than or equal to the first similarity threshold, and the second similarity is greater than or equal to the second similarity, the first weight is a positive value; When the second similarity is less than the second similarity, the first weight is a negative value.
[0102] In another embodiment, the third determination module performs the following steps when determining the third similarity based on the first correlation and the first weight corresponding to the first object: determining a second correlation between the first user and the second user based on the first correlation and a first weight corresponding to the first object; determining a degree of trust between the first user and the second user based on the number of the first objects, the number of objects scored in the first scoring record, and the number of objects scored in the second scoring record; The product of the second relevance and the confidence is determined as the third similarity.
[0103] In another embodiment, the fourth determining module is configured to: determining, from the second users, a third user similar to the first user based on the third similarity; Determining, from the second rating record of the third user, a third object that has not been rated by the first user and a third score obtained by the third user for rating the third object; determining, based on a third similarity between the third user and the first user and the third score, the first user's interest in the third object; A third object whose interest level is greater than or equal to an interest level threshold is determined as a second object recommended to the first user.
[0104] Obviously, the object recommendation device provided in the embodiment of the present application can be used as Figure 2 The execution body of the object recommendation method shown, for example Figure 2 In the object recommendation method shown in FIG. 1 , step S202 can be performed by Figure 3The first determining module 310 in the object recommendation apparatus shown in FIG. 1 is executed, and step S204 can be performed by Figure 3 The second determining module 320 in the object recommendation apparatus shown in FIG. 1 is executed, and step S206 can be performed by Figure 3 The third determining module 330 in the object recommendation apparatus shown in FIG. 1 is executed, and step S208 can be performed by Figure 3 The fourth determination module 340 in the object recommendation device is shown.
[0105] According to another embodiment of the present application, Figure 3 The various modules in the object recommendation device shown can be individually or completely combined into one or several other modules to form a whole, or one (or some) of the modules can be further divided into multiple functionally smaller modules to form a whole, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above-mentioned units are divided based on logical functions. In actual applications, the functions of a module can also be implemented by multiple modules, or the functions of multiple modules can be implemented by one module. In the embodiments of the present application, the object recommendation device may also include other modules. In actual applications, these modules can also be implemented with the assistance of other modules, and can be implemented by the collaboration of multiple modules.
[0106] According to another embodiment of the present application, a general computing device such as a computer including a central processing unit (CPU), a random access memory (RAM), a read-only memory (ROM) and other processing elements and storage elements can be run to execute the following operations: Figure 2 A computer program (including program code) for each step involved in the corresponding method shown in FIG. Figure 3 The object recommendation device shown in the figure is used to implement the object recommendation method of the embodiment of the present application. The computer program can be recorded on a computer-readable storage medium, for example, and transferred to an electronic device through the computer-readable storage medium and run therein.
[0107] Figure 4 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Figure 4 At the hardware level, the electronic device includes a processor and, optionally, an internal bus, a network interface, and memory. The memory may include internal memory, such as high-speed random-access memory (RAM), or non-volatile memory, such as at least one disk drive. Of course, the electronic device may also include other hardware required for its services.
[0108] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, Figure 4 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or one type of bus.
[0109] The memory is used to store programs. Specifically, the program may include program code, which includes computer operating instructions. The memory may include internal memory and non-volatile memory, and provides instructions and data to the processor.
[0110] The processor reads the corresponding computer program from the non-volatile memory into the internal memory and then runs it, forming an object recommendation device at the logical level. The processor executes the program stored in the memory and is specifically used to perform the following operations: Determining a first similarity in rating preferences between the first user and the second user based on the number of times each score appears in a first rating record of the first user and the number of times each score appears in a second rating record of the second user; Determining a second similarity between the first user and the second user in their preferences for the first object based on a first score obtained by the first user rating the first object and a second score obtained by the second user rating the first object; determining a third similarity between the first user and the second user based on the first similarity and the second similarity; Based on the third similarity and the second rating record, a second object is determined to be recommended to the first user.
[0111] The above application Figure 2The methods performed by the object recommendation apparatus disclosed in the illustrated embodiments can be applied to or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the aforementioned method can be performed by hardware integrated logic circuits within the processor or by software instructions. The aforementioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The methods, steps, and logic block diagrams disclosed in the embodiments of this application can be implemented or executed. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly executed by a hardware decoding processor or by a combination of hardware and software modules within the decoding processor. The software module can be located in a storage medium well-known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the memory, and the processor reads the information in the memory and, in conjunction with its hardware, completes the steps of the above method.
[0112] The electronic device may also perform Figure 2 Method, and implement the object recommendation device in Figure 2 The functions of the illustrated embodiment will not be described in detail in the embodiments of the present application.
[0113] Of course, in addition to software implementation, the electronic device of this application does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0114] The embodiment of the present application also provides a computer-readable storage medium, which stores one or more programs, wherein the one or more programs include instructions, which, when executed by an electronic device including multiple application programs, can enable the electronic device to execute Figure 2 The method of the embodiment shown is specifically used to perform the following operations: Determining a first similarity in rating preferences between the first user and the second user based on the number of times each score appears in a first rating record of the first user and the number of times each score appears in a second rating record of the second user; Determining a second similarity between the first user and the second user in their preferences for the first object based on a first score obtained by the first user rating the first object and a second score obtained by the second user rating the first object; determining a third similarity between the first user and the second user based on the first similarity and the second similarity; Based on the third similarity and the second rating record, a second object is determined to be recommended to the first user.
[0115] An embodiment of the present application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute some or all of the steps in the object recommendation method provided in the embodiment of the present application.
[0116] In short, the above description is only a preferred embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
[0117] The systems, devices, modules, or units described in the above embodiments may be implemented by computer chips or entities, or by products having certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0118] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0119] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0120] The various embodiments in this specification are described in a progressive manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiments are generally similar to the method embodiments, so the description is relatively simple. For relevant parts, refer to the description of the method embodiments.
Claims
1. An object recommendation method, characterized in that: include: Determining a first similarity in rating preferences between the first user and the second user based on the number of times each score appears in a first rating record of the first user and the number of times each score appears in a second rating record of the second user; Determining a second similarity between the first user and the second user in their preferences for the first object based on a first score obtained by the first user rating the first object and a second score obtained by the second user rating the first object; determining a third similarity between the first user and the second user based on the first similarity and the second similarity; Based on the third similarity and the second rating record, a second object is determined to be recommended to the first user.
2. The method according to claim 1, characterized in that The determining, based on the number of times each score appears in the first rating record of the first user and the number of times each score appears in the second rating record of the second user, a first similarity in rating preferences between the first user and the second user includes: Determining a first difference in rating preferences between the first user and the second user based on the number of times each score appears in the first rating record and the number of times each score appears in the second rating record; A first operation is performed on the first difference to obtain a first similarity in rating preferences between the first user and the second user.
3. The method according to claim 2, characterized in that The determining, based on the number of times each score appears in the first rating record and the number of times each score appears in the second rating record, a first difference in rating preferences between the first user and the second user includes: For each score, determining a first frequency of the score based on the number of times the score appears in the first scoring record and the number of scored objects in the first scoring record; and, determining a second frequency of the score based on the number of times the score appears in the second scoring record and the number of scored objects in the second scoring record; and, determining a second difference in the scores between the first user and the second user based on the first frequency and the second frequency of the scores; A first degree of difference is determined based on a sum of second degrees of difference between the first user and the second user in each score.
4. The method according to claim 1, wherein The determining, based on a first score obtained by the first user scoring the first object and a second score obtained by the second user scoring the first object, a second similarity between the first user and the second user in terms of preferences for the first object includes: determining, based on a difference between the first score and the second score, a third difference between the first user and the second user in preferences for the first object; A second operation is performed on the third difference to obtain the second similarity.
5. The method according to claim 1, wherein The determining, based on the first similarity and the second similarity, a third similarity between the first user and the second user includes: Determining a first weight corresponding to the first object based on the first similarity and the second similarity, the first weight representing the degree of influence of scores obtained by the first user and the second user rating the first object on the similarity between the first user and the second user; Determining a first correlation between the first user and the second user in rating the first object based on the first score and the second score; The third similarity is determined based on the first relevance and a first weight corresponding to the first object.
6. The method according to claim 5, characterized in that The determining the third similarity based on the first correlation and the first weight corresponding to the first object includes: determining a second correlation between the first user and the second user based on the first correlation and a first weight corresponding to the first object; determining a degree of trust between the first user and the second user based on the number of the first objects, the number of objects scored in the first scoring record, and the number of objects scored in the second scoring record; The product of the second relevance and the confidence is determined as the third similarity.
7. The method according to claim 1, characterized in that The determining, based on the third similarity and the second rating record, a second object to be recommended to the first user includes: determining, from the second users, a third user similar to the first user based on the third similarity; Determining, from the second rating record of the third user, a third object that has not been rated by the first user and a third score obtained by the third user for rating the third object; determining, based on a third similarity between the third user and the first user and the third score, the first user's interest in the third object; A third object whose interest level is greater than or equal to an interest level threshold is determined as a second object recommended to the first user.
8. An object recommendation device, characterized in that: include: a first determining module, configured to determine a first similarity in rating preferences between the first user and the second user based on the number of times each score appears in a first rating record of the first user and the number of times each score appears in a second rating record of the second user; a second determining module, configured to determine a second similarity between the first user and the second user in their preferences for the first object based on a first score obtained by the first user rating the first object and a second score obtained by the second user rating the first object; a third determining module, configured to determine a third similarity between the first user and the second user based on the first similarity and the second similarity; A fourth determining module is configured to determine a second object to be recommended to the first user based on the third similarity and the second rating record.
9. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the object recommendation method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the object recommendation method according to any one of claims 1 to 7.