A method for item recommendation that integrates semantic and structural views for social recommendation
By constructing a heterogeneous information network and a deep graph model, and combining local and global rating predictions, the problems of social relationship imbalance and sparsity are solved, improving the accuracy and stability of the social recommendation system and enhancing the robustness and generalization ability of the model.
Patent Information
- Application Number
- CN202211590930.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-12
- Publication Date
- 2026-03-06
- Estimated Expiration
- 2042-12-12
AI Technical Summary
Existing social recommendation systems struggle to effectively mine implicit data under conditions of uneven and sparse distribution of social relationships, resulting in insufficient accuracy and stability in recommendations.
We employ a semantic and structural view fusion model. By constructing a heterogeneous information network, we define the explicit and implicit relationships between users and items. We extract features using graph convolutional networks and width linear attention models, combine local and global rating predictions, construct a deep graph model and train it, and integrate user rating behavior constraints to optimize the recommendation results.
Under conditions of social imbalance and sparsity, the accuracy and stability of recommendations are improved, the robustness and generalization ability of the model are enhanced, user preferences are reflected, the impact of noise is reduced, and the overall performance of the recommendation system is improved.
Smart Images

Figure CN115935067B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of social recommendation systems, specifically a method for item recommendation based on a semantic and structural view fusion model for social recommendation. Background Technology
[0002] With the booming development of social platforms, relationships between people have become unprecedentedly close. Modeling and analyzing the relationships between platform users and products to achieve more accurate social recommendations has become increasingly important. Unlike traditional collaborative recommendation algorithms, social recommendation systems are based on a series of social influence theories. The main idea is that users with explicit social relationships often have similar preferences, and users' choices may be influenced by their friends and family. The main approach is to use relationships in social networks as supplementary information to improve recommendation accuracy. Social recommendations have already permeated all aspects of life, such as product recommendation functions on e-commerce platforms and friend recommendation functions on dating platforms. Currently, the performance improvement of social recommendation systems is mainly constrained by two factors: the uneven and sparsity of social relationship distribution and the differences in rating behavior. Therefore, the key to improving the robustness of social recommendation systems lies in how to further mine the large amount of potential implicit data while maintaining the relative positional relationship between users and items, and more efficiently and rationally utilizing the explicit and implicit relationships between users and products. Currently, recommendation methods related to this model can be divided into three categories: 1. Classical social recommendation methods, mainly including cofactor decomposition, ensemble, and regularization methods. These methods use only a small amount of implicit data, and many high-quality implicit relationships remain to be discovered; 2. Graph model-based social recommendation systems. These methods build high-order relationship models based on graph neural networks, making better use of various data, but still lack further mining of implicit relationships. At the same time, they also ignore the impact of user rating behavior on recommendation results; 3. Multi-view-based social recommendation methods. These methods aim to mine data information from multiple perspectives, and different interaction structures have different effects on rating prediction. Summary of the Invention
[0003] To address the shortcomings of the existing technologies, this invention proposes a social recommendation method that integrates semantic and structural views to ensure the accuracy and stability of item recommendations even under conditions of imbalanced and sparse distribution of social relationships.
[0004] To achieve the above-mentioned objectives, the present invention adopts the following technical solution:
[0005] The present invention provides a method for item recommendation based on the fusion of semantic and structural views for social recommendation, characterized by the following steps:
[0006] Step 1: Define implicit relationships in social recommendation:
[0007] Step 1.1: Let U = {u1, ..., u} i ,…,u M} represents the user set, u i Let V represent any i-th user, 1≤i≤M, where V={v1,…,v a , ..., v N} represents a set of items, v a Let a represent any a-th item, where 1 ≤ a ≤ N;
[0008] Let the user rating matrix be denoted as R = {r ia} M×N Let r represent the ratings of all users in user set U for all items in item set V, where r ia Represents any i-th user u i For any a-th item v a The rating;
[0009] Let the user social matrix be denoted as S = {s} ik} M×M Indicates whether each user in the user set U follows other users, where s ik Represents any i-th user u i Do you want to follow any k-th user u? k If the i-th user u i Follow the kth user u k Then let s ik =1, otherwise, let s ik =0;
[0010] Let the i-th user u i Let F be the collection of social friends. U (i)={u k |s ik =1};1≤k≤M;andi≠k;
[0011] Step 1.2: Let the i-th user u i The set of implicit social friends is denoted as HU(i)={u ij ||||s ik =1∩s jk =1||≥τ}, where, u ij Represents the i-th user u i Hidden social friends, s ik =1∩s jk =1 indicates that the i-th user u i The k-th user u that is being followed k At the same time, it also followed the j-th user u. j τ represents the cutoff threshold, 1≤τ; 1≤j≤M; and j≠k;
[0012] Get the a-th item v a And the bth item v b The set of users U who all provided ratings ab U ab ∈U; Use equation (1) to obtain the user set U ab The i-th user u i For the a-th item v a With the b-th item v b similarity of ratings between
[0013]
[0014] In equation (1), r ib Represents the i-th user u i For any b-th item v b The score; 1≤b≤N; and a≠b;
[0015] The user set U is obtained using equation (2). ab All users in the middle have views on item v of the a-th item. a With the b-th item v b Cumulative similarity value between ratings (sim) ab Thus, the a-th item v is obtained. a The cumulative set of rating similarity values between the item and other items;
[0016]
[0017] Based on the cumulative score similarity value set, related items are sorted in descending order to obtain the a-th item v. a The set of implicit item relations H V (a);
[0018] Step 2: Construct a heterogeneous information network and define meta-paths:
[0019] Each user and each item is treated as a node. The social friend set and implicit social friend set of each user are used as the explicit and implicit relationships between each user node. The implicit item relationship set of each item is used as the implicit relationship between each item node. This constructs the edges between each node and forms a heterogeneous information network HIN.
[0020] Five types of user meta-paths are defined, including three types of single-hop neighbor meta-paths and two types of double-hop neighbor meta-paths. Among them, the three types of single-hop neighbor meta-paths consisting of two nodes and an edge connecting them are: user-item, user-user, and user-latent user. Here, user-item represents a user node to an item node and an edge connecting them; user-user represents a user node to another user node and an edge connecting them; and user-latent user represents a user node to another latent user node and an edge connecting them.
[0021] Two types of user double-hop neighbor meta-paths, consisting of three nodes and their two connected edges, are: user-user-item and user-latent user-item. User-user-item represents a user node to another user node and its connected edge, and a second user node to an item node and its connected edge. User-latent user-item represents a user node to a latent user node and its connected edge, and a latent user node to an item node and its connected edge.
[0022] Three types of item metapaths are defined, including: item-user, item-implicit item, and item-implicit item-user; where item-user represents an item node to a user node and an edge connected to it, item-implicit item represents an item node to an implicit item node and an edge connected to it, and item-implicit item-user represents an item node to an implicit item node and an edge connected to it, as well as an implicit item node to a user node and an edge connected to it.
[0023] Step 3: Extract local score predictions;
[0024] Step 3.1: After randomly removing some nodes and their associated edges from the heterogeneous information network HIN, the preprocessed heterogeneous information network HIN′ is obtained.
[0025] Step 3.2: Obtain the i-th user u from HIN′ using an embedding layer. i eigenvector p i ∈R d and the a-th item v a eigenvector q a ∈R d′ d′ represents the dimension of the feature vector;
[0026] Step 3.3: Construct a depth graph model consisting of an attention-based graph convolutional network, a user local feature extraction module, an item local feature extraction module, and a local prediction module;
[0027] Step 3.3.1, p i q aThe input is processed in an attention-based graph convolutional network to obtain five types of user meta-path output vectors, including: embedding vectors based on user-item meta-paths. Embedded vectors based on user-user meta paths Embedded vectors based on user-user-item meta paths Embedding vectors based on user-latent user metapath Embedded vectors based on user-latent user-item meta-path
[0028] Step 3.3.2: The user local feature extraction module processes the output vectors of the five user metapaths using equation (2) to obtain the i-th user u. i Local feature embedding vector
[0029]
[0030] In equation (2), MLP represents the concatenation operation. user This represents a multi-layer feedforward neural network in the user local feature extraction module.
[0031] Step 3.3.3: Transfer the i-th user u i eigenvector p i and the a-th item v a eigenvector q a The input is processed in an attention-based graph convolutional network to obtain three types of item meta-path output vectors, including: embedding vectors based on item-user meta-paths. Embedding vectors based on item-latent item metapaths Embedded vectors based on item-implicit item-user meta path
[0032] Step 3.3.4: The item local feature extraction module processes the output vectors of the three item metapaths using equation (3) to output the a-th item v. a Local feature embedding vector
[0033]
[0034] In equation (3), MLP item This represents a multi-layer feedforward neural network in the local feature extraction module for items.
[0035] Step 3.3.5, will The input is processed in the local prediction module, and the i-th user u is obtained using equation (4). i For the a-th item va Local score prediction
[0036]
[0037] In equation (4), MLP deep This represents a multilayer feedforward neural network in the local prediction module;
[0038] Step 4: Extract global score predictions;
[0039] Step 4.1: Based on the i-th user u i H, a collection of implicit social friends U (i) Obtain the i-th user u from HIN using the embedding layer. i The latent eigenvector p′ i ∈R d′ and potential influence vector x i ∈R d′ And based on the implicit item relation set H of the a-th item V (a) Obtain the a-th item v from HIN using the embedding layer. a latent eigenvectors q′ a ∈R d and potential influence vector y a ∈R d′ ;
[0040] Step 4.2: Construct a width-based linear attention model consisting of a user global feature extraction module, an item global feature extraction module, and a global prediction module;
[0041] Step 4.2.1: The user global feature extraction module uses three types of user single-hop neighbor meta-paths and equations (5) to (8) to obtain the i-th user u. i Global feature embedding vector
[0042]
[0043]
[0044]
[0045]
[0046] In equation (8), α ik ∈α represents the i-th user u i For the k-th user u k Attention weights, β ij ∈β represents the i-th user u i For the jth user in the hidden social friendsij Attention weights, γ ia ∈γ represents the i-th user u i For the a-th item v a Attention weights, R V (i)∈R represents the i-th user u i The set of items with ratings is given; W1, W2, W3, W4, W5, W6 are six trainable parameter matrices, b1, b2, b3 are three bias vectors; σ is the activation function, softmax is the normalization function; T is the transpose.
[0047] Step 4.2.2: The global feature extraction module for the item uses equation (9) to obtain the a-th item v. a Global feature embedding vector
[0048]
[0049] In equation (9), η ab ∈η represents the a-th item v a For the b-th implicit similar item v b Attention weights;
[0050] Step 4.2.3, Input into the global prediction module, and use equation (10) to obtain the i-th user u i For the a-th item v a Global score prediction
[0051]
[0052] In equation (10), b i For the i-th user u i User bias, b a For the a-th item v a The item bias is μ, which is the average of all users' ratings for all items.
[0053] Step 5: Use equation (11) to obtain the i-th user u i For the a-th item v a Rating prediction results
[0054]
[0055] In equation (11), λ represents the scoring weight coefficient;
[0056] Step 6: Construct constraints for user rating behavior;
[0057] Step 6.1: Define a triplet (u, r, v) for user ratings of items, where u∈U represents the user entity, v∈V represents the item entity, and r∈R represents the rating relationship. Calculate the feature vector using the TransH algorithm, including: the user entity feature vector e. u Item entity feature vector e v The rating relationship feature vector e r ;
[0058] According to equations (12) and (13), e is obtained u e v User entity feature projection vectors on the hyperplane of relation r and the projection vector of object entity features
[0059]
[0060]
[0061] In equations (12) and (13), w r This is the normal vector of the corresponding hyperplane;
[0062] Step 6.2: Construct the rating function f(u, r, v) for the rating triple (u, r, v) using equation (14):
[0063]
[0064] Step 6.3: Construct the marginal loss function L using equation (15). KG :
[0065]
[0066] In equation (16), [f(·)] + Let max(0, f(·)), v′ represent another item entity, (u, r, v′) represent the spurious triple generated by v′ replacing v, v′∈V; f(u, r, v′) represents the scoring function of the spurious triple (u, r, v′);
[0067] Step 7: Construct the loss function L of the depth map model using equation (14). D :
[0068]
[0069] In equation (14), λ1 and λ2 are regularization parameters, P represents the matrix composed of all user feature vectors, and Q represents the matrix composed of all item feature vectors.
[0070] The loss function L of the width linear attention model is constructed using equation (15).W :
[0071]
[0072] In equation (15), λ3 is the regularization parameter, P' represents the matrix composed of all user potential feature vectors, Q' represents the matrix composed of all item potential feature vectors, X represents the matrix composed of all user potential influence vectors, and Y represents the matrix composed of all item potential influence vectors.
[0073] Step 7: Train the depth map model and the width linear attention model using gradient descent, and calculate the loss function L accordingly. D and loss function L W The model parameters are updated until the loss function converges, thus obtaining the trained depth map model and the trained width linear attention model.
[0074] Step 8: Input the set of items, user rating matrix, set of social friends and set of implicit social friends of a target user into the trained depth graph model and the trained width linear attention model respectively, and obtain the local rating prediction and global rating prediction of the target user accordingly. Then, use Equation (11) to calculate the target user's rating of the items, and select the K items with the highest rating to recommend to the target user, thereby completing the item recommendation for the target user.
[0075] The present invention provides an electronic device, including a memory and a processor, characterized in that the memory is used to store a program supporting the processor in executing the item recommendation method, and the processor is configured to execute the program stored in the memory.
[0076] The present invention discloses a computer-readable storage medium storing a computer program, characterized in that the computer program, when executed by a processor, performs the steps of the item recommendation method.
[0077] Compared with existing technologies, the beneficial effects of this invention are reflected in:
[0078] 1. This invention addresses the imbalance and sparsity of social relationship distribution to some extent by mining implicit relationships between users and items. By predicting and weighting global and local scores, it mitigates the bias caused by noisy nodes and the impact of overfitting on the score prediction results. At the same time, by constraining user scores, it ensures the relative positional relationship between users and items, better reflects user preferences, improves model performance and overall generalization ability, and ensures that the model can have a more comprehensive understanding of user-item relationships, further improving the accuracy and stability of recommendation results.
[0079] 2. This invention proposes a semantic and structural view fusion model for predicting user rating behavior. By introducing the definition of implicit relationships, a heterogeneous information network is constructed. Based on two different view models, the explicit and implicit relationship features of users and items are extracted. The global and local feature information obtained by the two models are fused, which integrates user rating constraints, deepens the understanding of user preferences, and is conducive to improving the overall performance of the recommendation system. Attached Figure Description
[0080] Figure 1 This is a heterogeneous information network diagram of the method of the present invention;
[0081] Figure 2 This is the depth map model of the method of the present invention;
[0082] Figure 3 This is the width-linear attention model of the method of the present invention;
[0083] Figure 4 This is a recommended flowchart of the method of the present invention. Detailed Implementation
[0084] In this embodiment, a method for item recommendation that integrates semantic and structural views for social recommendation is presented, such as... Figure 4 As shown, the procedure is as follows:
[0085] Step 1: Define implicit relationships in social recommendation:
[0086] Step 1.1: Let U = {u1, ..., u} i ,…,u M} represents the user set, u i Let V represent any i-th user, 1≤i≤M, where V={v1,…,v a , ..., v N} represents a set of items, v a Let a represent any a-th item, where 1 ≤ a ≤ N;
[0087] Let the user rating matrix be denoted as R = {r ia} M×N Let r represent the ratings of all users in user set U for all items in item set V, where r ia Represents any i-th user u i For any a-th item v a The rating;
[0088] Let the user social matrix be denoted as S = {s} ik} M×M Indicates whether each user in the user set U follows other users, where s ik Represents any i-th user u iDo you want to follow any k-th user u? k If the i-th user u i Follow the kth user u k Then let s ik =1, otherwise, let s ik =0;
[0089] Let the i-th user u i Let F be the collection of social friends. U (i)={u k |s ik =1};1≤k≤M;andi≠k;
[0090] Step 1.2: Let the i-th user u i The set of implicit social friends is denoted as H. U (i)={u ij |||s ik =1∩s jk =1||≥τ}, where, u ij Represents the i-th user u i Hidden social friends, s ik =1∩s jk =1 indicates that the i-th user u i The k-th user u that is being followed k At the same time, it also followed the j-th user u. j τ represents the cutoff threshold, 1≤τ; 1≤j≤M; and j≠k; the set of implicit social friends can be interpreted as users with common followers may have similar preferences. The larger τ is, the more common followers are needed to establish implicit user relationships.
[0091] Get the a-th item v a And the bth item v b The set of users U who all provided ratings ab U ab ∈U; Use equation (1) to obtain the user set U ab The i-th user u i For the a-th item v a With the b-th item v b similarity of ratings between
[0092]
[0093] In equation (1), r ib Represents the i-th user u i For any b-th item v b The score; 1≤b≤N; and a≠b;
[0094] The user set U is obtained using equation (2).ab All users in the middle have views on item v of the a-th item. a With the b-th item v b Cumulative similarity value between ratings (sim) ab Thus, the a-th item v is obtained. a The cumulative set of rating similarity values between the item and other items;
[0095]
[0096] Based on the cumulative score similarity value set, related items are sorted in descending order to obtain the a-th item v. a The set of implicit item relations H V (a) The set of implicit item relationships can be interpreted as the more similar the common user ratings of two items are, the higher the similarity between the two items.
[0097] Step 2: Construct a heterogeneous information network and define meta-paths:
[0098] like Figure 1 As shown, each user and each item are treated as nodes. The social friend set and implicit social friend set of each user are used as the explicit and implicit relationships between each user node. The implicit item relationship set of each item is used as the implicit relationship between each item node. In this way, the edges between each node are constructed, and a heterogeneous information network HIN is formed.
[0099] Five types of user meta-paths are defined, including three types of single-hop neighbor meta-paths and two types of double-hop neighbor meta-paths. Among them, the three types of single-hop neighbor meta-paths consisting of two nodes and an edge connecting them are: user-item, user-user, and user-latent user. Here, user-item represents a user node to an item node and an edge connecting them; user-user represents a user node to another user node and an edge connecting them; and user-latent user represents a user node to another latent user node and an edge connecting them.
[0100] Two types of user double-hop neighbor meta-paths, consisting of three nodes and their two connected edges, are: user-user-item and user-latent user-item. User-user-item represents a user node to another user node and its connected edge, and a second user node to an item node and its connected edge. User-latent user-item represents a user node to a latent user node and its connected edge, and a latent user node to an item node and its connected edge.
[0101] Three types of item metapaths are defined, including: item-user, item-implicit item, and item-implicit item-user; where item-user represents an item node to a user node and an edge connected to it, item-implicit item represents an item node to an implicit item node and an edge connected to it, and item-implicit item-user represents an item node to an implicit item node and an edge connected to it, as well as an implicit item node to a user node and an edge connected to it.
[0102] Step 3: Extract local score predictions;
[0103] Step 3.1: After randomly removing some nodes and their associated edges from the heterogeneous information network HIN, the preprocessed heterogeneous information network HIN′ is obtained. In specific implementation, DropNode can be used to randomly remove nodes and associated edges, the capacity of the user-item bilateral graph is 30, the capacity of the user's social friends is 20, and the top 20 users and items are selected as implicit user-item relationships.
[0104] Step 3.2: Obtain the i-th user u from HIN′ using an embedding layer. i eigenvector p i ∈R d and the a-th item v a eigenvector q a ∈R d′ d′ represents the dimension of the feature vector;
[0105] Step 3.3, as follows Figure 2 As shown, a deep graph model is constructed, consisting of an attention-based graph convolutional network, a user local feature extraction module, an item local feature extraction module, and a local prediction module; the graph convolutional neural network has embedding sizes of 80, a dropout ratio of 0.5, and a slope of 0.2 for the Leaky ReLU activation function.
[0106] Step 3.3.1, p i q a The input is processed in an attention-based graph convolutional network to obtain five types of user meta-path output vectors, including: embedding vectors based on user-item meta-paths. Embedded vectors based on user-user meta paths Embedded vectors based on user-user-item meta paths Embedding vectors based on user-latent user metapath Embedded vectors based on user-latent user-item meta-path
[0107] Step 3.3.2: The user local feature extraction module processes the output vectors of the five user metapaths using equation (2) to obtain the i-th user u. i Local feature embedding vector
[0108]
[0109] In equation (2), MLP represents the concatenation operation. user This represents a multi-layer feedforward neural network in the user local feature extraction module.
[0110] Step 3.3.3: Transfer the i-th user u i eigenvector p i and the a-th item v a eigenvector q a The input is processed in an attention-based graph convolutional network to obtain three types of item meta-path output vectors, including: embedding vectors based on item-user meta-paths. Embedding vectors based on item-latent item metapaths Embedded vectors based on item-implicit item-user meta path
[0111] Step 3.3.4: The item local feature extraction module processes the output vectors of the three item metapaths using equation (3) to output the a-th item v. a Local feature embedding vector
[0112]
[0113] In equation (3), MLP item This represents a multi-layer feedforward neural network in the local feature extraction module for items.
[0114] Step 3.3.5, will The input is processed in the local prediction module, and the i-th user u is obtained using equation (4). i For the a-th item v a Local score prediction
[0115]
[0116] In equation (4), MLP deep This represents a multilayer feedforward neural network in the local prediction module;
[0117] Step 4: Extract global score predictions;
[0118] Step 4.1: Based on the i-th user ui H, a collection of implicit social friends U (i) Obtain the i-th user u from HIN using the embedding layer. i The latent eigenvector p′ i ∈R d′ and potential influence vector x i ∈R d′ And based on the implicit item relation set H of the a-th item V (a) Obtain the a-th item v from HIN using the embedding layer. a latent eigenvectors q′ a ∈R d and potential influence vector y a ∈R d′ ;
[0119] Step 4.2, as follows Figure 3 As shown, a width-based linear attention model is constructed, consisting of a user global feature extraction module, an item global feature extraction module, and a global prediction module.
[0120] Step 4.2.1: The user global feature extraction module uses three types of user single-hop neighbor meta-paths and equations (5) to (8) to obtain the i-th user u. i Global feature embedding vector
[0121]
[0122]
[0123]
[0124]
[0125] In equation (8), α ik ∈α represents the i-th user u i For the k-th user u k Attention weights, β ij ∈β represents the i-th user u i For the jth user in the hidden social friends ij Attention weights, γ ia ∈× represents the i-th user u i For the a-th item v a Attention weights, R V (i)∈R represents the i-th user u i The set of items with ratings is given; W1, W2, W3, W4, W5, W6 are six trainable parameter matrices, b1, b2, b3 are three bias vectors; σ is the activation function, softmax is the normalization function; T is the transpose.
[0126] Step 4.2.2: The global feature extraction module for items uses equation (9) to obtain the a-th item v. a Global feature embedding vector
[0127]
[0128] In equation (9), η ab ∈η represents the a-th item v a For the b-th implicit similar item v b Attention weights;
[0129] Step 4.2.3, Input into the global prediction module, and use equation (10) to obtain the i-th user u i For the a-th item v a Global score prediction
[0130]
[0131] In equation (10), b i For the i-th user u i User bias, b a For the a-th item v a The item bias is μ, which is the average of all user ratings for all items. In practice, the TrustSVD algorithm can be used directly. Perform linear combinations.
[0132] Step 5: Use equation (11) to obtain the i-th user u i For the a-th item v a Rating prediction results
[0133]
[0134] In equation (11), λ represents the scoring weight coefficient;
[0135] Step 6: Construct constraints for user rating behavior;
[0136] Step 6.1: Define a triplet (u, r, v) for user ratings of items, where u∈U represents the user entity, v∈V represents the item entity, and r∈R represents the rating relationship. Calculate the feature vector using the TransH algorithm, including: the user entity feature vector e. u Item entity feature vector e v The rating relationship feature vector e r ;
[0137] According to equations (12) and (13), e is obtained u e v The eigenvectors of the hyperplane of relation r
[0138]
[0139]
[0140] In equations (12) and (13), w r Here is the normal vector to the corresponding hyperplane; T denotes the transpose.
[0141] Step 6.2: Construct the rating function f(u, r, v) for the rating triple (u, r, v) using equation (14):
[0142]
[0143] Step 6.3: Construct the marginal loss function L using equation (15). KG :
[0144]
[0145] In equation (16), [f(·)] + Let max(0, f(·)), v′ represent another item entity, (u, r, v′) represent the spurious triple generated by v′ replacing v, v′∈V; f(u, r, v′) represents the rating function of the spurious triple (u, r, v′); in specific implementation, a rating-based cross-sampling substitution method is used to generate spurious triples, and all spurious items / users in the spurious triples should be sampled from the rated items / users whose ratings are lower than those in the real triples.
[0146] Step 7: Construct the loss function L of the depth map model using equation (14). D :
[0147]
[0148] In equation (14), λ1 and λ2 are regularization parameters, P represents the matrix composed of all user feature vectors, and Q represents the matrix composed of all item feature vectors.
[0149] The loss function L of the width linear attention model is constructed using equation (15). W :
[0150]
[0151] In equation (15), λ3 is the regularization parameter, P′ represents the matrix composed of all user latent feature vectors, Q′ represents the matrix composed of all item latent feature vectors, X represents the matrix composed of all user latent influence vectors, and Y represents the matrix composed of all item latent influence vectors. In specific implementations, different embedding parameters are assigned to the depth graph model and the width linear attention model respectively to enhance the flexibility of the fusion model. The learning rate of the depth graph model is 0.001, and the learning rate of the width linear attention model is 0.05. The regularization parameters are λ1 = 2, λ2 = 0.0001, and λ3 = 0.05.
[0152] Step 7: Train the depth map model and the width linear attention model using gradient descent, and calculate the loss function L accordingly. D and loss function L W The model parameters are updated until the loss function converges, thus obtaining the trained depth map model and the trained width linear attention model.
[0153] Step 8, as follows Figure 4 As shown, for a target user, the item set, user rating matrix, target user social friend set and implicit social friend set are input into the trained depth graph model and the trained width linear attention model respectively, and the local rating prediction and global rating prediction are obtained accordingly. Then, the target user's rating of the items is calculated using Equation (11), and the top K items with the highest ratings are selected to recommend to the target user, thus completing the item recommendation for the target user.
[0154] In this embodiment, an electronic device includes a memory and a processor. The memory stores a program that supports the processor in executing the above-described article recommendation method, and the processor is configured to execute the program stored in the memory.
[0155] In this embodiment, a computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the above-described item recommendation method.
[0156] In summary, this method enhances the robustness and generalization ability of earlier social recommendation models by utilizing a semantic and structural view fusion model. The model simultaneously considers feature learning based on explicit and implicit relationships, model fusion, and the relative positional relationship of user ratings. It can still guarantee the accuracy and stability of recommendations under different imbalances and sparsity conditions of social relationship distribution. The generalization and effectiveness of the method in this invention are superior to single-view model recommendation methods.
Claims
1. A semantic and structural view fusion oriented socialized recommendation method for item recommendation, characterized in that, is performed as follows: Step 1, define the implicit relationship in social recommendation: Step 1.1, let represent a set of users, represent an arbitrary user, , represent a set of items, represent an arbitrary a item, ; Let the user rating matrix be denoted as Represents a set of users All user-to-item collections The ratings of all items, among which, Represents any number of individual users For any number a Items The rating; Let the user social matrix be denoted as Represents a set of users Does each user in the list follow other users? Represents any number of individual users Do you care about any number? individual users If the first individual users Pay attention to the individual users Then let Otherwise, let ; Let the set of social friends of the first user be denoted as ; ; ; and ; Step 1.2, let the implicit social friend set of the i-th user be denoted as wherein, denotes a cutoff threshold, ; and ; Get the first a Items and the b Items The set of users who provided ratings , The user set is obtained using equation (1). The Middle individual users For the a Items With the b Items similarity of ratings between : (1) In formula (1), represents the rating of the th user to the b th item ; and ; and ; The user set is obtained using equation (2). All users in the middle of the first a Items With the b Items Cumulative similarity of ratings between Thus, the first a Items The cumulative set of rating similarity values between the item and other items; (2) According to the score similarity cumulative value set, the related items are sorted in descending order, thereby obtaining a set of implicit item relationships of the first item a ; Step 2, build a heterogeneous information network and define a meta path: Each user and each item is taken as a node, each user's social friend set and implicit social friend set is taken as the explicit and implicit relationship between each user node, each item's implicit item relationship set is taken as the implicit relationship between each item node, thereby constructing the edge between each node and forming a heterogeneous information network ; Define five kinds of user meta paths, including three kinds of user single-hop neighbor meta paths and two kinds of user double-hop neighbor meta paths; Among them, the three kinds of user single-hop neighbor meta paths composed of two nodes and one edge between them include: user-item, user-user, user-implicit user; Among them, user-item indicates a user node to an item node and an edge connected between them; User-user indicates a user node to another user node and an edge connected between them; User-implicit user indicates a user node to another implicit user node and an edge connected between them; The two kinds of user double-hop neighbor meta paths composed of three nodes and two edges connected between them include: user-user-item, user-implicit user-item; Among them, user-user-item indicates a user node to another user node and an edge connected between them, and a second user node to an item node and an edge connected between them; User-implicit user-item indicates a user node to an implicit user node and an edge connected between them, and an implicit user node to an item node and an edge connected between them; Define three kinds of item meta paths, including: item-user, item-implicit item, item-implicit item-user; Among them, item-user indicates an item node to a user node and an edge connected between them, item-implicit item indicates an item node to an implicit item node and an edge connected between them, item-implicit item-user indicates an item node to an implicit item node and an edge connected between them, and an implicit item node to a user node and an edge connected between them; Step 3, extract local rating prediction; Step 3.1, randomly removing isomorphic information networks After removing some nodes and their associated edges in the middle part of the isomorphic information network, the pre-processed isomorphic information network is obtained ; Step 3.2, obtaining the feature vector of the first user and the feature vector of the first item from the embedding layer denotes the dimension of the feature vector; Step 3.3, build a deep graph model composed of a graph convolution network based on an attention mechanism, a user local feature extraction module, an item local feature extraction module, and a local prediction module; Step 3.3.1, obtaining The input is processed in the attention mechanism-based graph convolution network to obtain the output vectors of five user meta-paths, including: embedding vectors based on user-item meta-paths , embedding vectors based on user-user meta-paths , embedding vectors based on user-user-item meta-paths , embedding vectors based on user-hidden user meta-paths , and embedding vectors based on user-hidden user-item meta-paths ; Step 3.3.2, the user local feature extraction module processes the output vectors of the five user meta-paths using formula (3) to obtain the local feature embedding vector of the first user : (3) In formula (3), represents a juxtaposition operation, represents a multi-layer feedforward neural network in the user local feature extraction module; Step 3.3.3, the first individual users eigenvectors and the Items eigenvectors The input is processed in an attention-based graph convolutional network to obtain three types of item meta-path output vectors, including: embedding vectors based on item-user meta-paths. Embedded vectors based on item-implicit item metapath Embedded vectors based on item-implicit item-user metapath ; Step 3.3.4, the item local feature extraction module processes the output vectors of the three item meta-paths using formula (4) to output the local feature embedding vector of the first item : (4) In formula (4), represents a multi-layer feedforward neural network in the item local feature extraction module; Step 3.3.5, will , Input into the local prediction module, and use equation (5) to obtain the first... individual users For the Items Local score prediction : (5) In formula (5), denotes a multi-layer feed-forward neural network in the local prediction module; Step 4, extract global rating prediction; Step 4.1, obtaining a latent feature vector and a latent influence vector of the first user from the first user according to the first user relationship set and the implicit social friend set of the first user, and obtaining a latent feature vector and a latent influence vector of the first item from the first item according to the first item relationship set and the implicit item relationship set of the first item; ; Step 4.2, build a width linear attention model composed of a user global feature extraction module, an item global feature extraction module, and a global prediction module; Step 4.2.1, the user global feature extraction module obtains the global feature embedding vector of the first user based on the three user single-hop neighbor meta-paths and by using formula (6) to formula (9) : (6) (7) (8) (9) In formula (8), denotes the attention weight of the th user to the th user , denotes the attention weight of the th user to the th user in the implicit social friends, denotes the attention weight of the th user to the th item , denotes the set of items that the th user has given a rating to; , , , , , are six trainable parameter matrices, , , are three bias vectors; σ is an activation function, denotes a normalization function; denotes a transpose; Step 4.2.2, the article global feature extraction module obtains the global feature embedding vector of the first article using formula (10) : (10) In formula (10), represents the first object attention weight of the first implicit similar object ; Step 4.2.3, the global prediction module is inputted into, and the global rating prediction of the first user for the first item is obtained by using formula (11) , Input the global prediction module, and obtain the global rating prediction of the first user for the first item by using formula (11) : (11) In equation (11), For the first individual users User bias, For the first Items Item deviation, The average of all user ratings for all items; Step 5, obtaining the first user rating prediction result for the first item : (12) In formula (12), denotes a score weight coefficient; Step 6, build constraints for user rating behavior; Step 6.1, defining a rating triple of a user to an item wherein, denotes a user entity, denotes an item entity, denotes a rating relation, the characteristic vectors are calculated by the TransH algorithm, comprising: a user entity characteristic vector , an item entity characteristic vector , and a rating relation characteristic vector ; According to equations (13) and (14) , In the user entity feature projection vector of the hyperplane of the relationship r and the item entity feature projection vector : (13) (14) in formula (13) and formula (14), is the normal vector of the corresponding hyperplane; Step 6.
2. Constructing rating triples with formula (15) of the scoring function : (15) Step 6.
3. Constructing the marginal loss function with formula (16) : (16) In formula (16), denotes , denotes another item entity, denotes substitutes the generated false triple, ; denotes a scoring function of the false triple ; Step 7, constructing a loss function for the depth map model using formula (17) : (17) In formula (17), λ1, λ2 are regularization parameters, denotes a matrix composed of all user feature vectors, denotes a matrix composed of all item feature vectors; Constructing a loss function of the width linear attention model using formula (18) : (18) In formula (18), λ3 is a regularization parameter, denotes a matrix composed of all user latent feature vectors, denotes a matrix composed of all item latent feature vectors, denotes a matrix composed of all user latent influence vectors, denotes a matrix composed of all item latent influence vectors; Step 7, training the depth map model and the width linear attention model respectively by using gradient descent method, and calculating loss function accordingly and loss function to update the model parameters until the loss function converges, thereby obtaining the trained depth map model and the trained width linear attention model; Step 8, input the item set of a target user, the user rating matrix, the target user's social friends set and the implicit social friends set into the trained deep graph model and the trained width linear attention model respectively, and correspondingly obtain the local rating prediction and the global rating prediction of the target user, so as to calculate the rating of the target user to the item by using formula (11), and select the top K items with high rating to recommend to the target user, thereby completing the item recommendation for the target user.
2. An electronic device comprising a memory and a processor, characterized in that The memory is used to store a program supporting the processor to execute the item recommendation method of claim 1, and the processor is configured to execute the program stored in the memory.
3. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to perform the steps of the item recommendation method of claim 1.
Citation Information
Patent Citations
Multi-attention recommendation method based on collaborative filtering and deep learning
CN113792810A
Interpretable recommendation method based on graph neural network inference
WO2022222037A1