A friend recommendation method, device, electronic device and storage medium
By constructing an emotional identity matrix and calculating user emotional identity values, recommending friends with the same emotional tendencies, solving the problem of low efficiency and accuracy of friend recommendation in the existing technology, improving user stickiness and the activity of social networks.
Patent Information
- Application Number
- CN202010797467.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-10
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2040-08-10
AI Technical Summary
The efficiency and accuracy of friend recommendation methods in existing social networks are low, resulting in a decrease in user stickiness.
By obtaining the user's user identity, building an emotional identity matrix, calculating the emotional identity value between users, and recommending friends with the same emotional tendencies.
It improves the accuracy and user stickiness of friend recommendations, recommends friends with common interests, and enhances the activity of social networks.
Smart Images

Figure CN112084420B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and in particular to a friend recommendation method, device, electronic device and storage medium. Background Art
[0002] The world is gradually entering the era of social networks, and some representative social networking sites have become information platforms with great influence. They combine user groups and information, allowing users to easily share and obtain information, while also greatly expanding users' social groups. However, with the rapid increase in social network users, the amount of information in social networks has increased dramatically. For social network users, how to find suitable friends in this huge amount of data and expand their social network friend circle has become a difficult problem.
[0003] In order to solve the problem of large amount of information in social networks and difficulty in finding friends, recommendation and search have become the focus of people's attention. Users use the friend search function to find friends to expand their social circle. In the related technology, users with high activity in the same object category as the user are generally recommended. According to the object category that the user is following, those users with high activity in the object category are recommended. However, this search wastes a lot of time, is inefficient and has low accuracy. Moreover, the above method only roughly considers the dimension of interest in the same object category, and does not consider the emotional differences between users who add friends. If the two have a large difference in thinking mode, then the user is likely to be uninterested in the content posted by his friends in the future. Moreover, if friends are recommended to users only based on activity, the chances of those less active users being exposed to alternative users will be reduced, which will reduce the user's stickiness in the long run. Summary of the invention
[0004] The embodiments of the present invention provide a friend recommendation method, device, electronic device and storage medium to solve the problem that the existing friend recommendation method has low efficiency and accuracy and is prone to reduce user stickiness.
[0005] In order to solve the above-mentioned technical problems, the present invention is achieved as follows:
[0006] In a first aspect, an embodiment of the present invention provides a friend recommendation method, comprising:
[0007] Get the user ID of the target user;
[0008] Acquire the user identifier and the emotion identification value of each candidate user from an emotion identification matrix, wherein the emotion identification matrix includes the emotion identification value between any two users;
[0009] Obtaining N candidate users with the highest emotional identification values with the user identifier as recommended friends of the target user;
[0010] Among them, the sentiment identification value is obtained based on the sentiment tendency of the comments published by any two users on each target object they have commented on together, and / or the sentiment tendency of each comment content under each target object category they have commented on together, and the sentiment tendency is obtained by performing text sentiment analysis on the comment content; N is a positive integer, and the alternative users are users other than the target users.
[0011] Optionally, before the step of acquiring the user identifier and the emotion identification value of each candidate user from the emotion identification matrix, the step further includes:
[0012] For any candidate user, obtain each target object that the candidate user and the target user have jointly commented on, and each target object category that the candidate user and the target user have jointly commented on;
[0013] For each of the target objects, based on the comments posted by the candidate users and the target users on the target object, respectively obtain the emotional tendency of the candidate users towards the target object and the emotional tendency of the target user towards the target object;
[0014] For each of the target object categories, based on the comments posted by the candidate users and the target user under the target object category, respectively obtain the sentiment tendency of each comment content of the candidate users under the target object category and the sentiment tendency of each comment content of the target user under the target object category;
[0015] According to the emotional tendency, the emotional identification values of the target user and the candidate users are obtained.
[0016] Optionally, the step of obtaining the emotional identification value of the target user and the candidate user according to the emotional tendency includes:
[0017] According to the emotional tendency of the candidate user with respect to the target object and the emotional tendency of the target user with respect to the target object, obtaining the emotional tendency value between the candidate user and the target user with respect to the target object;
[0018] According to the sentiment tendency of each comment content of the candidate user under the target object category and the sentiment tendency of each comment content of the target user under the target object category, the positive evaluation rate deviation of the candidate user and the target user under all object categories that have been reviewed together is obtained;
[0019] The emotional identification values of the target user and the candidate users are obtained according to the emotional tendency value and the positive evaluation rate deviation.
[0020] Optionally, the step of obtaining the deviation of the positive evaluation rate of the candidate user and the target user in all object categories that have been reviewed together according to the sentiment tendency of each comment content of the candidate user under the target object category and the sentiment tendency of each comment content of the target user under the target object category comprises:
[0021] According to the sentiment tendency of each comment content of the candidate user under the target object category and the number of comments made by the candidate user under the target object category, obtaining a first positive evaluation rate of the candidate user under the target object category;
[0022] According to the sentiment tendency of each comment content of the target user under the target object category and the number of comments made by the target user under the target object category, obtaining a second positive evaluation rate of the target user under the target object category;
[0023] According to the first positive evaluation rate of the candidate user in each target object category and the second positive evaluation rate of the target user in each target object category, the positive evaluation rate deviation of the target user and the candidate user in all object categories reviewed together is obtained.
[0024] Optionally, the step of acquiring the emotional tendency value between the candidate user and the target user with respect to the target object according to the emotional tendency of the candidate user with respect to the target object and the emotional tendency of the target user with respect to the target object comprises:
[0025] If the candidate user's emotional tendency toward the target object is the same as the target user's emotional tendency toward the target object, confirming that the emotional tendency value between the candidate user and the target user toward the target object is a first preset value;
[0026] If the emotional tendency of the candidate user with respect to the target object is different from the emotional tendency of the target user with respect to the target object, it is confirmed that the emotional tendency value between the candidate user and the target user with respect to the target object is a second preset value.
[0027] Optionally, the step of respectively acquiring, for each of the target objects, the emotional tendency of the candidate users toward the target object and the emotional tendency of the target user toward the target object according to the comments posted by the candidate users and the target user toward the target object, comprises:
[0028] Performing word segmentation processing on the comment content to obtain a word segmentation list of the comment content;
[0029] According to the word segmentation list, obtaining the sentiment score of the comment content;
[0030] In response to the sentiment score being a positive value, determining that the sentiment tendency of the comment content is positive;
[0031] In response to the sentiment score being a negative value, it is determined that the sentiment tendency of the comment content is negative.
[0032] Optionally, the step of obtaining the sentiment score of the comment content according to the word segmentation list includes:
[0033] Filter out negative words in the word list, and select target word in the filtered word list, wherein the target word includes at least one of sentiment word, stop word, and adverb;
[0034] According to the target segmentation, the sentiment score of the comment content is obtained.
[0035] In a second aspect, an embodiment of the present invention provides a friend recommendation device, including:
[0036] A user information acquisition module, used to obtain the user ID of the target user;
[0037] An emotion identification value search module, used to obtain the emotion identification value of the user identifier and each candidate user from an emotion identification matrix, wherein the emotion identification matrix includes the emotion identification value between any two users;
[0038] A friend recommendation module is used to obtain N candidate users with the highest emotional identification values with the user identifier as recommended friends of the target user;
[0039] Among them, the sentiment identification value is obtained based on the sentiment tendency of the comments published by any two users on each target object they have commented on together, and / or the sentiment tendency of each comment content under each target object category they have commented on together, and the sentiment tendency is obtained by performing text sentiment analysis on the comment content; N is a positive integer, and the alternative users are users other than the target users.
[0040] Optionally, the device further comprises:
[0041] A basic data acquisition module, used for acquiring, for any candidate user, each target object that the candidate user and the target user have jointly commented on, and each target object category that the candidate user and the target user have jointly commented on;
[0042] A first sentiment tendency acquisition module is used to acquire, for each target object, the sentiment tendency of the candidate user with respect to the target object and the sentiment tendency of the target user with respect to the target object according to the comments posted by the candidate user and the target user with respect to the target object;
[0043] A second sentiment tendency acquisition module is used to acquire, for each target object category, the sentiment tendency of each comment content of the candidate user under the target object category and the sentiment tendency of each comment content of the target user under the target object category according to the comment content published by the candidate user and the target user under the target object category;
[0044] The emotion identification value acquisition module is used to acquire the emotion identification values of the target user and the candidate users according to the emotion tendency.
[0045] Optionally, the emotion identification value acquisition module includes:
[0046] The emotional tendency value acquisition submodule is used to acquire the emotional tendency value between the candidate user and the target user with respect to the target object according to the emotional tendency of the candidate user with respect to the target object and the emotional tendency of the target user with respect to the target object;
[0047] A positive evaluation rate deviation acquisition submodule is used to acquire the positive evaluation rate deviation of the candidate user and the target user in all object categories that have been reviewed together, based on the sentiment tendency of each comment content of the candidate user under the target object category and the sentiment tendency of each comment content of the target user under the target object category;
[0048] The emotion identification value acquisition submodule is used to acquire the emotion identification value of the target user and the candidate user according to the emotion tendency value and the positive evaluation rate deviation.
[0049] Optionally, the positive evaluation rate deviation acquisition submodule includes:
[0050] A first positive evaluation rate acquisition unit, configured to acquire a first positive evaluation rate of the candidate user under the target object category according to the sentiment tendency of each comment content of the candidate user under the target object category and the number of comments made by the candidate user under the target object category;
[0051] A second positive evaluation rate acquisition unit, configured to acquire a second positive evaluation rate of the target user under the target object category according to the sentiment tendency of each comment content of the target user under the target object category and the number of comments made by the target user under the target object category;
[0052] A positive evaluation rate deviation acquisition unit is used to obtain the positive evaluation rate deviation of the target user and the alternative user in all object categories that have been reviewed together based on the first positive evaluation rate of the alternative user in each target object category and the second positive evaluation rate of the target user in each target object category.
[0053] Optionally, the sentiment tendency value acquisition submodule is specifically used to:
[0054] If the candidate user's emotional tendency toward the target object is the same as the target user's emotional tendency toward the target object, confirming that the emotional tendency value between the candidate user and the target user toward the target object is a first preset value;
[0055] If the emotional tendency of the candidate user with respect to the target object is different from the emotional tendency of the target user with respect to the target object, it is confirmed that the emotional tendency value between the candidate user and the target user with respect to the target object is a second preset value.
[0056] Optionally, the first emotion tendency acquisition module includes:
[0057] A word segmentation processing submodule, used to perform word segmentation processing on the comment content to obtain a word segmentation list of the comment content;
[0058] A sentiment score acquisition submodule, used to acquire the sentiment score of the comment content according to the word segmentation list;
[0059] A first sentiment tendency confirmation submodule, configured to determine that the sentiment tendency of the comment content is positive in response to the sentiment score being a positive value;
[0060] The second sentiment tendency confirmation submodule is used to determine that the sentiment tendency of the comment content is negative in response to the sentiment score being a negative value.
[0061] Optionally, the sentiment score acquisition submodule is specifically used to:
[0062] Filter out negative words in the word list, and select target word in the filtered word list, wherein the target word includes at least one of sentiment word, stop word, and adverb;
[0063] According to the target segmentation, the sentiment score of the comment content is obtained.
[0064] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the friend recommendation method described in the first aspect.
[0065] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the friend recommendation method described in the first aspect are implemented.
[0066] In an embodiment of the present invention, the sentiment tendency of user comments is obtained based on text sentiment analysis, the sentiment tendency of other replying users under the same post is calculated, and / or the sentiment tendency of each comment content under each target object category commented by the two users is calculated, so as to reflect the overall similarity of the evaluation between the two users, and finally the sentiment identification value between the two users is calculated, and a sentiment identification matrix between every two users is gradually formed in the traversal process, and finally the top N candidate users are sorted according to the sentiment identification values corresponding to the target users in the sentiment identification matrix to be recommended as friends of the corresponding users, so that the user's emotional cognition is combined in the recommendation process to recommend more accurate friends with common interests to the user, thereby increasing user stickiness.
[0067] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0069] Figure 1 is a flowchart of the steps of a friend recommendation method in an embodiment of the present invention;
[0070] Figure 2 is a flowchart of another method for recommending friends in an embodiment of the present invention;
[0071] Figure 3 Schematic diagram of a specific process of text sentiment analysis in an embodiment of the present invention;
[0072] Figure 4 is a structural schematic diagram of a friend recommendation device in an embodiment of the present invention;
[0073] Figure 5 is a structural schematic diagram of another friend recommendation device in an embodiment of the present invention;
[0074] Figure 6 It is a schematic diagram of the hardware structure of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0075] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0076] Reference Figure 1 , shows a step flow chart of a friend recommendation method in an embodiment of the present invention.
[0077] Step 110: Obtain the user ID of the target user.
[0078] Step 120: Obtain the user identifier and the emotion identification value of each candidate user from the emotion identification matrix, wherein the emotion identification matrix includes the emotion identification value between any two users.
[0079] Step 130, obtaining N candidate users with the highest sentiment identification values with the user identifier as recommended friends of the target user; wherein the sentiment identification value is obtained based on the sentiment tendency of the comments published by any two users on each target object they have commented on together, and / or the sentiment tendency of each comment content under each target object category commented on by the two users together, and the sentiment tendency is obtained by performing text sentiment analysis on the comment content; N is a positive integer, and the candidate users are users other than the target user.
[0080] In the embodiment of the present invention, it is avoided that the two people who establish a friendship have a large difference in thinking mode, then the user is likely to be uninterested in the content posted by his friend in the future, thus forming problems such as "zombie fans". Therefore, considering the emotional differences between users who establish friendships, for the friends they want to add, the user prefers to find those who have the same emotional tendencies or common values. In this way, the recommended friends mined can attract more users to add them and enhance future interactions.
[0081] In the embodiment of the present invention, based on analyzing the sentiment tendency of the comments posted by users for each object, a sentiment identification matrix between other users who reply to the same object is established, so as to calculate a relatively accurate set of friend recommendations for the user. The sentiment identification matrix can include the sentiment identification value between any two users.
[0082] Moreover, in order to characterize the emotional differences between different users, and to recommend users with the same emotional tendency or common values as friends to the target user, the emotional identification value can be obtained based on the emotional tendency of the comments published by any two users for each target object that has been commented on together, and the emotional tendency of each comment content under each target object category that the two users have commented on together, to characterize the emotional similarity between the two users, so as to construct an emotional identification matrix based on the emotional identification value between any two users. Among them, the corresponding relationship between the emotional identification value and the emotional tendency of the comments published by any two users for each target object that has been commented on together, and the emotional tendency of each comment content under each target object category that the two users have commented on together can be customized according to the needs, and this embodiment of the present invention is not limited to this. The target object can be any object that has been commented on by the two users, and the target object category can also be any object category that has been commented on by the two users, and the object category can include at least one object.
[0083] For example, the emotional identification value between any two users can be set to the emotional tendency of the comments published by the corresponding two users for each target object they have commented on together, and the weighted emotional tendency of each comment content under each target object category commented on by the corresponding two users, wherein the weight of each emotional tendency can be customized according to the needs, and this embodiment of the present invention is not limited to this. Alternatively, it can also be set that for any two users, if the emotional tendency of the comments published by the two users under a target object they have commented on together is the same, then the emotional identification value between the corresponding two users can be added to the first value, and / or if the emotional tendency of the comments content exceeding a preset ratio under any target object category commented on by the two users is the same, then the emotional identification value between the corresponding two users can be added to the second value; and so on. The first value, the second value and the preset ratio can all be customized according to the needs, and this embodiment of the present invention is not limited to this.
[0084] Moreover, in the embodiment of the present invention, text sentiment analysis can be performed on the comment content in any available manner to obtain the sentiment tendency of each comment content, which is not limited in the embodiment of the present invention.
[0085] Then, when recommending friends for the target user, the user ID of the target user can be obtained, and then the emotional identification value of the user ID and each candidate user can be obtained from the current emotional identification matrix, the emotional identification matrix includes the emotional identification value between any two users, and then the N candidate users with the highest emotional identification value with the user ID can be obtained as the recommended friends of the target user. The candidate users can be each other user in the user set except the target user, or they can be a part of the users screened in advance from each other user in the user set except the target user, which is not limited in the embodiment of the present invention.
[0086] It should be noted that the objects and object categories can be customized according to specific application scenarios, which are not limited by the embodiments of the present invention. For example, in application scenarios such as forums and social networking sites, the objects can be posts posted by users, and the object categories can be topic categories; in shopping websites, the objects can be commodities, and the object categories can be commodity categories, and so on. Among them, topic classification refers to a specific category to which a topic belongs, such as the common categories in news: society, entertainment, sports, military, etc. Different businesses can be divided more finely, which are not limited by the embodiments of the present invention.
[0087] Text sentiment analysis is an application of natural language processing (NLP) methods, which refers to the process of analyzing, processing, summarizing and reasoning subjective texts with emotional colors. Sentiment tendency analysis is a type of sentiment analysis, which refers to judging the text as positive, negative or neutral.
[0088] Reference Figure 2 In the embodiment of the present invention, before step 120, the following steps may be further included:
[0089] Step S1, for any candidate user, obtaining each target object that the candidate user and the target user have jointly commented on, and each target object category that the candidate user and the target user have jointly commented on;
[0090] Step S2, for each of the target objects, respectively obtaining the emotional tendency of the candidate user towards the target object and the emotional tendency of the target user towards the target object according to the comments posted by the candidate user and the target user on the target object;
[0091] Step S3, for each of the target object categories, based on the comments posted by the candidate users and the target user under the target object category, respectively obtaining the sentiment tendency of each comment content of the candidate users under the target object category and the sentiment tendency of each comment content of the target user under the target object category;
[0092] Step S4, obtaining the emotional identification values of the target user and the candidate users according to the emotional tendency.
[0093] In an embodiment of the present invention, in order to set the emotional identification value between the target user and each alternative user in the above-mentioned emotional identification matrix. Then, for any alternative user, each target object that the alternative user and the target user have jointly commented on, and each target object category that the alternative user and the target user have jointly commented on can be obtained. Among them, the target object category that the alternative user and the target user have jointly commented on can be understood as there is at least one object in the target object category that has been commented on by the alternative user, and there is at least one object that has been commented on by the target user, and the object commented on by the target user and the object commented on by the alternative user may not be the same object. Of course, in an embodiment of the present invention, according to needs, the target object category that the alternative user and the target user have jointly commented on can also be set to be at least one object in the target object category that has been commented on by the alternative user and the target user, and this embodiment of the present invention is not limited to this.
[0094] Furthermore, for each of the target objects, the emotional tendency of the alternative user towards the target object and the emotional tendency of the target user towards the target object can be obtained respectively according to the comments posted by the alternative user and the target user on the target object; and for each target object category, the emotional tendency of each comment content of the alternative user under the target object category and the emotional tendency of each comment content of the target user under the target object category can be obtained respectively according to the comments posted by the alternative user and the target user under the target object category. After obtaining the above emotional tendencies, the emotional identification values of the target user and the alternative user can be obtained according to the emotional tendencies.
[0095] For example, assuming that the target user is user A and the alternative user is user B, then for any target object a jointly evaluated by user A and user B, the sentiment tendency of user A towards target object a can be obtained based on the comment content published by user A on target object a, that is, the sentiment tendency of the comment content published by user A on target object a. At the same time, based on the comment content published by user B on target object a, the sentiment tendency of user B towards target object a can be obtained, that is, the sentiment tendency of the comment content published by user B on target object a. Correspondingly, for any target object category b jointly evaluated by user A and user B, the sentiment tendency of the corresponding comment content can be obtained based on any comment content published by user A under target object category b, and the sentiment tendency of the corresponding comment content can be obtained based on any comment content published by user B under target object category b.
[0096] Moreover, when obtaining the emotional tendencies of the candidate users towards the target object and the emotional tendencies of the target users towards the target object, since the same user may post comments multiple times under the same object, each comment content can be integrated into a whole for text sentiment analysis to obtain the emotional tendencies of the corresponding users towards the corresponding object. Alternatively, text sentiment analysis can be performed on each comment content separately to obtain the emotional tendencies of each comment content separately, and then based on the emotional tendencies of each comment content (for example, weighted summation of the emotional tendencies of each comment content, etc.), the emotional tendencies of the corresponding users towards the corresponding object are obtained. This embodiment of the present invention is not limited to this.
[0097] In addition, in actual applications, different users can publish new objects at any time, or comment on published objects. That is, for any two users, the objects they have commented on together, and the categories of objects they have commented on together can change over time, so the emotional identification value between the two users may also change. Therefore, in an embodiment of the present invention, the emotional identification value between any two users in the emotional identification matrix can be periodically updated, and the update period can be customized according to needs, which is not limited by the embodiment of the present invention.
[0098] Moreover, in the embodiment of the present invention, if the above steps S1-S4 are executed for any two users each time to periodically update the emotional identification value between any two users, the workload is large and it is easy to cause slow updates. Therefore, in order to be able to update the emotional identification value in a timely manner, the comment dynamics of each user can also be detected. When it is detected that a user has posted a comment under a certain object, the text sentiment analysis of the comment content can be performed to obtain the user's emotional tendency towards the object, and the replies of other users under the object can be traversed to obtain the emotional tendency of other replying users towards the object. Then, for each replying user, all object categories that have been jointly evaluated by the replying user and the corresponding user are retrieved. , calculate the sentiment tendency of each comment content of the two users under each jointly evaluated object category, and then based on the sentiment tendency obtained at this time, calculate the sentiment identification value generated by the two users for the corresponding object, and further update the sentiment identification value between the two corresponding users in the sentiment identification matrix based on the currently obtained sentiment identification value. Specifically, the sentiment identification value between the two corresponding users in the sentiment identification matrix can be added with the currently calculated sentiment identification value generated by the two users for the corresponding object of the latest comment, as the updated sentiment identification value between the two corresponding users, which can effectively improve the updating efficiency of the sentiment identification value while ensuring accuracy.
[0099] Alternatively, it is also possible to periodically detect whether each user has posted a comment under a certain object in the current detection cycle. If so, at the end of the current detection cycle, for each object on which the user has posted a comment in the current detection cycle, it is possible to traverse the replies of other users under the object to obtain the emotional tendencies of other replying users towards the object, and then for each replying user, take out all the object categories that have been jointly evaluated by the replying user and the corresponding user, and calculate the emotional tendencies of each comment content of the two users under each jointly evaluated object category, and then based on the emotional tendencies obtained at this time, calculate the emotional identification value generated by the two users for the corresponding object, and further based on the emotional identification value obtained in the current detection cycle, update the emotional identification value between the corresponding two users in the emotional identification matrix. Specifically, the emotional identification value between the corresponding two users in the emotional identification matrix can be added with the emotional identification value currently calculated for the corresponding object commented on by the two users in the current detection cycle, as the updated emotional identification value between the corresponding two users; and so on.
[0100] Optionally, in the embodiment of the present invention, step S4 may further include:
[0101] S41, acquiring an emotional tendency value between the candidate user and the target user with respect to the target object according to the emotional tendency of the candidate user with respect to the target object and the emotional tendency of the target user with respect to the target object;
[0102] S42, obtaining the positive evaluation rate deviation of the candidate user and the target user in all object categories that have been reviewed together, based on the sentiment tendency of each comment content of the candidate user under the target object category and the sentiment tendency of each comment content of the target user under the target object category;
[0103] S43, acquiring the emotional identification value of the target user and the candidate user according to the emotional tendency value and the positive evaluation rate deviation.
[0104] In an embodiment of the present invention, in order to combine the emotional tendency of the candidate user for the target object, the emotional tendency of the target user for the target object, the emotional tendency of each comment content of the candidate user under the target object category, and the emotional tendency of each comment content of the target user under the target object category, so as to obtain the emotional identification value of the target user and the candidate user, so as to improve the accuracy of the emotional identification value. Then, according to the emotional tendency of the candidate user for the target object and the emotional tendency of the target user for the target object, the emotional tendency value between the candidate user and the target user for the target object can be obtained; and / or, according to the emotional tendency of each comment content of the candidate user under the target object category and the emotional tendency of each comment content of the target user under the target object category, the positive evaluation rate deviation of the candidate user and the target user in all object categories that have been reviewed together is obtained. The positive evaluation rate deviation reflects the overall fluctuation of positive evaluations between users, which can characterize the degree of deviation between the positive evaluations of two users, and can also reflect the evaluation similarity between two users.
[0105] For example, the positive evaluation rate deviation of two users A and B in all object categories that they have reviewed together can be set to Where i is the number of object categories that users A and B have jointly evaluated, p represents the positive evaluation rate, pAi represents the positive evaluation rate of user A under object category i, and so on.
[0106] Among them, the relationship between the sentiment tendency value and the sentiment tendency of the alternative users towards the target object, and the sentiment tendency of the target user towards the target object, as well as the corresponding relationship between the positive evaluation rate deviation and the sentiment tendency of each comment content of the alternative users under the target object category, and the sentiment tendency of each comment content of the target user under the target object category can all be customized according to needs, and this embodiment of the present invention is not limited to this.
[0107] For example, in the case where the emotional tendency is a numerical value, it can be set that when the emotional tendency of the alternative user towards the target object and the emotional tendency of the target user towards the target object both meet the preset threshold conditions, then it can be determined that with respect to the target object, the emotional tendency value between the alternative user and the target user is a first preset numerical value, otherwise it is a second preset numerical value; or the emotional tendency can also be converted into positive or negative situations. In this case, it can be set that when the emotional tendency of the alternative user towards the target object is the same as the emotional tendency of the target user towards the target object, then it can be determined that with respect to the target object, the emotional tendency value between the alternative user and the target user is a first preset numerical value, otherwise it is a second preset numerical value; and so on.
[0108] Among them, positive sentiment tendency refers to the user's comments on a certain object. If the conclusion drawn after text sentiment analysis is positive semantics, it is understood that the user's sentiment tendency towards this object is positive.
[0109] For any target object category, the positive evaluation rate or negative evaluation rate of the target user and the candidate user's comments under the target object category can be obtained respectively, and then the positive evaluation rate deviation of the target user and the candidate user under all object categories can be obtained according to the positive evaluation rate or the negative evaluation rate. The positive evaluation rate can be the ratio of the number of positive evaluations of the same user under the same target object category to the total number of evaluations, and the positive evaluation can be determined according to the above-mentioned emotional tendency. For example, if the emotional tendency of the comment content is greater than a preset value or the emotional tendency is positive, the corresponding comment content is considered to be a positive evaluation.
[0110] In addition, the corresponding relationship between the emotional identification value and the emotional tendency value and the positive evaluation rate deviation can also be customized according to the needs, and this embodiment of the present invention is not limited to this. As mentioned above, the emotional tendency value and the emotional identification value can be in direct proportion, and the positive evaluation rate deviation can be in inverse proportion to the emotional identification value.
[0111] For example, for the above-mentioned users A and B, the sentiment identification value can be the sum of the sentiment tendency values of users A and B for each object they have commented on together, and the ratio of the positive evaluation rate deviation of users A and B in all object categories they have commented on together. Alternatively, the sentiment identification value between users A and B can be set, and its calculation method is as follows: v=s+D*(1-E), wherein s represents the sum of the sentiment tendency values of users A and B for each object they have commented on together, E represents the positive evaluation rate deviation of users A and B in all object categories they have commented on together, and D is a constant value. The value of D can be customized according to needs, and this is not limited in the embodiments of the present invention.
[0112] In addition, in the embodiment of the present invention, if the emotion identification value between any two users in the emotion identification matrix is updated with reference to the above method, assuming that any two users are user A and user B, the update process of the emotion identification value can be as follows:
[0113] Suppose user A comments on an object.
[0114] 1. According to the object comment content, the user's emotional tendency towards the object is obtained based on text sentiment analysis.
[0115] 2. Based on the sentiment of the user's comments obtained in step 1, the user's sentiment towards the object is recorded on the server. At the same time, the number of times the user evaluates the object category t is increased by one. If the sentiment is positive, the number of times the user evaluates the object category k is also increased by one;
[0116] 3. Traverse the replies of other users under the object to obtain the sentiment of other replying users towards the object. Assuming that the current traversal reaches user B, obtain the sentiment of user B towards the object;
[0117] 4. Compare the sentiment inclinations of user A and user B. If they are the same, set the sentiment inclination value s ab =1, otherwise set the sentiment tendency value s ab = -1;
[0118] 5. Calculate the positive evaluation rate deviation E of user A and user B in all object categories that they have evaluated together;
[0119] 6. Based on the above data, the emotional identification value between users A and B is calculated as follows:
[0120] v=a+s ab +D*(1-E)
[0121] Where a is the original sentiment identification value between A and B (if A and B have no common commented objects and common commented object categories before, the default initial value can be set to 0), D is a constant value, and s ab is the value obtained in step 4, and E is the current positive evaluation rate deviation obtained in step 5.
[0122] 7. Update the emotional identification matrix value according to the emotional identification value between users A and B calculated in step 6. Repeat steps 3 to 7 to update the emotional identification value between user A and other replying users under this object.
[0123] 8. When it is necessary to recommend friends to user A, sort the emotion identification values corresponding to user A from the emotion identification matrix and take out the top N users as A's recommended friends.
[0124] Optionally, in the embodiment of the present invention, the step S42 may further include:
[0125] Step S421, obtaining a first positive evaluation rate of the candidate user in the target object category according to the sentiment tendency of each comment content of the candidate user in the target object category and the number of comments made by the candidate user in the target object category;
[0126] Step S422, obtaining a second positive evaluation rate of the target user in the target object category according to the sentiment tendency of each comment content of the target user in the target object category and the number of comments made by the target user in the target object category;
[0127] Step S423, obtaining the deviation of the positive evaluation rate of the target user and the candidate user in all object categories reviewed together according to the first positive evaluation rate of the candidate user in each target object category and the second positive evaluation rate of the target user in each target object category.
[0128] As mentioned above, the positive evaluation rate deviation can represent the deviation between the positive evaluation rates of two users in all object categories that they have reviewed together. Then, in order to obtain the positive evaluation rate deviation, the positive evaluation rate of each of the two users in each object category that they have reviewed together can be obtained respectively. In order to distinguish the positive evaluation rates of the two users, the positive evaluation rate of one user can be defined as the first positive evaluation rate, and the positive evaluation rate of the other user can be defined as the second positive evaluation rate.
[0129] Specifically, for each target object category, the first positive evaluation rate of the alternative user under the target object category can be obtained based on the sentiment tendency of each comment content of the alternative user under the target object category and the number of comments made by the alternative user under the target object category; at the same time, the second positive evaluation rate of the target user under the target object category can be obtained based on the sentiment tendency of each comment content of the target user under the target object category and the number of comments made by the target user under the target object category.
[0130] Among them, the correspondence between the positive evaluation rate deviation and the first positive evaluation rate and the second positive evaluation rate can be customized according to the needs, and the embodiment of the present invention is not limited to this. For example, the positive evaluation rate deviation can be set to the sum of the differences in the positive evaluation rates between two users under each object category, or the sum of the absolute values of the differences in the positive evaluation rates between two users under each object category, or the average value of the absolute values of the differences in the positive evaluation rates between two users under each object category, and so on.
[0131] For example, for the above-mentioned user A and user B, the positive evaluation rate deviation can be obtained through the following steps.
[0132] (1) Obtain all object categories that user A and user B have jointly evaluated;
[0133] (2) Traverse the object categories in step (1) and calculate the positive evaluation rate p of the user in each object category. The calculation formula can be as follows:
[0134] p=k / t
[0135] Among them, k is the number of positive evaluations of the user on the object category, and t is the total number of evaluations of the user on the object category.
[0136] At this time, by traversing the object categories in step (1), the positive evaluation rates of user A and user B in each object category can be calculated according to the above formula: pA and pB;
[0137] (3) Based on the positive evaluation rates of user A and user B in each commonly evaluated object category calculated in the previous step, calculate the overall positive rate deviation E of users A and B. The calculation formula is as follows:
[0138]
[0139] Where i is the number of object categories that users A and B have evaluated together.
[0140] Optionally, in the embodiment of the present invention, the step S41 may further include:
[0141] Step S411, if the emotional tendency of the candidate user towards the target object is the same as the emotional tendency of the target user towards the target object, confirming that the emotional tendency value between the candidate user and the target user towards the target object is a first preset value;
[0142] Step S412: If the emotional tendency of the candidate user toward the target object is different from the emotional tendency of the target user toward the target object, confirm that the emotional tendency value between the candidate user and the target user toward the target object is a second preset value.
[0143] Taking the above-mentioned user A and user B as an example, in order to obtain the emotional tendency value between user A and user B for any target object, the emotional tendencies of user A and user B for the corresponding target object can be compared. If they are the same, the emotional tendency value between user A and user B at this time is set to the first preset value, otherwise it is set to the second preset value.
[0144] The first preset value and the second preset value can be customized according to the requirements, which is not limited in the embodiment of the present invention. For example, the first preset value can be set to 1, the second preset value can be set to -1, and so on.
[0145] Furthermore, if the obtained sentiment tendency is a numerical value, then in order to compare whether the sentiment tendencies of the two users are the same, the sentiment tendency represented by the numerical value can be converted into the sentiment tendency represented by the character. The conversion strategy can be customized according to the needs, for example, the sentiment tendency with a value greater than the preset value can be converted to a positive one, or the sentiment tendency with a value less than or equal to the preset value can be converted to a negative one, etc., so as to facilitate the confirmation of the sentiment tendency value between the two users.
[0146] Optionally, in this embodiment of the present invention, step S2 may further include:
[0147] Step S21, performing word segmentation processing on the comment content to obtain a word segmentation list of the comment content;
[0148] Step S22, obtaining the sentiment score of the comment content according to the word segmentation list;
[0149] Step S23, in response to the sentiment score being a positive value, determining that the sentiment tendency of the comment content is positive;
[0150] Step S24: in response to the sentiment score being a negative value, determining that the sentiment tendency of the comment content is negative.
[0151] When a user posts a comment under a certain object, we can perform text sentiment analysis on the comment content to obtain the user's emotional tendency towards the object. A positive sentiment tendency means that the user agrees with the topic, and a negative sentiment tendency means that the user disagrees with the topic. Then we start to build a sentiment tendency matrix between other users who reply to the topic.
[0152] Then when performing text sentiment analysis on the comment content, you can use the jieba tool or any other available word segmentation processing tool to perform word segmentation on the comment content to obtain a word segmentation list of the comment content, and then you can use any available text sentiment analysis algorithm to obtain the sentiment score of the comment content based on the word segmentation list. If the sentiment score of the comment content is a positive value, it can be determined that the sentiment tendency of the comment content is positive; if the sentiment score of the comment content is a negative value, it can be determined that the sentiment tendency of the comment content is negative. If the sentiment score of the comment content is zero, it can be determined that the sentiment tendency of the corresponding comment content is positive or negative, or the corresponding comment content can be directly ignored, which is not limited in this embodiment of the present invention.
[0153] Optionally, in the embodiment of the present invention, the step S22 may further include:
[0154] Step S221, filtering out negative words in the segmentation list, and screening target segmentations in the filtered segmentation list, wherein the target segmentations include at least one of sentiment segmentations, stop segmentations, and adverbs;
[0155] Step S222: Obtain the sentiment score of the comment content according to the target segmentation word.
[0156] In addition, in practical applications, negative words tend to affect the accuracy of text sentiment analysis to a certain extent. Therefore, in the embodiment of the present invention, in order to improve the accuracy of sentiment analysis results, negative words in the word segmentation list can be filtered out, and each word segmentation can also be analyzed by category to further improve the accuracy of sentiment analysis results. In the embodiment of the present invention, negative words in the word segmentation list can be filtered out by any available method, and the target word segmentation in the filtered word segmentation list can be screened, which is not limited by the embodiment of the present invention.
[0157] For example, Figure 3 The figure shows a specific process of text sentiment analysis in an embodiment of the present invention. At this time, the text sentiment analysis is performed based on the sentiment dictionary, and the specific process is as follows:
[0158] a) First, prepare a sentiment dictionary dataset, which includes sentiment dictionary, stop word dictionary, adverb and negation word dictionary;
[0159] b) Data initialization: read the prepared dictionary data set into memory and store it into the sentiment dictionary array, stop dictionary array, adverb array and negation dictionary array respectively;
[0160] c) Use the jieba tool to segment the comments to obtain a segmentation list, filter out negative words from the segmentation list to obtain a new segmentation list newWordsList, and then obtain the sentiment segmentation, stop segmentation and adverbs in the current comment content from newWordsList according to the sentiment dictionary array, stop dictionary array and adverb array above;
[0161] d) Based on the target word segments obtained in step (c), the overall sentiment score of the comment content is calculated. If the score is positive, it is a positive comment; if the score is negative, it is a negative comment.
[0162] For any object commented by any user, after obtaining the sentiment tendency of the user's comment content, the user's sentiment tendency for the object can be recorded to the server for the convenience of subsequent use. At the same time, the number of user evaluations of the object category to which the object belongs is increased by one. If the sentiment tendency is positive, the number of positive evaluations of the user for the object category can also be increased by one accordingly.
[0163] It should be noted that in the embodiment of the present invention, when constructing the above-mentioned emotion identification matrix, the emotion identification value between any two users can be obtained and the emotion identification value between any two users can be updated through the above-mentioned method, which is not limited by the embodiment of the present invention.
[0164] This paper obtains the sentiment tendency of user comments based on text sentiment analysis, calculates the sentiment tendency of other replying users under the same object, and then calculates the positive evaluation rate deviation based on all object categories that have been jointly evaluated by users to reflect the overall similarity of evaluations between two users. Finally, the sentiment identification value between the two users is calculated. In the traversal process, a sentiment identification matrix between each user is gradually formed. Finally, the top N users are sorted according to the values in the sentiment identification matrix for friend recommendation. In this way, the user's emotional cognition is combined in the recommendation process to recommend more accurate friends with common interests to users, thereby making the community atmosphere more active and enhancing user stickiness.
[0165] Reference Figure 4 , showing a schematic structural diagram of a friend recommendation device in an embodiment of the present invention.
[0166] The friend recommendation device of the embodiment of the present invention includes: a user information acquisition module 210 , a sentiment identification value search module 220 and a friend recommendation module 230 .
[0167] The functions of each module and the interactions between them are introduced in detail below.
[0168] A user information acquisition module 210, used to acquire a user ID of a target user;
[0169] The emotion identification value search module 220 is used to obtain the emotion identification value of the user identifier and each candidate user from the emotion identification matrix, wherein the emotion identification matrix includes the emotion identification value between any two users;
[0170] A friend recommendation module 230 is used to obtain N candidate users with the highest emotional identification values with the user identifier as recommended friends of the target user;
[0171] Among them, the sentiment identification value is obtained based on the sentiment tendency of the comments published by any two users on each target object they have commented on together, and / or the sentiment tendency of each comment content under each target object category they have commented on together, and the sentiment tendency is obtained by performing text sentiment analysis on the comment content; N is a positive integer, and the alternative users are users other than the target users.
[0172] Reference Figure 5 In the embodiment of the present invention, the device may further include:
[0173] The basic data acquisition module 240 is used to acquire, for any candidate user, each target object that the candidate user and the target user have jointly commented on, and each target object category that the candidate user and the target user have jointly commented on;
[0174] A first sentiment tendency acquisition module 250 is used to acquire, for each target object, the sentiment tendency of the candidate user with respect to the target object and the sentiment tendency of the target user with respect to the target object according to the comments posted by the candidate user and the target user with respect to the target object;
[0175] The second sentiment tendency acquisition module 260 is used to acquire, for each target object category, the sentiment tendency of each comment content of the candidate user under the target object category and the sentiment tendency of each comment content of the target user under the target object category according to the comment content posted by the candidate user and the target user under the target object category;
[0176] The emotion identification value acquisition module 270 is used to acquire the emotion identification values of the target user and the candidate users according to the emotion tendency.
[0177] Optionally, in the embodiment of the present invention, the emotion identification value acquisition module 270 may further include:
[0178] The emotional tendency value acquisition submodule is used to acquire the emotional tendency value between the candidate user and the target user with respect to the target object according to the emotional tendency of the candidate user with respect to the target object and the emotional tendency of the target user with respect to the target object;
[0179] A positive evaluation rate deviation acquisition submodule is used to acquire the positive evaluation rate deviation of the candidate user and the target user in all object categories that have been reviewed together, based on the sentiment tendency of each comment content of the candidate user under the target object category and the sentiment tendency of each comment content of the target user under the target object category;
[0180] The emotion identification value acquisition submodule is used to acquire the emotion identification value of the target user and the candidate user according to the emotion tendency value and the positive evaluation rate deviation.
[0181] Optionally, in the embodiment of the present invention, the positive evaluation rate deviation acquisition submodule may further include:
[0182] A first positive evaluation rate acquisition unit, configured to acquire a first positive evaluation rate of the candidate user under the target object category according to the sentiment tendency of each comment content of the candidate user under the target object category and the number of comments made by the candidate user under the target object category;
[0183] A second positive evaluation rate acquisition unit, configured to acquire a second positive evaluation rate of the target user under the target object category according to the sentiment tendency of each comment content of the target user under the target object category and the number of comments made by the target user under the target object category;
[0184] A positive evaluation rate deviation acquisition unit is used to obtain the positive evaluation rate deviation of the target user and the alternative user in all object categories that have been reviewed together based on the first positive evaluation rate of the alternative user in each target object category and the second positive evaluation rate of the target user in each target object category.
[0185] Optionally, in the embodiment of the present invention, the sentiment tendency value acquisition submodule may be specifically used for:
[0186] If the candidate user's emotional tendency toward the target object is the same as the target user's emotional tendency toward the target object, confirming that the emotional tendency value between the candidate user and the target user toward the target object is a first preset value;
[0187] If the emotional tendency of the candidate user with respect to the target object is different from the emotional tendency of the target user with respect to the target object, it is confirmed that the emotional tendency value between the candidate user and the target user with respect to the target object is a second preset value.
[0188] Optionally, in the embodiment of the present invention, the first emotion tendency acquisition module may further include:
[0189] A word segmentation processing submodule, used to perform word segmentation processing on the comment content to obtain a word segmentation list of the comment content;
[0190] A sentiment score acquisition submodule, used to acquire the sentiment score of the comment content according to the word segmentation list;
[0191] A first sentiment tendency confirmation submodule, configured to determine that the sentiment tendency of the comment content is positive in response to the sentiment score being a positive value;
[0192] The second sentiment tendency confirmation submodule is used to determine that the sentiment tendency of the comment content is negative in response to the sentiment score being a negative value.
[0193] Optionally, in the embodiment of the present invention, the sentiment score acquisition submodule may be specifically used for:
[0194] Filter out negative words in the word list, and select target word in the filtered word list, wherein the target word includes at least one of sentiment word, stop word, and adverb;
[0195] According to the target segmentation, the sentiment score of the comment content is obtained.
[0196] The friend recommendation device provided by the embodiment of the present invention can achieve Figure 1 to Figure 2 To avoid repetition, the various processes implemented in the method embodiment are not described here.
[0197] Preferably, an embodiment of the present invention further provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned friend recommendation method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0198] The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, each process of the above-mentioned friend recommendation method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0199] Figure 6 A schematic diagram of the hardware structure of an electronic device for implementing various embodiments of the present invention.
[0200] The electronic device 500 includes but is not limited to: a radio frequency unit 501, a network module 502, an audio output unit 503, an input unit 504, a sensor 505, a display unit 506, a user input unit 507, an interface unit 508, a memory 509, a processor 510, and a power supply 511. Those skilled in the art will appreciate that Figure 6 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. In the embodiments of the present invention, the electronic device includes but is not limited to a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted terminal, a wearable device, and a pedometer.
[0201] It should be understood that in the embodiment of the present invention, the radio frequency unit 501 can be used for receiving and sending signals during information transmission or communication. Specifically, after receiving downlink data from the base station, it is sent to the processor 510 for processing; in addition, uplink data is sent to the base station. Generally, the radio frequency unit 501 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, etc. In addition, the radio frequency unit 501 can also communicate with the network and other devices through a wireless communication system.
[0202] The electronic device provides users with wireless broadband Internet access through the network module 502, such as helping users to send and receive emails, browse web pages, and access streaming media.
[0203] The audio output unit 503 can convert the audio data received by the RF unit 501 or the network module 502 or stored in the memory 509 into an audio signal and output it as sound. Moreover, the audio output unit 503 can also provide audio output related to a specific function performed by the electronic device 500 (for example, a call signal reception sound, a message reception sound, etc.). The audio output unit 503 includes a speaker, a buzzer, a receiver, etc.
[0204] The input unit 504 is used to receive audio or video signals. The input unit 504 may include a graphics processor (GPU) 5041 and a microphone 5042. The graphics processor 5041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The processed image frame can be displayed on the display unit 506. The image frame processed by the graphics processor 5041 can be stored in the memory 509 (or other storage medium) or sent via the radio frequency unit 501 or the network module 502. The microphone 5042 can receive sound and can process such sound into audio data. The processed audio data can be converted into a format output that can be sent to a mobile communication base station via the radio frequency unit 501 in the case of a telephone call mode.
[0205] The electronic device 500 also includes at least one sensor 505, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 5061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 5061 and / or the backlight when the electronic device 500 is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary, which can be used to identify the posture of the electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; the sensor 505 can also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which will not be repeated here.
[0206] The display unit 506 is used to display information input by the user or information provided to the user. The display unit 506 may include a display panel 5061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0207] The user input unit 507 can be used to receive input digital or character information, and to generate key signal input related to user settings and function control of the electronic device. Specifically, the user input unit 507 includes a touch panel 5071 and other input devices 5072. The touch panel 5071, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 5071 or near the touch panel 5071 using any suitable object or accessory such as a finger, stylus, etc.). The touch panel 5071 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the contact point coordinates, and then sends it to the processor 510, receives the command sent by the processor 510 and executes it. In addition, the touch panel 5071 can be implemented using multiple types such as resistive, capacitive, infrared and surface acoustic waves. In addition to the touch panel 5071, the user input unit 507 may also include other input devices 5072. Specifically, other input devices 5072 may include but are not limited to a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be described in detail here.
[0208] Furthermore, the touch panel 5071 may be overlaid on the display panel 5061. When the touch panel 5071 detects a touch operation on or near it, it transmits the information to the processor 510 to determine the type of the touch event. Then, the processor 510 provides a corresponding visual output on the display panel 5061 according to the type of the touch event. Figure 6 In the figure, the touch panel 5071 and the display panel 5061 are used as two independent components to realize the input and output functions of the electronic device. However, in some embodiments, the touch panel 5071 and the display panel 5061 can be integrated to realize the input and output functions of the electronic device, which is not limited here.
[0209] The interface unit 508 is an interface for connecting an external device to the electronic device 500. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, etc. The interface unit 508 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the electronic device 500 or may be used to transmit data between the electronic device 500 and an external device.
[0210] The memory 509 can be used to store software programs and various data. The memory 509 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 509 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0211] The processor 510 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 509 and calling data stored in the memory 509, it performs various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. The processor 510 may include one or more processing units; preferably, the processor 510 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 510.
[0212] The electronic device 500 may also include a power supply 511 (such as a battery) for supplying power to each component. Preferably, the power supply 511 may be logically connected to the processor 510 through a power management system, thereby implementing functions such as charging, discharging, and power consumption management through the power management system.
[0213] In addition, the electronic device 500 includes some functional modules not shown, which will not be described in detail here.
[0214] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0215] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0216] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.
[0217] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the embodiments of the present invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0218] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0219] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0220] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0221] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0222] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical disks.
[0223] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A friend recommendation method, characterized in that: include: Get the user ID of the target user; According to the candidate user's emotional tendency toward the target object and the target user's emotional tendency toward the target object, obtaining an emotional tendency value between the candidate user and the target user toward the target object; According to the sentiment tendency of each comment content of the candidate user under the target object category and the sentiment tendency of each comment content of the target user under the target object category, the positive evaluation rate deviation of the candidate user and the target user under all object categories that have been reviewed together is obtained; Acquiring the emotional identification value of the target user and the candidate user according to the emotional tendency value and the positive evaluation rate deviation; Acquire the user identifier and the emotion identification value of each candidate user from an emotion identification matrix, wherein the emotion identification matrix includes the emotion identification value between any two users; Obtaining N candidate users with the highest emotional identification values with the user identifier as recommended friends of the target user; Among them, the sentiment identification value is obtained based on the sentiment tendency of the comments published by any two users on each target object they have commented on together, and / or the sentiment tendency of each comment content under each target object category they have commented on together, and the sentiment tendency is obtained by performing text sentiment analysis on the comment content; N is a positive integer, and the alternative users are users other than the target users.
2. The method according to claim 1, characterized in that Before the step of performing the step according to the emotional inclination of the candidate users towards the target object, the step further includes: For any candidate user, obtain each target object that the candidate user and the target user have jointly commented on, and each target object category that the candidate user and the target user have jointly commented on; For each of the target objects, based on the comments posted by the candidate users and the target users on the target object, respectively obtain the emotional tendency of the candidate users towards the target object and the emotional tendency of the target user towards the target object; For each target object category, based on the comments posted by the candidate users and the target users under the target object category, the sentiment tendency of each comment content of the candidate users under the target object category and the sentiment tendency of each comment content of the target user under the target object category are obtained respectively.
3. The method according to claim 1, characterized in that The step of obtaining the deviation of the positive evaluation rate of the candidate user and the target user in all object categories that have been reviewed together according to the sentiment tendency of each comment content of the candidate user under the target object category and the sentiment tendency of each comment content of the target user under the target object category comprises: According to the sentiment tendency of each comment content of the candidate user under the target object category and the number of comments made by the candidate user under the target object category, obtaining a first positive evaluation rate of the candidate user under the target object category; According to the sentiment tendency of each comment content of the target user under the target object category and the number of comments made by the target user under the target object category, obtaining a second positive evaluation rate of the target user under the target object category; According to the first positive evaluation rate of the candidate user in each target object category and the second positive evaluation rate of the target user in each target object category, the positive evaluation rate deviation of the target user and the candidate user in all object categories reviewed together is obtained.
4. The method according to claim 1, characterized in that The step of obtaining the emotional tendency value between the candidate user and the target user with respect to the target object according to the emotional tendency of the candidate user with respect to the target object and the emotional tendency of the target user with respect to the target object comprises: If the candidate user's emotional tendency toward the target object is the same as the target user's emotional tendency toward the target object, confirming that the emotional tendency value between the candidate user and the target user toward the target object is a first preset value; If the emotional tendency of the candidate user with respect to the target object is different from the emotional tendency of the target user with respect to the target object, it is confirmed that the emotional tendency value between the candidate user and the target user with respect to the target object is a second preset value.
5. The method according to claim 2, characterized in that: The step of obtaining, for each target object, the emotional tendency of the candidate user towards the target object and the emotional tendency of the target user towards the target object according to the comments posted by the candidate user and the target user on the target object, respectively comprises: Performing word segmentation processing on the comment content to obtain a word segmentation list of the comment content; According to the word segmentation list, obtaining the sentiment score of the comment content; In response to the sentiment score being a positive value, determining that the sentiment tendency of the comment content is positive; In response to the sentiment score being a negative value, it is determined that the sentiment tendency of the comment content is negative.
6. The method according to claim 5, characterized in that The step of obtaining the sentiment score of the comment content according to the word segmentation list includes: Filter out negative words in the word list, and select target word in the filtered word list, wherein the target word includes at least one of sentiment word, stop word, and adverb; According to the target segmentation, the sentiment score of the comment content is obtained.
7. A friend recommendation device, characterized in that: include: A user information acquisition module, used to obtain the user ID of the target user; The emotional tendency value acquisition submodule is used to acquire the emotional tendency value between the candidate user and the target user with respect to the target object according to the emotional tendency of the candidate user with respect to the target object and the emotional tendency of the target user with respect to the target object; A positive evaluation rate deviation acquisition submodule is used to acquire the positive evaluation rate deviation of the candidate user and the target user in all object categories that have been reviewed together, based on the sentiment tendency of each comment content of the candidate user under the target object category and the sentiment tendency of each comment content of the target user under the target object category; A sentiment identification value acquisition submodule, used to acquire the sentiment identification value of the target user and the candidate user according to the sentiment tendency value and the positive evaluation rate deviation; An emotion identification value search module, used to obtain the emotion identification value of the user identifier and each candidate user from an emotion identification matrix, wherein the emotion identification matrix includes the emotion identification value between any two users; A friend recommendation module is used to obtain N candidate users with the highest emotional identification values with the user identifier as recommended friends of the target user; Among them, the sentiment identification value is obtained based on the sentiment tendency of the comments published by any two users on each target object they have commented on together, and / or the sentiment tendency of each comment content under each target object category they have commented on together, and the sentiment tendency is obtained by performing text sentiment analysis on the comment content; N is a positive integer, and the alternative users are users other than the target users.
8. The device according to claim 7, characterized in that The device further comprises: A basic data acquisition module, used for acquiring, for any candidate user, each target object that the candidate user and the target user have jointly commented on, and each target object category that the candidate user and the target user have jointly commented on; A first sentiment tendency acquisition module is used to acquire, for each target object, the sentiment tendency of the candidate user with respect to the target object and the sentiment tendency of the target user with respect to the target object according to the comments posted by the candidate user and the target user with respect to the target object; The second sentiment tendency acquisition module is used to obtain, for each target object category, the sentiment tendency of each comment content of the candidate user under the target object category and the sentiment tendency of each comment content of the target user under the target object category based on the comment content posted by the candidate user and the target user under the target object category.
9. The device according to claim 7, characterized in that The positive evaluation rate deviation acquisition submodule includes: A first positive evaluation rate acquisition unit, configured to acquire a first positive evaluation rate of the candidate user under the target object category according to the sentiment tendency of each comment content of the candidate user under the target object category and the number of comments made by the candidate user under the target object category; A second positive evaluation rate acquisition unit, configured to acquire a second positive evaluation rate of the target user under the target object category according to the sentiment tendency of each comment content of the target user under the target object category and the number of comments made by the target user under the target object category; A positive evaluation rate deviation acquisition unit is used to obtain the positive evaluation rate deviation of the target user and the alternative user in all object categories that have been reviewed together based on the first positive evaluation rate of the alternative user in each target object category and the second positive evaluation rate of the target user in each target object category.
10. The device according to claim 7, characterized in that The sentiment tendency value acquisition submodule is specifically used for: If the candidate user's emotional tendency toward the target object is the same as the target user's emotional tendency toward the target object, confirming that the emotional tendency value between the candidate user and the target user toward the target object is a first preset value; If the emotional tendency of the candidate user with respect to the target object is different from the emotional tendency of the target user with respect to the target object, it is confirmed that the emotional tendency value between the candidate user and the target user with respect to the target object is a second preset value.
11. The device according to claim 8, characterized in that The first emotion tendency acquisition module includes: A word segmentation processing submodule, used to perform word segmentation processing on the comment content to obtain a word segmentation list of the comment content; A sentiment score acquisition submodule, used to acquire the sentiment score of the comment content according to the word segmentation list; A first sentiment tendency confirmation submodule, configured to determine that the sentiment tendency of the comment content is positive in response to the sentiment score being a positive value; The second sentiment tendency confirmation submodule is used to determine that the sentiment tendency of the comment content is negative in response to the sentiment score being a negative value.
12. The device according to claim 11, characterized in that The sentiment score acquisition submodule is specifically used for: Filter out negative words in the word list, and select target word in the filtered word list, wherein the target word includes at least one of sentiment word, stop word, and adverb; According to the target segmentation, the sentiment score of the comment content is obtained.
13. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of the friend recommendation method according to any one of claims 1 to 6 are implemented.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the friend recommendation method according to any one of claims 1 to 6 are implemented.
