A Social Recommendation Method Based on Cross-Topic Contrastive Learning
By dividing user interests into different topics and adopting cross-theme comparison learning methods, the problem of existing recommendation systems being poor in dealing with sparse user rating matrix and diverse social relationships is solved, and more accurate and personalized recommendation results are achieved.
Patent Information
- Application Number
- CN202310849422.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-11
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2043-07-11
AI Technical Summary
Existing recommendation systems are not effective when dealing with sparse user rating matrix and diverse social relationships and are prone to introducing negative information.
A social recommendation method based on cross-theme comparison learning is adopted. By dividing user interests into different topics, social relationships within the topic are constructed, and the objective function is constructed using the InfoNCE method and balance theory to maximize user interest differences and finally integrated into the recommendation framework.
It effectively alleviates social noise, improves the performance of the recommendation system, improves the accuracy of recommendation results and considers user differences.
Smart Images

Figure CN116842277B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of social networks, and particularly to a social recommendation method based on cross-topic contrast learning. Background Art
[0002] With the development of information technology, the information in the network has also grown exponentially, and it has become extremely difficult to process and select the required information. In this case, the recommendation system has become an important method to solve this problem. The recommendation system models based on the historical behavior data of users and the content of items themselves, so as to recommend the information that users need and are interested in to them. Currently, the mainstream recommendation algorithms are generally divided into methods based on collaborative filtering, methods based on content, and hybrid methods. The collaborative filtering method is one of the most popular techniques for building a recommendation system, and it can learn the interests of users from the interaction history between users and items. The traditional user-based collaborative filtering method uses the ratings and preferences of similar users to generate recommendations for other users. However, in a real environment, the rating matrix of users is usually very sparse, so there are not enough common rating items to calculate the similarity of users, resulting in poor performance of the recommendation system.
[0003] Since establishing connections at low cost in an online social network may enable a person to have too many friends in the network world, making the social network composed of valuable friends, casual friends, and friends of events, and users are not necessarily all similar. The social relationship that mixes useful and noisy connections may introduce negative information into the recommendation system. Therefore, using all the social relationships of users without discrimination may perform worse than traditional recommendation systems. Summary of the Invention
[0004] The purpose of the present invention is to provide a social recommendation method based on cross-topic contrast learning. In order to alleviate the possible conflicts in social relationships based on signed networks, multiple topics are introduced into the construction method of signed networks, and the user interests are divided into different topics to further alleviate the social noise of users. At the same time, in order to distinguish the user interests under each topic as much as possible, a cross-topic contrast learning mechanism is adopted to maximize the user interest differences under different topics and integrate them into the recommendation framework.
[0005] The purpose of the present invention can be achieved by the following technical solutions:
[0006] A social recommendation method based on cross-topic contrast learning, comprising the following steps:
[0007] Step 1) Obtain the user-item interaction graph in the recommendation system;
[0008] Step 2) Perform item representation learning based on the user-item interaction graph, and cluster the items to divide topics;
[0009] Step 3) Cross-topic comparison to construct topic-based social relationships:
[0010] Step 31) Construct the behavioral social matrix of users under different topics;
[0011] Step 32) Use the InfoNCE method to construct the objective function for cross-topic contrastive learning;
[0012] Step 4) Intra-topic information propagation based on SGCN:
[0013] Step 41) Calculate the set of users for balanced and unbalanced paths from the user perspective;
[0014] Step 42) Utilize the balance theory to obtain balanced or unbalanced user embeddings of users through information aggregation;
[0015] Step 43) Aggregate the user interests under each topic through the attention mechanism;
[0016] Step 5) Self-supervised method based on the extended balance theory:
[0017] Step 51) Follow the extended structural balance theory to construct the objective function of the self-supervised task under different topics;
[0018] Step 52) In the recommendation task, adopt the Bayesian personalized ranking loss, combine the objective function of cross-topic contrastive learning and the objective function of the self-supervised task based on the balance theory to determine the total loss function of the recommendation system;
[0019] Step 53) Train the recommendation system based on the total loss function to obtain the recommendation results considering user differences.
[0020] The said Step 2) includes the following steps:
[0021] Step 21) Use the biased random walk method to sample the node sequence of the user-item interaction graph. After obtaining the sampling sequence, use the Skip-gram model and negative sampling method to perform item representation learning within the view and train to obtain item embeddings;
[0022] Step 22) Cluster the trained item embeddings to obtain the corresponding user interest topics and the initial embeddings of users within each topic.
[0023] The specific process of using the Skip-gram model and negative sampling method to perform item representation learning within the view and train to obtain item embeddings is as follows:
[0024] The Skip-gram model obtains node representations by maximizing the average log probability of the sequence:
[0025]
[0026] Among them, c is the context window of the sequence, T is the sequence length, and i t represents the t-th item in the sequence. In Skip-gram, the most important p(i k+j |i t ) is expressed using the softmax function as follows:
[0027]
[0028] Among them, e i and e' i are the vector representations of the input and output of the item node, and N is the total number of items;
[0029] Since the time complexity of calculating the denominator of the above formula is high, the negative sampling method is used to approximately maximize the logarithmic probability of the softmax function. Then the above formula is expressed as:
[0030]
[0031] Among them, k is the negative sample obtained according to the negative sampling method. Here, the negative sample can be obtained from the negative sample set when constructing the item view; σ is the sigmoid function;
[0032] The embedding of the item is trained according to the Skip-gram model.
[0033] The specific content of step 31) is as follows:
[0034] The social relationships of the user are divided into two categories: the original social network G s and the behavioral social network G b . The adjacency matrix of the original social network is represented by A s . The user behavioral social network refers to an implicit social network where there is no social relationship between users but they have had historical behaviors on the same item. The user behavioral social network is divided into the positive behavioral social network graph and the negative behavioral social network graph . The adjacency matrix of the positive behavioral social network graph is . The adjacency matrix of the negative behavioral social network graph is Then its calculation method under the topic t is as follows:
[0035]
[0036]
[0037] Among them, are the positive behavioral social matrix and the negative behavioral social matrix under the topic t respectively, They are the user positive rating matrix and user negative rating matrix under topic t. If the rating r of a user under this topic t is > 3, it is considered that his rating is positive; otherwise, it is considered negative. The original social network is regarded as positive social relationships and integrated into positive behavior sociality. Among them, the positive social relationship adjacency matrix under topic t The negative social relationship adjacency matrix under topic t
[0038] Step 32) specifically includes the following steps:
[0039] Determine the positive neighbor embedding of user u under topic t. The neighbor embedding is expressed as:
[0040]
[0041] Among them, and are respectively the positive neighbors and positive neighbor embeddings of user u under topic t, is the row vector of the adjacency matrix centered on user u, measures the number of neighbor connections of user u under topic t;
[0042] Given a user u and topic t, the objective function obtained by using infoNCE is:
[0043]
[0044] Among them, v ut is the user interest of user u under topic t, t ′ is other topics, and τ is the hyperparameter of the objective function, which is used to control the discrimination degree of the model for negative samples;
[0045] Determine the objective function of cross-topic contrast learning based on the objective function of the user under the topic:
[0046]
[0047] Among them, m is the number of users, and K is the number of topics.
[0048] The set of users for calculating the balanced path and unbalanced path from the user perspective is defined as:
[0049]
[0050]
[0051] Among them, represents the positive friends of user i with a path length of l + 1 under topic t, Denote the negative neighbor of user i when the path length is l + 1 under topic t, where u represents the user.
[0052] The user embedding, whether balanced or unbalanced, obtained through information aggregation is as follows:
[0053]
[0054] where and represent the positive embedding and negative embedding of user u under topic t, and are parameters to be trained. That is, in each layer of information aggregation under the topic, the positive embedding is composed of the positive interests of the user in the previous layer, the positive embeddings of positive neighbors, and the negative embeddings of negative neighbors;
[0055] Specifically, when l = 1, the positive embedding of the user is only aggregated from the embeddings of its positive neighbors, while the negative embedding of the user is only obtained by aggregating the embeddings of the user's negative neighbors:
[0056]
[0057]
[0058] After obtaining the positive and negative embeddings of the user under different topics, the positive and negative embeddings of the user are aggregated within the topic using a neural network to obtain the user embedding within the topic:
[0059]
[0060] where MLP represents a multi - layer perceptron.
[0061] The aggregation of user interests under each topic through the attention mechanism specifically means that the user embeddings of different topics are coherently aggregated through the attention mechanism to obtain the complete user interest embedding:
[0062]
[0063] where v u is the complete user embedding, K is the number of topics, v ut is the user interest of user u under topic t, and α t is the attention coefficient of topic t:
[0064]
[0065] where a and W T are parameters to be trained. Through the attention mechanism, the user embeddings of different topics are coherently aggregated to obtain the complete user interest embedding.
[0066] Design an objective function for a self-supervised task following the extended structural balance theory to correctly aggregate positive and negative social embeddings and mine the semantic information therein. Within a topic t, the objective function of the self-supervised task is:
[0067]
[0068] where and represent the positive and negative neighbors of user u within topic t, v ut is the interest embedding of user u under topic t, and is the similarity metric function.
[0069] The total loss function of the recommendation system is:
[0070]
[0071] where λ c and λ b are hyperparameters for controlling the effect of the auxiliary task, is the objective function of the self-supervised task, is the objective function of cross-topic contrastive learning, is the Bayesian Personalized Ranking (BPR) loss:
[0072]
[0073] where Φ represents the parameters of CTCL, is the predicted score of user u for item i, σ is the sigmoid function, and λ r is the regularization parameter.
[0074] Compared with the prior art, the present invention has the following beneficial effects:
[0075] (1) To alleviate the possible conflicts in social relationships based on signed networks, the present invention introduces multiple topics into the construction method of signed networks, divides user interests into different topics, and constructs the social relationships of users under different interest topics of users, further alleviating the social noise of users.
[0076] (2) The present invention tries to distinguish the user interests under each topic as much as possible, adopts a cross-topic contrastive learning mechanism to maximize the differences in user interests under different topics, and integrates it into the recommendation framework to improve the recommendation performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0077] Figure 1 is a schematic flowchart of the method of the present invention;
[0078] Figure 2It is the flowchart of the embodiment of the present invention;
[0079] Figure 3 It is the schematic diagram of the dynamic routing method in the embodiment of the present invention;
[0080] Figure 4 It is the SGCN balanced or unbalanced path diagram in the embodiment of the present invention. Specific implementation manners
[0081] The present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. This embodiment is implemented on the premise of the technical solution of the present invention, and gives detailed implementation manners and specific operation processes, but the protection scope of the present invention is not limited to the following embodiments.
[0082] This embodiment first defines the social network:
[0083] Definition 1: Social network graph. A social network graph refers to a graph structure composed of social connections between people or organizations. In a social network graph, nodes represent people or organizations, and edges represent their social connections.
[0084] Definition 2: Balance theory. In a triangular motif, the balance theory can be described as the four rules: "A friend of a friend is a friend", "An enemy of an enemy is a friend", "A friend of an enemy is an enemy", and "An enemy of a friend is an enemy".
[0085] Definition 3: User set U. The set composed of users in a recommendation system.
[0086] Definition 4: Item set I. The set composed of items in a recommendation system.
[0087] Definition 5: Rating matrix R. The description of user-item interactions in a recommendation system.
[0088] Definition 6: User friend set N t (u). The friend set of user u under topic t.
[0089] Definition 7: Adjacency matrix A. The adjacency matrix of users in a social network, a ij =1 indicates that in the social network, user i trusts user j, that is, user j is a friend of user i.
[0090] Definition 8: User embedding V. The low-dimensional vector representation of user features.
[0091] Definition 9: Item embedding E. The low-dimensional vector representation of item features.
[0092] As Figure 1 shown, this embodiment provides a social recommendation method based on cross-topic contrast, and its process architecture is as Figure 2 shown, including the following steps:
[0093] Step 1) Obtain the user-item interaction graph in the recommendation system.
[0094] Step 2) Based on the user-item interaction graph, perform item representation learning, cluster the items, and divide the topics.
[0095] Step 21) Use the biased random walk method to sample the node sequence of the user-item interaction graph. After obtaining the sampling sequence, use the Skip-gram model and negative sampling method to perform item representation learning within the view, and train to obtain item embeddings.
[0096] The Skip-gram model obtains the node representation by maximizing the average log probability of the sequence:
[0097]
[0098] where c is the context window of the sequence, T is the sequence length, and i t represents the t-th item in the sequence. The most important p(i k+j |i t ) in Skip-gram is represented by the softmax function as:
[0099]
[0100] where e i and e i ′ are the vector representations of the input and output of the item node, and N is the total number of items;
[0101] Since the time complexity of calculating the denominator of the above formula is high, the negative sampling method is used to approximately maximize the log probability of the softmax function, and the above formula is represented as:
[0102]
[0103] where k is the negative sample obtained according to the negative sampling method, and here the negative sample can be obtained from the negative sample set during the construction of the item view; σ is the sigmoid function;
[0104] According to the Skip-gram model, the embeddings of the items are trained.
[0105] Step 22) Cluster the trained item embeddings to obtain the corresponding user interest topics and the initial embeddings of users within each topic.
[0106] Specifically, design two-layer capsules, as Figure 3 shown. The first-layer capsule is the item embedding of the user behavior sequence, where e iDenote the embedding of the $i$-th item that the user has interacted with. The first layer of capsules obtains a new user behavior instance $e$ through different linear mapping matrices. ik , and the second layer of capsules $I$ k can be regarded as user interest capsules. The dynamic routing method is to use the first layer of capsules and the initial routing logic to calculate the value of the second layer of capsules, and then dynamically update the routing logic according to the correlation between the first layer of capsules and the second layer of capsules, and complete the extraction of the user's multiple interests through continuous iteration. First, perform a linear transformation on the first layer of capsules $e$ i , the purpose of which is to observe the item $i$ from different perspectives, and the obtained observation vector $e$ ik is calculated as:
[0107] $e$ ik $=$ $W$ k $e$ i
[0108] where $W$ k $\in \mathbb{R}$ d×d is the interest sharing transformation matrix, and each interest capsule $k$ uses a different transformation matrix $W$ k . To reduce the complexity of the model and make the user's multiple initial interests different from each other, $W$ in this embodiment k is a random matrix drawn from a normal distribution .
[0109] For each iteration, the interest capsule $I$ k is calculated as the weighted sum of all observation vectors:
[0110]
[0111] To make the length of the output vector of the capsule represent the probability of the entity represented by the capsule in the current input, the interest capsule $I$ K is compressed using the squash function:
[0112]
[0113] In the above two formulas, $c$ ik is the coupling coefficient between the observation vector $e$ ik and the interest capsule $S$ k , and the softmax and the routing logic $b$ ik are used to calculate the coupling coefficient $c$ ik :
[0114]
[0115] where $b$ ik is the dynamic routing logic, and its value is determined by the compressed interest capsule $S$ k and the prediction vector $e$ ikThe inner product is dynamically obtained as follows:
[0116] b ik = S k T e ik
[0117] The dynamic routing method first initializes the routing logic b ik to 0, and then calculates the coupling coefficient c according to the routing logic ik . To ensure different initial interests, a linear transformation is performed on the first-layer capsules, and then the interest capsules are calculated iteratively. The dynamic routing process proposed in this paper converges well after three iterations, and finally the embedded interest of the user under a topic is obtained as v uk = S k .
[0118] In another embodiment, in addition to the dynamic routing method mentioned above, K-Means++, Gaussian mixture model (GMM), etc. can also be used to cluster the trained item embeddings.
[0119] Step 3) Cross-topic comparison to construct topic-based social relationships:
[0120] Step 31) Construct the behavioral social matrix of users under different topics.
[0121] The social relationships of users are divided into two categories: the original social network G s and the behavioral social network G b . The adjacency matrix of the original social network is represented by A s . The user behavioral social network refers to an implicit social network where there is no social relationship between users, but they have had historical behaviors on the same item. The user behavioral social network is divided into a positive behavioral social network graph and a negative behavioral social network graph . The adjacency matrix of the positive behavioral social network graph is . The adjacency matrix of the negative behavioral social network graph is Then its calculation method under topic t is as follows:
[0122]
[0123]
[0124] Among them, are the positive and negative behavioral social matrices under topic t respectively, They are the user positive rating matrix and the user negative rating matrix under topic t. If the rating r of a user under this topic t is > 3, it is considered that his rating is positive; otherwise, it is considered negative. The original social network is regarded as a positive social relationship and integrated into positive behavior sociality. Among them, the adjacency matrix of positive social relationships under topic t The adjacency matrix of negative social relationships under topic t
[0125] Step 32) Use the InfoNCE method to construct the objective function for cross-topic contrastive learning.
[0126] First, determine the positive neighbor embedding of user u under topic t. The neighbor embedding is expressed as:
[0127]
[0128] Among them, and are the positive neighbors and positive neighbor embeddings of user u under topic t respectively. is the adjacency matrix The row vector centered on user u, measures the number of neighbor connections of user u under topic t; in this way, the positive neighbor embeddings of users under different topics are obtained.
[0129] Given a user u and topic t, the objective function obtained by using infoNCE is:
[0130]
[0131] Among them, v ut is the user interest of user u under topic t, t ′ is other topics, and τ is the hyperparameter of the objective function, which is used to control the discrimination of the model for negative samples;
[0132] Determine the objective function of cross-topic contrastive learning based on the objective function of users under topics:
[0133]
[0134] Among them, m is the number of users, and K is the number of topics.
[0135] Step 4) Intra-topic information propagation based on SGCN:
[0136] Step 41) Calculate the user sets of balanced paths and unbalanced paths from the user perspective.
[0137]
[0138]
[0139] Among them, represents the positive friends of user i when the path length is l + 1 under topic t, represents the negative neighbors of user i when the path length is l + 1 under topic t, and u represents the user.
[0140] Based on the balance theory, the balanced / unbalanced paths of user u are as Figure 4 shown.
[0141] Step 42) Utilize the balance theory to obtain the balanced or unbalanced user embeddings of users through information aggregation.
[0142]
[0143]
[0144] Among them, and represent the positive embedding and negative embedding of user u under topic t, and are parameters to be trained. It can be understood that for each layer of information aggregation under the topic, the positive embedding is composed of the positive interests of the user in the previous layer, the positive embeddings of positive neighbors, and the negative embeddings of negative neighbors;
[0145] Specifically, when l = 1, the positive embedding of the user is only aggregated by the embeddings of its positive neighbors, while the negative embedding of the user is only obtained by aggregating the embeddings of the user's negative neighbors:
[0146]
[0147]
[0148] After obtaining the positive and negative embeddings of users under different topics, first aggregate the positive and negative embeddings of users within the topic using a neural network to obtain the user embeddings within the topic:
[0149]
[0150] Among them, MLP represents a multi-layer perceptron.
[0151] Step 43) Aggregate the user interests under each topic through an attention mechanism:
[0152]
[0153] Among them, v u is the complete user embedding, K is the number of topics, v ut is the user interest of user u under topic t, α tAttention coefficient for topic t:
[0154]
[0155] where a and W T are parameters to be trained. Through the attention mechanism, the user embeddings of different topics are coherently aggregated to obtain the complete user interest embedding.
[0156] Step 5) Self-supervised method based on the extended balance theory:
[0157] Step 51) Follow the extended structural balance theory to construct the objective function of the self-supervised task under different topics.
[0158] Design an objective function for the self-supervised task following the extended structural balance theory to correctly aggregate the positive social embedding and the negative social embedding and mine the semantic information therein. Within a topic t, the objective function of the self-supervised task is:
[0159]
[0160] where and represent the positive neighbors and negative neighbors of user u within topic t, v ut is the interest embedding of user u under topic t, and is the similarity metric function.
[0161] Step 52) Adopt the Bayesian personalized ranking loss in the recommendation task, combine the objective function of cross-topic contrast learning and the objective function of the self-supervised task based on the balance theory to determine the total loss function of the recommendation system.
[0162] The Bayesian personalized ranking (BPR) loss is expressed as:
[0163]
[0164] where Φ represents the parameters of CTCL, is the predicted score of user u for item i, σ is the sigmoid function, and λ r is the regularization parameter.
[0165] After setting the objective function of the main recommendation task, incorporate cross-topic contrast learning and the balance theory within the topic as auxiliary tasks into the recommendation framework, and the total loss function of the recommendation system is obtained as:
[0166]
[0167] where λ c and λ b are hyperparameters to control the effect of the auxiliary tasks, is the objective function for self-supervised tasks is the objective function for cross-topic contrastive learning. Based on cross-topic contrastive learning and the in-topic balance theory, rich information in the heterogeneous network is mined to obtain better recommendation performance.
[0168] Step 53) Train the recommendation system based on the total loss function to obtain the recommendation results considering user differences.
[0169] In summary, cross-topic contrast mines the user interests between different topics, constructs auxiliary self-supervised signals using the balance theory, one of the basic social theories in the signed network, and fully mines the rich information in the heterogeneous graph to mine the semantic information of positive and negative links in the signed network. Specifically, according to the extended structural balance theory, it is considered that under the same topic, the user interests should be more similar to the friends with positive links and less similar to the nodes with negative links. Self-supervised signals are constructed based on the balance theory under different topics and integrated into the recommendation framework as an auxiliary task, achieving good results.
[0170] The preferred specific embodiments of the present invention have been described in detail above. It should be understood that those of ordinary skill in the art can make many modifications and variations based on the concept of the present invention without creative efforts. Therefore, all technical solutions that can be obtained by those skilled in the art in the technical field based on the concept of the present invention through logical analysis, reasoning, or limited experiments on the basis of the prior art should be within the protection scope determined by the claims.
Claims
1. A social recommendation method based on cross-topic contrast learning, characterized in that, it includes the following steps: Step 1) Obtain the user-item interaction graph in the recommendation system; Step 2) Perform item representation learning based on the user-item interaction graph, and cluster the items to divide the topics; Step 3) Construct social relationships based on topics through cross-topic contrast: Step 31) Construct the behavioral social matrix of users under different topics; Step 32) Use the InfoNCE method to construct the objective function for cross-topic contrast learning; the specific steps of Step 32) include the following steps: Determine the user Under the topic Positive neighbor embedding, and the neighbor embedding is expressed as: Among them, and are the positive neighbors and positive neighbor embeddings of the user u under the theme respectively, is the row vector of the adjacency matrix centered on the user u and measures the number of neighbor connections of the user under the theme u respectively; Given a user and a topic , the objective function obtained by infoNCE is as follows: Among them, is the user's interest under the topic ; is other topics, is the hyperparameter of the objective function, used to control the discrimination of the model for negative samples; Determine the objective function for cross-topic contrast learning based on the objective function of users under the topic: wherein, is the number of users, is the number of topics; Step 4) Intra-topic information propagation based on SGCN: Step 41) Calculate the set of users on the balanced path and the unbalanced path from the user perspective; Step 42) Use the balance theory to obtain the balanced or unbalanced user embeddings of users through information aggregation; Step 43) Aggregate the user interests under each topic through the attention mechanism; Step 5) Self-supervised method based on the extended balance theory: Step 51) Follow the extended structural balance theory to construct the objective function of the self-supervised task under different topics; Step 52) In the recommendation task, adopt the Bayesian personalized ranking loss, combine the objective function of cross-topic contrast learning and the objective function of the self-supervised task based on the balance theory to determine the total loss function of the recommendation system; Step 53) Train the recommendation system based on the total loss function to obtain the recommendation results considering user differences.
2. A social recommendation method based on cross-topic contrast learning according to claim 1, characterized in that, the Step 2) includes the following steps: Step 21) Use the biased random walk method to sample the node sequence of the user-item interaction graph. After obtaining the sampling sequence, use the Skip-gram model and the negative sampling method to perform item representation learning within the view, and train to obtain the item embeddings; Step 22) Cluster the trained item embeddings to obtain the corresponding user interest topics and the initial embeddings of users within each topic.
3. A social recommendation method based on cross-topic contrast learning according to claim 2, characterized in that, the use of the Skip-gram model and the negative sampling method to perform item representation learning within the view and train to obtain the item embeddings is specifically: The Skip-gram model obtains the node representation by maximizing the average log probability of the sequence: Among them, is the context window of the sequence, is the sequence length, represents the th item in the sequence. The most important in Skip-gram is expressed using the softmax function as: Among them, and are the vector representations of the input and output of the item nodes, is the total number of items; Since the time complexity of calculating the denominator of the above formula is high, the negative sampling method is used to approximately maximize the log probability of the softmax function, then the above formula is expressed as: Among them, k is a negative sample obtained according to the negative sampling method, is sigmoid a function; Train the embeddings of items according to the Skip-gram model.
4. A social recommendation method based on cross-topic contrast learning according to claim 1, characterized in that, the Step 31) is specifically: The user's social relationships are divided into two categories: the original social network and the behavioral social network . The adjacency matrix of the original social network is represented by . The user behavioral social network refers to an implicit social network where there is no social relationship between users, but they have had historical behaviors on the same item. The user behavioral social network is divided into the positive behavioral social network graph and the negative behavioral social network graph . The adjacency matrix of the positive behavioral social network graph is . The adjacency matrix of the negative behavioral social network graph is . Then its calculation method under the theme is as follows: Among them, and are the positive behavior social matrix and the negative behavior social matrix under the theme respectively. and are the user positive rating matrix and the user negative rating matrix under the theme respectively. The original social network is regarded as positive social relationships and integrated into positive behaviors. Among them, the positive social relationship adjacency matrix under the theme , and the negative social relationship adjacency matrix t under the theme .
5. A social recommendation method based on cross-topic contrast learning according to claim 1, characterized in that, the definition of calculating the set of users on the balanced path and the unbalanced path from the user perspective is: Among them, represents the user under the topic when the path length is positive friends, represents the user under the topic when the path length is negative neighbors, u represents the user.
6. A social recommendation method based on cross-topic contrast learning according to claim 5, characterized in that, The user embedding obtained by information aggregation to get balanced or unbalanced users is as follows: Among them, and represent the positive embedding and negative embedding of the user under the theme The positive embedding and negative embedding of the user under the theme and are parameters to be trained, that is: for each layer of information aggregation under the theme, the positive embedding is composed of the positive interests of the user in the previous layer, the positive embeddings of positive neighbors, and the negative embeddings of negative neighbors; When the user's positive embedding is aggregated only from the embeddings of its positive neighbors, and the user's negative embedding is aggregated only from the embeddings of the user's negative neighbors: After obtaining the positive and negative user embeddings under different topics, the positive and negative embeddings of users are aggregated within the topic using a neural network to obtain the user embedding within the topic: Among them, MLP represents a multi-layer perceptron.
7. A social recommendation method based on cross-topic contrast learning according to claim 1, characterized in that The aggregation of user interests under each topic through the attention mechanism specifically aggregates the user embeddings of different topics coherently through the attention mechanism to obtain a complete user interest embedding: Among them, is the complete user embedding, is the number of topics, is the user 's interest in the topic under, is the attention coefficient of the topic : Among them, and are parameters to be trained.
8. A social recommendation method based on cross-topic contrast learning according to claim 1, characterized in that In a topic The objective function of the self-supervised task is as follows: Among them, and represent the positive and negative neighbors of the user within the topic , and is the interest embedding of the user under the topic , and is the similarity metric function.
9. A social recommendation method based on cross-topic contrast learning according to claim 1, characterized in that The total loss function of the recommendation system is: Among them, and are hyperparameters for controlling the effect of the auxiliary task, is the objective function of the self-supervised task, is the objective function of cross-topic contrastive learning, is the Bayesian personalized ranking loss: Among them, represents the parameter of CTCL, for the user u to i the predicted score of the project is sigmoid a function, and is the regularization parameter.
Citation Information
Patent Citations
Recommendation method and system based on graph contrast learning and social network enhancement
CN114036406A
Social recommendation method based on multi-feature heterogeneous graph neural networks
US20220414792A1