Method, device, computer equipment and storage medium for determining user similarity
By introducing user-related features, evaluation features of target objects and time factors in user similarity calculation, and using the weighted Hamming distance method, the calculation inaccuracy problem caused by one-sided factors in the prior art is solved, and more accurate user-similarity calculation and personalized recommendation are achieved.
Patent Information
- Application Number
- CN202210859467.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-21
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2042-07-21
AI Technical Summary
In the prior art, when calculating user similarity through Pearson correlation coefficient, the considerations are more one-sided, resulting in inaccurate calculation results.
By considering the user's correlation characteristics, the evaluation characteristics of the target object and the time factors, the similarity between users, including factors such as the user's correlation characteristics, the average evaluation time difference of the target object and the online time, the weighted Hamming distance method is used to determine the user's similarity.
It realizes a more comprehensive and accurate calculation of similarity between users, improving the accuracy of the recommendation system and personalized recommendation effect.
Smart Images

Figure CN115081541B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of big data technology, and in particular to a method, apparatus, computer device, storage medium, and computer program product for determining user similarity. Background Art
[0002] With the rapid development of Internet technology, recommendation systems have emerged. This recommendation system recommends objects (items) to users. The core part of the recommendation algorithm of this recommendation system is the calculation of user similarity.
[0003] In related art, the similarity between users is generally calculated using the Pearson correlation coefficient. However, when calculating the similarity between users using the Pearson correlation coefficient, this method only considers the user characteristics between users, which is a relatively one-sided factor and results in inaccurate user similarity. Summary of the Invention
[0004] Based on this, it is necessary to provide a method, apparatus, computer device, computer-readable storage medium and computer program product for accurately calculating user similarity in order to address the above technical issues.
[0005] In a first aspect, the present application provides a method for determining user similarity. The method comprises:
[0006] determining a first user similarity between the first user and the second user based on a first rating of the target object by the first user and a second rating of the target object by the second user;
[0007] determining a time impact factor of the object and a level impact factor of the object based on the association feature of the first user, the association feature of the second user, and the evaluation feature of the target object;
[0008] determining a time influence factor of a user according to the correlation feature of the first user and the correlation feature of the second user;
[0009] The target user similarity between the first user and the second user in the object push scenario is determined according to the first user similarity, the time influence factor of the object, the level influence factor of the object, and the time influence factor of the user.
[0010] In one embodiment, the association characteristics of the first user include the associated users of the first user, the association characteristics of the second user include the associated users of the second user, and the evaluation characteristics of the target object include the average evaluation time difference and the online time. The method further includes:
[0011] Extracting an associated user set from a preset high-level user set, where the associated user set includes associated users of the first user and associated users of the second user;
[0012] Obtaining multiple time differences based on the real time and the evaluation time of the target object by users in the associated user set, and calculating the mean of the multiple time differences to obtain the mean of the evaluation time differences;
[0013] The time influence factor of the object is determined according to the average time difference of the evaluation of the target object, the online time and the real time. The time influence factor of the object represents the degree of influence of the time factor of the target object on the user similarity.
[0014] In one embodiment, determining the time impact factor of the object based on the mean time difference of the evaluation of the target object, the online time, and the real time includes:
[0015] Determine a time difference between the real time and the online time, and sum the time difference with an average of the evaluation time differences of the target object to obtain a combined time;
[0016] Performing inverse number processing on the combined time to obtain inverse time, and performing logarithmic processing on the inverse time to obtain the time impact factor of the object.
[0017] In one embodiment, the associated features of the first user include objects evaluated by the first user, the associated features of the second user include objects evaluated by the second user, and the evaluation features of the target object include the evaluation level of the target object;
[0018] The method further comprises:
[0019] determining, based on an object evaluated by the first user and an object evaluated by the second user, an evaluation level of a first object and the first object, wherein the first object is an object evaluated by both the first user and the second user;
[0020] The ratio of the sum of the evaluation levels of the plurality of first objects to the evaluation level of the target object is used as the level impact factor of the object.
[0021] In one embodiment, the associated features of the first user include associated users of the first user, and the associated features of the second user include associated users of the second user; the method further includes:
[0022] Determining a first difference between the evaluation interest of the first user and the users associated with the first user over time, and a second difference between the evaluation interest of the second user and the users associated with the second user over time;
[0023] The first difference, the second difference, and a preset target value are summed to determine the time impact factor of the user.
[0024] In one embodiment, the method further comprises:
[0025] Obtaining a first evaluation time of a second object by the first user, where the second object is an object evaluated by the first user;
[0026] Calculating the average of the plurality of first evaluation times to obtain a first evaluation time average, and using the first evaluation time average as the first evaluation interest level of the first user in the time dimension;
[0027] The ratio of each first evaluation time to the object set consisting of the second objects is used as the second evaluation interest of the associated users of the first user in the time dimension;
[0028] An interest difference between the first evaluation interest and the second evaluation interest is determined, and a logarithmic operation is performed on the interest difference to obtain a first difference in the evaluation interest of the first user and a user associated with the first user over time.
[0029] In one embodiment, determining the target user similarity between the first user and the second user in the object push scenario based on the first user similarity, the time influence factor of the object, the level influence factor of the object, and the time influence factor of the user includes:
[0030] The product of the first user similarity, the time influence factor of the object, the level influence factor of the object, and the time influence factor of the user is used as the initial similarity between the first user and the second user;
[0031] The initial similarity is normalized to obtain the target user similarity.
[0032] In one embodiment, the method further comprises:
[0033] When the target user similarity between the first user and the second user is greater than a preset similarity threshold, the second user is used as the target second user;
[0034] Obtaining a preference object set of the target second user;
[0035] The preference object set of the target second user is pushed to the first user.
[0036] In a second aspect, the present application further provides a device for determining user similarity. The device comprises:
[0037] a first determining module, configured to determine a first user similarity between the first user and the second user based on a first rating of the target object by the first user and a second rating of the target object by the second user;
[0038] a second determining module, configured to determine a time impact factor of an object and a level impact factor of an object based on the association characteristics of the first user, the association characteristics of the second user, and the evaluation characteristics of the target object;
[0039] a third determining module, configured to determine a user's time influence factor based on the association characteristics of the first user and the association characteristics of the second user;
[0040] The fourth determining module is configured to determine the target user similarity between the first user and the second user in the object push scenario based on the first user similarity, the time influence factor of the object, the level influence factor of the object, and the time influence factor of the user.
[0041] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are performed:
[0042] determining a first user similarity between the first user and the second user based on a first rating of the target object by the first user and a second rating of the target object by the second user;
[0043] determining a time impact factor of the object and a level impact factor of the object based on the association feature of the first user, the association feature of the second user, and the evaluation feature of the target object;
[0044] determining a time influence factor of a user according to the correlation feature of the first user and the correlation feature of the second user;
[0045] The target user similarity between the first user and the second user in the object push scenario is determined according to the first user similarity, the time influence factor of the object, the level influence factor of the object, and the time influence factor of the user.
[0046] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the following steps:
[0047] determining a first user similarity between the first user and the second user based on a first rating of the target object by the first user and a second rating of the target object by the second user;
[0048] determining a time impact factor of the object and a level impact factor of the object based on the association feature of the first user, the association feature of the second user, and the evaluation feature of the target object;
[0049] determining a time influence factor of a user according to the correlation feature of the first user and the correlation feature of the second user;
[0050] The target user similarity between the first user and the second user in the object push scenario is determined according to the first user similarity, the time influence factor of the object, the level influence factor of the object, and the time influence factor of the user.
[0051] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the following steps:
[0052] determining a first user similarity between the first user and the second user based on a first rating of the target object by the first user and a second rating of the target object by the second user;
[0053] determining a time impact factor of the object and a level impact factor of the object based on the association feature of the first user, the association feature of the second user, and the evaluation feature of the target object;
[0054] determining a time influence factor of a user according to the correlation feature of the first user and the correlation feature of the second user;
[0055] The target user similarity between the first user and the second user in the object push scenario is determined according to the first user similarity, the time influence factor of the object, the level influence factor of the object, and the time influence factor of the user.
[0056] The above-mentioned method, apparatus, computer device, storage medium and computer program product for determining user similarity include: determining the first user similarity between the first user and the second user based on the first rating of the target object by the first user and the second rating of the target object by the second user; determining the time influence factor of the object and the level influence factor of the object based on the association characteristics of the first user, the association characteristics of the second user and the evaluation characteristics of the target object; determining the time influence factor of the user based on the association characteristics of the first user and the association characteristics of the second user; and determining the target user similarity between the first user and the second user in the object push scenario based on the first user similarity, the time influence factor of the object, the level influence factor of the object and the time influence factor of the user. By adopting this method, when determining the similarity between users, the relationship between the user's evaluation level and the object's evaluation level can be fully considered, and by introducing the user's time factor and the object's time factor, a more comprehensive, objective and accurate effect of determining the similarity between users can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 1 is a flow chart of a method for determining user similarity in one embodiment;
[0058] Figure 2 A schematic flow chart of the step of determining the time impact factor of an object in one embodiment;
[0059] Figure 3 A schematic flow chart of the step of determining the rank impact factor of an object in one embodiment;
[0060] Figure 4 A schematic diagram of a process for determining a user's time impact factor in one embodiment;
[0061] Figure 5 FIG1 is a flow chart of a step of determining a first degree of difference in one embodiment;
[0062] Figure 6 Schematic diagram of a process for determining target user similarity in one embodiment;
[0063] Figure 7 A schematic diagram of accuracy in a similar distance dimension in one embodiment;
[0064] Figure 8 A schematic diagram of accuracy in the dimension of the number of user evaluations in one embodiment;
[0065] Figure 9 is a structural block diagram of a device for determining user similarity in one embodiment;
[0066] Figure 10 FIG. 1 is a diagram showing the internal structure of a determination machine device in one embodiment. DETAILED DESCRIPTION
[0067] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0068] In related technologies, the determination of similarity is a key component of recommendation algorithms in recommendation systems. The Pearson correlation coefficient is commonly used. In item-based recommendation techniques, the cosine similarity method is commonly used. Euclidean distance and Jaccard distance are also common similarity distance methods.
[0069] Hamming distance is commonly used in information theory. It refers to the number of character replacements performed when converting one string to another. For example, the Hamming distance from "23" to "24" is 1. The method for determining user similarity provided in the embodiments of the present invention not only fully considers the relationship between users i and items (recommended objects) when determining the similarity between users i and j, but also factors such as the user's temporal attributes, the item's temporal attributes, and the user's rating, thereby significantly improving the accuracy of the resulting user similarity.
[0070] In one embodiment, Figure 1 As shown, a method for determining user similarity is provided. This embodiment uses the method applied to a terminal as an example. It is understandable that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. The above-mentioned terminals can be, but are not limited to, various personal computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server can be implemented as an independent server or a server cluster composed of multiple servers. In this embodiment, the method for determining user similarity includes the following steps:
[0071] Step 102 : determining a first user similarity between the first user and the second user based on a first rating of the target object by the first user and a second rating of the target object by the second user.
[0072] Specifically, the first user may be a user of the recommendation system, for example, user i; the second user may also be a user of the recommendation system, for example, user j; the target object may be an object evaluated by both the first user and the second user, and the object may be an item in the recommendation system, for example, a movie item, a novel item, etc. The first rating of the target object by the first user is the rating score obtained by the first user after evaluating the target object based on his / her own evaluation criteria. In this way, the terminal can obtain the first rating r of the target object h by the first user i. ih And the second rating r of the second user j for the target object h jh , and determine the similarity Hamming distance between the first user and the second user based on the first score and the second score, and use the similarity Hamming distance between the first user and the second user as the first user similarity between the first user and the second user.
[0073] In one example, the first user similarity value may range from a first relevance threshold (e.g., 0) to a second relevance threshold (e.g., 0.5 or 1). The closer the first user similarity value is to the first relevance threshold, the higher the similarity between the first user and the second user; the closer the first user similarity value is to the second relevance threshold, the lower the similarity between the first user and the second user.
[0074] In one possible implementation, the terminal may calculate the sum of the first score of the first user on the target object and the second score of the second user on the target object, and use the ratio of the first score of the first user on the target object to the sum as the first user similarity between the first user and the second user, which may be determined by the following formula:
[0075]
[0076] Wherein, D(i, j, h) represents the first user similarity, and the value range of D(i, j, h) can be [0, 1].
[0077] In another possible implementation, the terminal may calculate the sum of the first score of the first user on the target object and the second score of the second user on the target object, and calculate the ratio of the first score of the first user on the target object to the sum. In this way, the terminal may calculate the difference between the ratio and the target value (such as 0.5). The terminal may obtain the first user similarity based on the difference, which may be determined by the following formula:
[0078]
[0079] Wherein, D(i, j, h) represents the first user similarity, and the value range of D(i, j, h) can be [0, 0.5].
[0080] Step 104 : determining the time impact factor of the object and the level impact factor of the object according to the association characteristics of the first user, the association characteristics of the second user, and the evaluation characteristics of the target object.
[0081] Specifically, the first user's association features characterize the first user's association information, the second user's association features characterize the second user's association information, and the target object's evaluation features characterize the data corresponding to the target object's evaluation. The first user's association features include features such as the first user's associated users and the objects the first user has evaluated. The target object's evaluation features include the target object's rating, the mean time difference between evaluations, and the target object's online time.
[0082] In this way, the terminal can determine the object's time influence factor and the object's level influence factor based on the acquired association characteristics of the first user, the association characteristics of the second user, and the evaluation characteristics of the target object. The object's time influence factor is used to indicate the degree of influence of the object's time information on user similarity. The object's time information may include the object's online time, etc. The object's level influence factor is used to indicate the degree of influence of the object's level information on user similarity. The object's level information may include evaluation level information (e.g., evaluation score, number of stars, etc.) determined after the object is evaluated by multiple users.
[0083] Step 106: Determine the user's time influence factor based on the correlation characteristics of the first user and the correlation characteristics of the second user.
[0084] Specifically, the terminal may determine the influence degree of the user's time factor on the user similarity, that is, the user's time influence factor, based on the acquired association characteristics of the first user and the association characteristics of the second user.
[0085] Step 108 : Determine the target user similarity between the first user and the second user in the object push scenario based on the first user similarity, the object's time influence factor, the object's level influence factor, and the user's time influence factor.
[0086] Specifically, the terminal may use the object's time influence factor as the weight corresponding to the object's time factor, the object's level influence factor as the weight corresponding to the object's level factor, and the user's time influence factor as the weight corresponding to the user's time factor. In this way, the terminal may perform weighted processing on the first user's similarity based on the above weights to obtain the target user similarity between the first user and the second user in the object push scenario.
[0087] In the above-mentioned method for determining user similarity, the first user similarity between the first user and the second user is calculated based on the first rating of the target object by the first user and the second rating of the target object by the second user. The time influence factor of the object and the level influence factor of the object are calculated based on the association characteristics of the first user, the association characteristics of the second user and the evaluation characteristics of the target object. The time influence factor of the user is calculated based on the association characteristics of the first user and the association characteristics of the second user. The target user similarity between the first user and the second user in the object push scenario is calculated based on the first user similarity, the time influence factor of the object, the level influence factor of the object and the time influence factor of the user. By adopting this method, when calculating the similarity between users, the relationship between the evaluation level of the user and the evaluation level of the object can be fully considered, and by introducing the time factor of the user and the time factor of the object, a more comprehensive, objective and accurate effect of calculating the similarity between users can be achieved.
[0088] In one embodiment, the associated features of the first user include the associated users of the first user, the associated features of the second user include the associated users of the second user, and the evaluation features of the target object include the average evaluation time difference and the online time.
[0089] Accordingly, if Figure 2 As shown, the method for determining the user similarity also includes:
[0090] Step 202: extracting a set of associated users from a preset high-level user set.
[0091] The associated user set includes the associated users of the first user and the associated users of the second user. The terminal can select the k highest-ranked users based on the system's user ranking mechanism and the Pearson correlation coefficient, and then recommend potential items to the target user based on their rating information. This creates a recommendation relationship between these k similar users and the target user, meaning that the k similar users are associated users of the target user.
[0092] Specifically, according to the method provided in the above embodiment, the terminal determines the associated users of the first user and the associated users of the second user in the preset high-level user set, and forms the associated users of the first user and the associated users of the second user into an associated user set.
[0093] In one example, the preset high-level user set may include multiple users with high user levels. The terminal can distinguish the contribution of different users' evaluation information to the recommendation by adding user levels. The more experienced a user is in a certain field, the more representative the user's evaluation information will be of the majority of users. That is, the evaluation scores of most users for the object will be concentrated near the evaluation score of the user, and the user's rating information will be adopted more often when making recommendations. The terminal can determine the user level of the user by the following formula:
[0094] λ v =(E v +N v ) / (E+N),
[0095] Among them, λ v is the user level of user v, E v is the number of times that the high-quality rating of user v is adopted. The high-quality rating can mean that the error between the user rating and the actual objective rating of an object (e.g., the average of all ratings of the object) is less than μ. The value of μ is usually 0.7. The present invention can determine the value based on the actual application scenario. The present invention does not impose a specific limit on this value. N v is the number of times all ratings of user v are adopted, E is the total number of high-quality ratings made by user v, and N is the total number of ratings made by user v.
[0096] In another example, the terminal may determine the evaluation level of the object through a similar process, which will not be described in detail in the present invention.
[0097] Step 204 : obtaining a plurality of time differences according to the real time and the evaluation time of the target object by the users in the associated user set, and performing mean calculation on the plurality of time differences to obtain a mean of the evaluation time differences.
[0098] Specifically, the real-time time represents the real-time time of the current system, and the mean time difference of the target object's evaluation represents the average time difference of the evaluations of the target object by the users in the associated user set. In this way, the terminal can determine the mean time difference of the evaluations of the target object based on the real-time time T and the multiple evaluation times of the target object by the users in the associated user set. Specifically, the mean time difference of the evaluations of the target object can be determined by the following formula:
[0099]
[0100] Among them, V ij Indicates the associated user set. It represents the evaluation time of the target object h by user v in the associated user set.
[0101] Step 206 : Determine the time impact factor of the object based on the mean evaluation time difference, online time, and real-time time of the target object.
[0102] Among them, the time influence factor of the object represents the influence of the time factor of the target object on the user similarity.
[0103] Specifically, the terminal can use the real-time time T, the target object's online time t h And the mean time difference of the target object's evaluation Determine the time impact factor of the object.
[0104] In one example, the specific execution process of step 206, determining the time impact factor of the object based on the average evaluation time difference, online time, and real time of the target object, may include:
[0105] Determine the time difference between the real-time time and the online time, and sum the time difference and the average of the evaluation time differences of the target object to obtain the combined time; perform inverse number processing on the combined time to obtain the inverse time, and perform logarithmic processing on the inverse time to obtain the time impact factor of the object.
[0106] Specifically, the terminal can determine the time impact factor p1 of the object by the following formula:
[0107]
[0108] Among them, e represents logarithmic operation.
[0109] In an example, the terminal may determine the time impact factor p1 of the object using the following formula:
[0110]
[0111] In this embodiment, by introducing the listing time of the object and the average evaluation time difference determined by the evaluation time of the target object by each user in the recommended user set, the degree of influence of the object's time factor on the user similarity can be determined, that is, the object's time influence factor, which can ensure that the object is currently popular. By introducing the listing time, all new objects can get more recommendation opportunities, and the determined user similarity can also be made more accurate.
[0112] In one embodiment, the associated features of the first user include objects evaluated by the first user, the associated features of the second user include objects evaluated by the second user, and the evaluation features of the target object include the evaluation level of the target object.
[0113] Accordingly, if Figure 3As shown, the method for determining the user similarity also includes:
[0114] Step 302 : Determine a first object and an evaluation level of the first object based on the object evaluated by the first user and the object evaluated by the second user.
[0115] The first object is an object that has been evaluated by both the first user and the second user.
[0116] Specifically, the terminal may filter objects evaluated by the first user and objects evaluated by the second user to obtain objects evaluated by both the first user and the second user. The terminal may use the filtered objects as the first object and obtain the first user's evaluation level. The evaluation level of the first object may be obtained by averaging the evaluation scores of multiple users on the first object.
[0117] Step 304 : Taking the ratio of the sum of the evaluation grades of the plurality of first objects to the evaluation grade of the target object as the grade influencing factor of the object.
[0118] Specifically, the terminal may calculate the sum of the evaluation levels of each first object ∑μ k , the terminal can determine the evaluation level μ of the target object h and the sum of the evaluation levels of each first object ∑μ k The ratio of , and the level impact factor p2 of the object is determined based on the ratio:
[0119]
[0120] Among them, the set U i ∪U j represents the set of objects evaluated by both the first user i and the second user j.
[0121] In this embodiment, by introducing the evaluation level factor of the object, the user similarity can be determined more comprehensively and accurately.
[0122] In one embodiment, the associated features of the first user include associated users of the first user, and the associated features of the second user include associated users of the second user.
[0123] Accordingly, if Figure 4 As shown, the method for determining the user similarity also includes:
[0124] Step 402 : determining a first difference in the evaluation interest between a first user and a user associated with the first user over time, and a second difference in the evaluation interest between a second user and a user associated with the second user over time.
[0125] Specifically, the terminal can determine a first difference a1 between the evaluation interest of the first user and the first user's associated users and a second difference a2 between the evaluation interest of the second user and the second user's associated users over time based on the association characteristics of the first user and the second user.
[0126] Specifically, the terminal may determine the first difference a1 by the following formula:
[0127]
[0128] in, The time representation of the first user's current interest, that is, the average of the evaluation time of all objects evaluated by the first user, The time representation of the current interest of the users associated with the first user is the average of the evaluation times of all objects evaluated by the users associated with the first user.
[0129] Specifically, the terminal may determine the second difference a2 by the following formula:
[0130]
[0131] in, The time representation of the second user's current interest, that is, the average of the evaluation time of all objects evaluated by the second user, The time representation of the current interest of the second user's associated users is the average of the evaluation times of all objects evaluated by the second user's associated users.
[0132] Step 404 : summing the first difference, the second difference, and a preset target value to determine the time impact factor of the user.
[0133] Specifically, the terminal can determine the user's time impact factor p3 by the following formula:
[0134]
[0135] The preset target value may be 1 or other values, which is not limited in the present invention.
[0136] In this embodiment, by introducing the user's time factor, the weight of the user's time influence factor can be dynamically adjusted according to the size of the first difference and the second difference. In this way, when the first difference and the second difference are small, that is, when the evaluation interest time point of the first user i is within the time range of the current interest of the first user's associated users, the first user's evaluation interest can be very close to the current mainstream trend (the evaluation interest of authoritative users with high user levels). Users who are kept within the time range of the current mainstream trend can obtain greater weight in the similarity determination, thereby enhancing the effectiveness of the final user similarity.
[0137] In one embodiment, Figure 5 As shown, the method for determining the user similarity also includes:
[0138] Step 502: Obtain a first evaluation time of a second object by a first user.
[0139] The second object is an object evaluated by the first user.
[0140] Specifically, the terminal may obtain the first evaluation time of all objects evaluated by the first user.
[0141] Step 504 : Calculate the average of the multiple first evaluation times to obtain a first evaluation time average, and use the first evaluation time average as the first evaluation interest level of the first user in the time dimension.
[0142] Specifically, the terminal can determine the average of multiple first evaluation times to obtain the average of the first evaluation time. In this way, the terminal can average the first evaluation time The first evaluation interest level of the first user in the time dimension.
[0143] Step 506: The ratio of each first evaluation time to the object set consisting of the second objects is used as the second evaluation interest of the associated users of the first user in the time dimension.
[0144] Specifically, the terminal may obtain the first evaluation time of all objects evaluated by the first user, and determine the second evaluation interest of the first user's associated users in the time dimension based on the ratio of each first evaluation time to the object set consisting of the second objects.
[0145] In one example, the terminal may determine the second evaluation interest of the associated users of the first user in the time dimension using the following formula:
[0146]
[0147] in, represents the first evaluation time of the first object, U i Represents the object set consisting of all objects evaluated by the first user.
[0148] Step 508 : determining the interest difference between the first evaluation interest and the second evaluation interest, performing a logarithmic operation on the interest difference, and obtaining a first difference in the evaluation interest of the first user and the first user's associated users over time.
[0149] Specifically, the terminal can determine the absolute value of the difference between the first evaluation interest and the second evaluation interest, and determine the reciprocal of the absolute value. In this way, the terminal can perform a logarithmic operation with base e on the reciprocal to obtain a first difference in the evaluation interest of the first user and the first user's associated users over time. Specifically, a1 can be determined by the following formula:
[0150]
[0151] In one embodiment, Figure 6 As shown, the specific processing process of the step of "determining the target user similarity between the first user and the second user in the object push scenario based on the first user similarity, the time influence factor of the object, the level influence factor of the object, and the time influence factor of the user" includes:
[0152] Step 602: The product of the first user similarity, the time influence factor of the object, the level influence factor of the object, and the time influence factor of the user is used as the initial similarity between the first user and the second user.
[0153] Step 604: normalize the initial similarity to obtain the target user similarity.
[0154] In this embodiment, by normalizing the determined initial similarity, data of different scales and dimensions can be processed and scaled to the same data interval and range, thereby reducing the impact of scale, feature, and distribution differences on the model.
[0155] In one example, the method further includes:
[0156] When the target user similarity between the first user and the second user is greater than a preset similarity threshold, the second user is taken as the target second user, and the preference object set of the target second user is obtained; and the preference object set of the target second user is pushed to the first user.
[0157] Specifically, the terminal compares the target user similarity between the determined first user and the second user in the object push scenario with a preset similarity threshold to obtain a comparison result. When the target user similarity is greater than or equal to the preset similarity threshold, the terminal can determine that the second user is a user similar to the first user in the object push scenario, that is, the second user may be the target second user. In this way, the terminal can obtain the preferred object set of the target second user and push one or more objects contained in the preferred object set to the first user. In one example, the one or more objects contained in the preferred object set of the target second user may be objects for which the second user's score is greater than a preset score threshold.
[0158] In this embodiment, different objects are pushed to users according to user similarities in an object push scenario, which can achieve the effect of accurate push to users and the effect of personalized push to users.
[0159] The following is a detailed description of the above-mentioned method for determining user similarity in conjunction with a specific embodiment: Common methods such as the Pearson correlation coefficient and the cosine similarity method in the correlation method do not fully consider the relationship between the user and the object when making the determination. The user weighted Hamming distance proposed in the method for determining user similarity provided by the embodiment of the present invention not only fully considers the relationship between the user and the object, but also incorporates user time attributes, object time attributes and user level factors, greatly improving the accuracy of the final determination result.
[0160] The terminal may calculate the first user similarity between the first user and the second user based on the first score of the target object h by the first user i and the second score of the target object h by the second user j and the first relevance threshold, which may be determined by the following formula:
[0161]
[0162] Wherein, D(i, j, h) represents the similarity Hamming distance, that is, the first user similarity, and the value range of D(i, j, h) can be [0, 0.5].
[0163] In this way, the terminal can normalize the first user similarity by using a preset normalization formula to obtain the normalized first user similarity D'(i, j, h). The preset normalization formula can be:
[0164]
[0165] In this way, the terminal can substitute D(i, j, h) into v i In this way, the normalized first user similarity D'(i, j, h) is determined.
[0166] In this way, the terminal can determine the second user similarity D(h) according to the first user similarity D'(i, j, h) and the time influence factor of the object, which can be determined by the following formula:
[0167]
[0168] in, Indicates the time impact factor of the object, T represents the real time, t h Indicates the online time of the target object. Represents the mean time difference of the evaluation of the target object.
[0169] In this embodiment, if A small value indicates that the evaluation time of the object is near the current time period, that is, the object has been frequently used and evaluated by users recently, thus ensuring that the object is currently popular. At the same time, Tt h The smaller the value, the later the object was put on the shelf, so that all new product objects can get more recommendation opportunities.
[0170] In this way, the terminal can normalize the second user similarity D(h) by using a preset normalization formula to obtain the normalized first user similarity D'(h). The terminal can obtain the normalized first user similarity D'(h) by substituting D(h) into v i In this way, the normalized first user similarity D'(h) is determined.
[0171] The method for determining user similarity provided in the embodiment of the present invention can also fully consider the relationship between the user and the project and introduce the evaluation level factor of the project. The terminal can determine the third user similarity sim(i, j) based on the second user similarity and the evaluation level factor of the object:
[0172]
[0173] Among them, ∑μ k represents the sum of the evaluation levels of the first objects, μ h Represents the evaluation level of the target object, set U i ∪U j represents a set of objects evaluated by the first user i and the second user j at the same time, and the first object represents the object evaluated by the first user i.
[0174] In an example, the terminal may also determine the fourth user similarity R according to the user's time influence factor and the third user similarity sim(i, j). ij , which can be determined by the following formula:
[0175]
[0176] in, represents the user's time impact factor, A first difference in the evaluation interest of the first user and the first user's associated users over time, A second difference degree representing changes in evaluation interest between the second user and the second user's associated users over time, The time representation of the first user's current interest, that is, the average of the evaluation time of all objects evaluated by the first user, A time representation of the current interest of the first user's associated users, that is, the average of the evaluation times of all objects evaluated by the first user's associated users; The time representation of the second user's current interest, that is, the average of the evaluation time of all objects evaluated by the second user, The time representation of the current interest of the second user's associated users is the average of the evaluation times of all objects evaluated by the second user's associated users.
[0177] In this way, the terminal can calculate the second user similarity R by using a preset normalization formula. ij Perform normalization processing to obtain the normalized first user similarity D(i, j). The terminal can obtain the normalized first user similarity D(i, j) by converting R ij Substitute v i In this way, the fourth user similarity (i, j) after normalization is determined, that is, the target user similarity is obtained.
[0178] In one example, the terminal may use the target user similarity determined between the first user and the second user as the similarity between the first user and the second user.
[0179] For example, if the target user similarity between the first user and the second user exceeds a preset similarity threshold, the terminal can recommend an object to the first user based on the second user's preferences for objects. The preset similarity threshold can be determined based on actual application scenarios and is not specifically limited in the present invention.
[0180] Hereinafter, the embodiment of the present invention may be combined with a specific embodiment to describe the effect of the method provided by the embodiment of the present invention.
[0181] The terminal can access the experimental MovieLens dataset, which contains 100,000 ratings from 943 users for 1,682 movies, with each user having rated at least 20 movies. Recommender systems are commonly evaluated based on prediction accuracy and classification accuracy. Prediction accuracy is measured using the root mean square error (RMSE) and mean absolute error (MAE). Smaller deviations indicate more accurate predictions, better recommendations, and higher quality. This article uses the MAE metric, which is formulated as follows:
[0182]
[0183] Among them, Test represents the test set Test={item1,item2,...,item n}, |Test| is the number of elements in the set, r i represents the actual score, r i p Score the predictions.
[0184] This paper compares the performance of different user similarity algorithms by changing only the user similarity algorithm in the same recommendation algorithm Slop one, while keeping other parts unchanged. The MAE is used as the evaluation standard. In view of the fact that the Pearson correlation coefficient performs better than the cosine similarity in determining user similarity, this paper selects the Pearson correlation coefficient (person), the ordinary Hamming distance (Hamming) and the weighted Hamming distance algorithm (Weighted Hamming) provided by the embodiment of the present invention for comparison. Twenty percent of the data set is used as test data and eighty percent as training data. The experimental results are shown in Figure 2. Figure 7 As shown, Figure 7 The horizontal axis represents the number of clusters, and the vertical axis represents the evaluation standard, MAE value. Figure 7 As can be seen in the figure, the MAE value decreases as the number of k-means clusters increases, reaching its lowest point when the number of clusters reaches 15, achieving the highest recommendation accuracy. As the number of clusters increases, the MAE value increases, indicating that the number of clusters has a certain impact on the accuracy of the recommendation results. Meanwhile, the differences in the MAE values of the three groups gradually decrease, and the weighted Hamming distance algorithm provided by the embodiment of the present invention has a smaller MAE value than the other two, achieving the best performance in terms of recommendation accuracy.
[0185] Since the weighted Hamming distance algorithm provided by the embodiment of the present invention determines the weights according to the user level and the project level, and the user level and the project level are dynamically updated as the user ratings are continuously cited, that is, the weighted Hamming distance will be updated with the number of user evaluations. The relevant experimental results are as follows: Figure 8 As shown, Figure 8 The horizontal axis represents the number of system operations, and the vertical axis represents the evaluation standard, MAE value. Figure 8 As can be seen from the data, as the system runs more times, the number of user evaluations increases, and user and item ratings are dynamically updated, leading to improved recommendation accuracy. After a certain number of runs, both user and service ratings become relatively stable, and recommendation accuracy reaches its maximum. Clearly, throughout this entire process, the weighted Hamming distance algorithm provided by this embodiment of the present invention achieves superior accuracy to the other two algorithms.
[0186] The weighted Hamming distance algorithm provided in the embodiment of the present invention can ensure that the relationship between user level and project level is fully considered when determining the similarity between users, and by introducing user time factors and project time factors, the similarity distance between users can be measured more comprehensively and objectively. As the number of system users increases, its accuracy increases, and the accuracy of recommendations also increases accordingly. It has very broad application prospects in personalized recommendation systems.
[0187] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0188] Based on the same inventive concept, the present application also provides a user similarity determination device 700 for implementing the user similarity determination method mentioned above. The implementation solution provided by this device is similar to the implementation solution described in the above method. Therefore, the specific limitations of one or more user similarity determination device embodiments provided below can be found in the limitations of the user similarity determination method above, and will not be repeated here.
[0189] In one embodiment, Figure 9As shown, a device 700 for determining user similarity is provided, comprising: a first determination module 701, a second determination module 702, a third determination module 703, and a fourth determination module 704, wherein:
[0190] The first determining module 701 is configured to determine a first user similarity between the first user and the second user based on a first rating of the target object by the first user and a second rating of the target object by the second user.
[0191] The second determining module 702 is configured to determine a time influence factor of the object and a level influence factor of the object according to the association characteristics of the first user, the association characteristics of the second user, and the evaluation characteristics of the target object.
[0192] The third determining module 703 is configured to determine a time influence factor of a user according to the correlation characteristics of the first user and the correlation characteristics of the second user.
[0193] The fourth determining module 704 is configured to determine the target user similarity between the first user and the second user in the object push scenario based on the first user similarity, the time influence factor of the object, the level influence factor of the object, and the time influence factor of the user.
[0194] Each module in the above-mentioned user similarity determination device can be implemented in whole or in part through software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor of the computer device in hardware form, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each of the above modules.
[0195] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 10 As shown. The computer device includes a processor, a memory, and a network interface connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store XX data. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a method for determining user similarity is implemented.
[0196] Those skilled in the art will understand that Figure 10The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0197] In one embodiment, a computer device is further provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.
[0198] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0199] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0200] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0201] It should be noted that the methods and devices of the embodiments of the present disclosure can be used in the field of big data technology, the field of financial technology or other related fields, and the methods and devices of the embodiments of the present disclosure are not limited to the fields of application.
[0202] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.
[0203] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0204] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A method for determining user similarity, characterized in that: The method comprises: determining a first user similarity between the first user and the second user based on a first rating of the target object by the first user and a second rating of the target object by the second user; determining a time impact factor of the object and a level impact factor of the object based on the association feature of the first user, the association feature of the second user, and the evaluation feature of the target object; determining a time influence factor of a user according to the correlation feature of the first user and the correlation feature of the second user; determining a target user similarity between the first user and the second user in an object push scenario based on the first user similarity, the time influence factor of the object, the level influence factor of the object, and the time influence factor of the user; The associated features of the first user include associated users of the first user, the associated features of the second user include associated users of the second user, the evaluation features of the target object include an average of evaluation time differences and online time, and the method further includes: Extracting an associated user set from a preset high-level user set, where the associated user set includes associated users of the first user and associated users of the second user; Obtaining multiple time differences based on the real time and the evaluation time of the target object by users in the associated user set, and calculating the mean of the multiple time differences to obtain the mean of the evaluation time differences; The time influence factor of the object is determined according to the average time difference of the evaluation of the target object, the online time and the real time. The time influence factor of the object represents the degree of influence of the time factor of the target object on the user similarity.
2. The method according to claim 1, characterized in that The determining of the time impact factor of the object according to the mean time difference of the evaluation of the target object, the online time, and the real time includes: Determine a time difference between the real time and the online time, and sum the time difference with an average of the evaluation time differences of the target object to obtain a combined time; Performing inverse number processing on the combined time to obtain inverse time, and performing logarithmic processing on the inverse time to obtain the time impact factor of the object.
3. The method according to claim 1, characterized in that The associated features of the first user include objects evaluated by the first user, the associated features of the second user include objects evaluated by the second user, and the evaluation features of the target object include an evaluation level of the target object; The method further comprises: determining, based on an object evaluated by the first user and an object evaluated by the second user, an evaluation level of a first object and the first object, wherein the first object is an object evaluated by both the first user and the second user; The ratio of the sum of the evaluation levels of the plurality of first objects to the evaluation level of the target object is used as the level impact factor of the object.
4. The method according to claim 1, wherein The associated features of the first user include associated users of the first user, and the associated features of the second user include associated users of the second user; the method further includes: Determining a first difference between the evaluation interest of the first user and the users associated with the first user over time, and a second difference between the evaluation interest of the second user and the users associated with the second user over time; The first difference, the second difference, and a preset target value are summed to determine the time impact factor of the user.
5. The method according to claim 4, characterized in that The method further comprises: Obtaining a first evaluation time of a second object by the first user, where the second object is an object evaluated by the first user; Calculating the average of the plurality of first evaluation times to obtain a first evaluation time average, and using the first evaluation time average as the first evaluation interest level of the first user in the time dimension; The ratio of each first evaluation time to the object set consisting of the second objects is used as the second evaluation interest of the associated users of the first user in the time dimension; An interest difference between the first evaluation interest and the second evaluation interest is determined, and a logarithmic operation is performed on the interest difference to obtain a first difference in the evaluation interest of the first user and a user associated with the first user over time.
6. The method according to any one of claims 1 to 5, characterized in that The determining, based on the first user similarity, the time influence factor of the object, the level influence factor of the object, and the time influence factor of the user, a target user similarity between the first user and the second user in the object push scenario includes: The product of the first user similarity, the time influence factor of the object, the level influence factor of the object, and the time influence factor of the user is used as the initial similarity between the first user and the second user; The initial similarity is normalized to obtain the target user similarity.
7. The method according to any one of claims 1 to 5, characterized in that The method further comprises: When the target user similarity between the first user and the second user is greater than a preset similarity threshold, the second user is used as the target second user; Obtaining a preference object set of the target second user; The preference object set of the target second user is pushed to the first user.
8. A device for determining user similarity, characterized in that: For implementing the method according to claim 1, the apparatus comprises: a first determining module, configured to determine a first user similarity between the first user and the second user based on a first rating of the target object by the first user and a second rating of the target object by the second user; a second determining module, configured to determine a time impact factor of an object and a level impact factor of an object based on the association characteristics of the first user, the association characteristics of the second user, and the evaluation characteristics of the target object; a third determining module, configured to determine a user's time influence factor based on the association characteristics of the first user and the association characteristics of the second user; The fourth determining module is configured to determine the target user similarity between the first user and the second user in the object push scenario based on the first user similarity, the time influence factor of the object, the level influence factor of the object, and the time influence factor of the user.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
11. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Object recommendation method and device
CN111310046A
Project recommendation method and device, electronic equipment and computer storage medium
CN113806636A