A social recommendation method based on dynamic hypergraph representation learning
By employing a dynamic hypergraph representation learning method, which combines hypergraph convolutional neural networks and attention neural networks with long short-term memory networks, the problem of traditional recommendation systems being unable to capture high-order relationships is solved, enabling dynamic capture and accurate recommendation of user-item relationships.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG NORMAL UNIV
- Filing Date
- 2023-03-21
- Publication Date
- 2026-04-21
AI Technical Summary
Traditional graph neural network-based recommendation systems cannot effectively capture high-order relationships between users and items, nor can they distinguish the importance of different time periods, resulting in insufficient accuracy of recommendation information.
We employ a dynamic hypergraph representation learning approach. By acquiring multiple hypergraphs, we use a hypergraph convolutional neural network and an attention neural network combined with a long short-term memory network to dynamically learn the embeddings of users and items, taking into account the time-varying user-item relationships, and then determine the predicted score.
It improves the accuracy of social recommendations by dynamically capturing changes in higher-order relationships between users and projects, thereby enhancing the precision of recommendations.
Smart Images

Figure CN116204723B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of social recommendation technology, and in particular to a social recommendation method based on dynamic hypergraph representation learning. Background Technology
[0002] In online social networks, user-item interactions exhibit a graph structure, and users' historical behavior reflects their personal preferences, which is of significant value for data analysis in social recommendation systems. However, while traditional graph neural network-based recommendation systems can capture multi-hop higher-order relationships between nodes using stacked multi-layer graph neural networks, they fail to capture higher-order relationships with specific motifs. Most current recommendation system methods analyze user-item relationships in parallel using user-user graphs, item-item graphs, and user-item relationship graphs. This traditional, singular approach fails to distinguish the importance of different time periods, thus hindering the accuracy of recommendation information.
[0003] Therefore, the aforementioned technical problems urgently need to be solved. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a social recommendation method based on dynamic hypergraph representation learning, so as to make accurate recommendations to users in accordance with time changes.
[0005] One aspect of this invention provides a social recommendation method based on dynamic hypergraph representation learning, comprising:
[0006] Multiple hypergraphs are obtained, each determined based on the relationships between several users and several projects within a set time period; users and projects serve as nodes of the hypergraph, while social relationships between users and purchase relationships between users and projects serve as hyperedges of the hypergraph.
[0007] The multiple hypergraphs are respectively input into a hypergraph convolutional neural network and an attention neural network, and then passed through a long short-term memory network to obtain user embeddings and item embeddings;
[0008] The predicted score for each user for each item is determined based on the user embedding and the item embedding.
[0009] Optionally, the step of inputting the plurality of hypergraphs into a hypergraph convolutional neural network and an attention neural network, respectively, and passing them through a long short-term memory network to obtain user embeddings and item embeddings, includes:
[0010] The multiple hypergraphs are input into a hypergraph convolutional neural network and passed through a first long short-term memory network to obtain a first user embedding and a first item embedding.
[0011] The multiple hypergraphs are input into an attention neural network and then passed through a second long short-term memory network to obtain a second user embedding and a second item embedding.
[0012] Optionally, the step of inputting the plurality of hypergraphs into a hypergraph convolutional neural network and passing them through a first long short-term memory network to obtain a first user embedding and a first item embedding includes:
[0013] The transition probabilities between each vertex of the hypergraph are calculated using the hypergraph convolutional neural network, so that the embedding of each vertex is passed between the layers of the hypergraph convolutional neural network, and then passed through the first long short-term memory network to obtain the first user embedding and the first item embedding.
[0014] Optionally, the step of inputting the plurality of hypergraphs into an attention neural network and passing them through a second long short-term memory network to obtain a second user embedding and a second item embedding includes:
[0015] The attention hyperedge aggregation module in the attention neural network is used to aggregate information about hyperedges and generate hyperedge embeddings.
[0016] The attention vertex aggregation module in the attention neural network is used to aggregate information about vertices and generate vertex embeddings.
[0017] The hyperedge embedding and the vertex embedding are passed through a second long short-term memory network to obtain a second user embedding and a second item embedding.
[0018] Optionally, the method further includes:
[0019] Determine each user's actual score for each item;
[0020] The predicted score for each user on each item is recalculated based on the predicted score, the actual score, and the preset objective function.
[0021] Optionally, the step of redetermining the predicted score for each user for each item based on the predicted score, the actual score, and a preset objective function includes:
[0022] The predicted score for each user for each item is recalculated based on the average absolute error between the predicted score and the actual score, the square root of the average squared difference between the predicted score and the actual score, and the objective function.
[0023] The expression for the objective function is: Where τ represents paired training data, r ui Let θ represent the predicted score of user u on item i, Θ represent all model parameters, σ(·) represent the sigmoid function, and λ represent the regularization parameter.
[0024] Optionally, the construction process of the hypergraph includes:
[0025] The first hypergraph is built based on users purchasing the same project;
[0026] Construct a second hypergraph based on the set of users who purchased the same project;
[0027] Build a third hypergraph based on users with social relationships purchasing the same project;
[0028] A fourth hypergraph is constructed based on users who do not have social relationships purchasing the same project;
[0029] A fifth hypergraph is constructed based on the social relationships between users.
[0030] Another aspect of this invention provides a social recommendation device based on dynamic hypergraph representation learning, comprising:
[0031] The hypergraph acquisition unit is used to acquire multiple hypergraphs. Each hypergraph is determined based on the relationships between several users and several projects within a set time period. Users and projects are the nodes of the hypergraph, and the social relationships between users and the purchase relationships between users and projects are the hyperedges of the hypergraph.
[0032] The embedding acquisition unit is used to input the multiple hypergraphs into the hypergraph convolutional neural network and the attention neural network respectively, and then pass them through the long short-term memory network to obtain the user embedding and the item embedding.
[0033] The recommendation prediction unit is used to determine the prediction score for each user for each item based on the user embedding and the item embedding.
[0034] Another aspect of the present invention provides an electronic device, including a processor and a memory;
[0035] The memory is used to store programs;
[0036] The processor executes the program to implement the above-described method.
[0037] Another aspect of this invention provides a computer-readable storage medium storing a program that is executed by a processor to implement the above-described method.
[0038] This invention also discloses a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium and execute the computer instructions, causing the computer device to perform the method described above.
[0039] This invention acquires multiple hypergraphs corresponding to set time periods and inputs these hypergraphs into a hypergraph convolutional neural network and an attention neural network, respectively. In social recommendation, it considers the impact of time on the relationships between users and between users and items, that is, the user's identity and interests and the attractiveness of the item may change dynamically. Based on the user embedding and item embedding, the predicted score of each user for each item is determined, which can determine the degree of liking of each user for each item, thereby making a recommendation. This invention improves the accuracy of social recommendation. Attached Figure Description
[0040] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 This is a flowchart illustrating a social recommendation method based on dynamic hypergraph representation learning, provided in an embodiment of the present invention.
[0042] Figure 2 An example flowchart of a social recommendation method based on dynamic hypergraph representation learning provided in an embodiment of the present invention;
[0043] Figure 3 Explanatory diagrams of the variables and their meanings provided for embodiments of the present invention;
[0044] Figure 4 An example diagram of a social relationship provided in an embodiment of the present invention;
[0045] Figure 5 Another example diagram of social relationships provided in this embodiment of the invention;
[0046] Figure 6 A graph structure and hypergraph for a social recommendation network provided in this embodiment of the invention;
[0047] Figure 7 This is a schematic diagram of a user project hypergraph structure provided in an embodiment of the present invention;
[0048] Figure 8 This is a structural diagram of a social recommendation model based on dynamic heterogeneous hypergraph representation learning, provided in an embodiment of the present invention.
[0049] Figure 9 This is a structural block diagram of a social recommendation device based on dynamic hypergraph representation learning, provided in an embodiment of the present invention. Detailed Implementation
[0050] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0051] Reference Figure 1 This invention provides a social recommendation method based on dynamic hypergraph representation learning, specifically including the following steps:
[0052] S100: Obtain multiple hypergraphs, each hypergraph is determined based on the relationships between several users and several projects within a set time period; where users and projects are the nodes of the hypergraph, and the social relationships between users and the purchase relationships between users and projects are the hyperedges of the hypergraph.
[0053] Specifically, the construction process of multiple hypergraphs can include:
[0054] S1. Build the first hypergraph based on users purchasing the same project.
[0055] S2. Construct a second hypergraph based on the set of users who purchased the same project.
[0056] S3. Build a third hypergraph based on users with social relationships purchasing the same item.
[0057] S4. Construct a fourth hypergraph based on users who do not have social relationships purchasing the same project.
[0058] S5. Construct a fifth hypergraph based on the social relationships between users.
[0059] Considering the impact of time on the relationships between users and between users and projects, this invention can first determine a set time period, such as one month or three months, and then construct the above five hypergraphs for the relationship between users and projects within each set time period, thereby obtaining hypergraphs within multiple consecutive set time periods.
[0060] S110: Input the multiple hypergraphs into the hypergraph convolutional neural network and the attention neural network respectively, and then through the long short-term memory network to obtain the user embedding and the item embedding.
[0061] Specifically, the process of obtaining user embeddings and project embeddings can include:
[0062] S1. Input the multiple hypergraphs into a hypergraph convolutional neural network and pass them through a first long short-term memory network to obtain a first user embedding and a first item embedding.
[0063] Specifically, the transition probabilities between each vertex of the hypergraph are calculated using the hypergraph convolutional neural network, so that the embedding of each vertex is passed between the layers of the hypergraph convolutional neural network, and then passed through the first long short-term memory network to obtain the first user embedding and the first item embedding.
[0064] S2. Input the multiple hypergraphs into the attention neural network and pass them through the second long short-term memory network to obtain the second user embedding and the second item embedding.
[0065] Specifically, the attention hyperedge aggregation module in the attention neural network is used to aggregate information about hyperedges and generate hyperedge embeddings; the attention vertex aggregation module in the attention neural network is used to aggregate information about vertices and generate vertex embeddings; the hyperedge embeddings and vertex embeddings are passed through a second long short-term memory network to obtain a second user embedding and a second item embedding.
[0066] S120: Determine the predicted score for each user for each item based on the user embedding and the item embedding.
[0067] To achieve better predictive recommendation results, the present invention may further include:
[0068] S1. Determine the actual score for each user for each item.
[0069] S2. Based on the predicted score, the actual score, and the preset objective function, redetermine the predicted score for each user for each item.
[0070] Specifically, the predicted score for each user for each item is recalculated based on the average absolute error between the predicted score and the actual score, the square root of the average squared difference between the predicted score and the actual score, and the objective function.
[0071] The expression for the objective function is: Where τ represents paired training data, r ui Let θ represent the predicted score of user u on item i, Θ represent all model parameters, σ(·) represent the sigmoid function, and λ represent the regularization parameter.
[0072] To describe the invention in more detail, specific examples will be used to illustrate its practical application.
[0073] Reference Figure 2 This invention provides an example flowchart of a social recommendation method based on dynamic hypergraph representation learning. (Refer to...) Figure 3 The embodiments of the present invention provide explanatory diagrams of the variables used in the following processes and their meanings. The embodiments of the present invention will now be described in seven parts.
[0074] 1. Main assumptions and problem description.
[0075] Item-to-item similarity, friend-user, and stranger-user information are difficult to extract: if two friends buy the same item, their relationship is more important than just a social connection. Purchase details of strangers buying the same product are often overlooked. Figure 4 As shown.
[0076] For example, if two friends buy the same item, their relationship is more important than their social connection. Purchase details of the same product by strangers are often overlooked. Figure 4 This demonstrates that (A, B) and (D, F) have a strong relationship, shown by solid lines, because they have a social connection and also purchase the same products, while (B, C), (D, E), and (E, F) only have a social connection, shown by dashed lines. Conversely, (C, D) is shown by dashed lines, representing strangers who have no social connection but purchase the same items; often, the purchase details of C and D are overlooked.
[0077] Users' social circles, interests, and the attractiveness of their items may change: Considering that users' interests and the attractiveness of their items can dynamically change over time, to capture this user-item relationship, we depict how the attractiveness of users' social circles and items changes dynamically over time, leading to corresponding changes in relationships between users, between users and items, and between items, such as... Figure 5 As shown.
[0078] Figure 5 This illustrates a motivating example where user interests and project appeal can change over time and be influenced by their relationships. On the user side, in real life, User A's social circle changes with their education, employment, and job changes. On the project side, projects may exhibit similar patterns to users. User attention to items also changes over time; for example, during the World Cup, user interest in football gradually increases, while as the World Cup fervor subsides, the interest in football slowly returns to normal. Therefore, in addition to considering the correlation between projects, the project's appeal over time should also be considered. Overall, interaction representation can refer to user interests and project appeal. Relationship influence refers to the user's social influence and the project's relevance.
[0079] Therefore, the social recommendation problem in this invention can be defined as follows: given an observed dynamic heterogeneous hypergraph containing user-item interactions and social relationships, the recommender should predict unknown interactions of users in user-item interactions. That is, unobserved items v j User ui The rating is worth points or unobserved candidate items v j User u i The probability of clicking.
[0080] 2. Definition of heterogeneous hypergraph.
[0081] A hypergraph H = V, E, where V = {v1, v2, ... v} N} and E = {e1, e2, ... e M} where V represents the set of nodes in the hypergraph, and E represents the set of edges in the hypergraph, also known as hyperedges. A hyperedge is a non-empty subset of nodes; unlike a graph, it can connect multiple nodes. The incidence matrix is used to represent the hypergraph. N and M are represented by a set of nodes and a hyperedge, respectively. H is defined as follows: if a node is connected and exists within a hyperedge, then H... i =1, otherwise 0. Figure 6 The graph structure and hypergraph used in social recommendation networks are described. Figure 6 In the example on the left, social relationships and user-item graphs are two fundamental graphs. The user-item bipartite graph represents user u. i Purchased project v j The social graph illustrates the connections between users in a social network. Adjacency matrices P and U describe the basic graph, user-item relationships, and social relationships, respectively. ij =1, if U i Purchased item V h Otherwise, it is 0; similarly, U ih =1, if U i and U h There must be social connections; otherwise, the value is 0. Figure 6 In the right center, the association matrix H is used to describe the hypergraph of links between users and between users and items. If node H... i If the edge exists within a hyperedge, the input to the incidence matrix is 1; otherwise, it is 0. For simplicity, Figure 6 The right side uses only two types of hyperedges. In the hypergraph, e1, e2, and e3 represent items v1, v2, and v3 purchased by a group of users, respectively. e4, e5, e6, e7, and e8 in the hypergraph illustrate the social connections between friends. Hyperedges connect several nodes in the hypergraph, thus improving higher-order relevance. However, a simple graph cannot describe the complex higher-order relationships between users and items.
[0082] exist Figure 6 The bipartite graph in the middle (left) illustrates the relationship between users and items. Similarly, the social relationship graph represents user-user links. Both graphs are represented using corresponding adjacency matrices. Figure 6The same data is present on the right-hand hypergraph. The hypergraph shows 8 hyperedges (e1-e8), 5 users (u1-u5), and 3 items (v1-v3). Hyperedge e1 indicates that users u1 and u2 acquired item v1. Hyperedge e2 indicates that users u3 and u4 purchased item v2. Hyperedge e3 indicates that users u4 and u5 purchased item v3. Hyperedge e4 proves that user u1 is a partner of u2, u3, u4, and u5. Hyperedge e5 shows the friendship between u2 and users u1 and u3. Hyperedge e6 indicates that user u3 is a friend of users u1 and u2. Hyperedge e7 indicates that user u4 is a friend of user u1, and hyperedge e8 indicates that user u5 is a friend of user u1.
[0083] 3. Hypergraph Convolutional Network.
[0084] In a hypergraph, the convolutional network operation estimates the transition probabilities between vertices so that the embedding of each vertex can be transferred within the GNN. A hypergraph convolutional network is defined as follows:
[0085] (X) (l+1) =σ(D -1 / 2 HL -1 H T D -1 / 2 (X) (l) P) (1)
[0086] In formula (1), σ(·) is a nonlinear activation function. H is the hypergraph incidence matrix, (X) () It is the embedding of the vertex features of the l-th layer. Where the trainable parameters P are considered as a matrix (weights) between the l-th and l+1-th layers, Features of the input vertex at layer l The input vertex is a feature at layer (l+1). (X) () This is the output of layer l+1. D represents the degree matrix of the vertices and L hyperedges in the hypergraph. Both D and L are diagonal matrices.
[0087] H defines the message passing path from a vertex to a hyperedge, where the hyperedge is considered a column and the vertex is a row in the incidence matrix. T The vertices of the hyperedge messaging path are specified, where the vertices will be columns and the hyperedge will be H. T The line in the middle.
[0088] First, through H T Vertex features are collected to construct super-edge features. Then, by aggregating the associated super-edge features, enhanced vertex features are obtained through H. The final step involves training the P model and applying the σ(·) nonlinear activation function.
[0089] In summary, hypergraph convolutional network operations can manage higher-order dependencies.
[0090] 4. Construction of dynamic heterogeneous hypergraphs.
[0091] For the specific structure of the hypergraph, this embodiment of the invention first unifies the user-item bipartite graph and social networks to more accurately describe the higher-order relationships between users and items, and then constructs a dynamic heterogeneous hypergraph. The hypergraph includes item nodes, user nodes, and hyperedges. Hyperedges represent higher-order relationships between different types of nodes. In this embodiment, five themes are designed to guide the hypergraph creation framework in defining the appropriate structure in user items and user-user networks. Figure 7 The pattern in the hypergraph is displayed. Figure 8 This demonstrates the dynamic heterogeneous hypergraph neural network framework model for this social recommendation system.
[0092] The first type of topic is "a set of items purchased by a user," which this embodiment names a user topic. This can identify strong user connections and helps to locate user interest communities. The second type is "a set of users who purchased goods"; this embodiment names this a product topic. This type of topic identifies item-to-item similarity based on user purchases. "A friend bought an item" and "A stranger bought an item" are the third and fourth topic categories, respectively. This embodiment names the third and fourth topic types the friend and stranger topics, respectively. The last type is "social relationships." This topic identifies a user's list of friends, and this embodiment names this type a social topic.
[0093] Existing research defines 2 M+N Instead of MN-1 hyperedges, this embodiment describes M+N+f+s hyperedges, where M and N represent the number of projects and the number of users, respectively. In contrast, f and s represent groups of friends and strangers, respectively. Compared to existing hypergraph models, this significantly reduces the time complexity of the hypergraph model proposed in this embodiment.
[0094] Furthermore, based on the five different categories of superedges defined in the heterogeneous hypergraph structure proposed in this embodiment of the invention, it helps to identify the optimal user-user and project-project attention for communities of interest and predict future behavior. In this step, the weight of the i-th hyperedge is also calculated. Formula (2) calculates its weight based on the degree of the i-th hyperedge. The degree of a hyperedge is the number of nodes contained within it.
[0095]
[0096] where deg(e) i The degree of the i-th hyperedge is defined by max(deg(e)). imin(deg(e)) and min(deg(e)) are the minimum and maximum degrees of all hyperedges, respectively.
[0097] To learn user and item representations, embodiments of the present invention employ a divide-and-conquer strategy. The hypergraph constructed from five topic categories can be divided into an equal number of hypergraphs to illustrate, as... Figure 5 The higher-order relations are shown. These hypergraphs are derived from the incident matrix H. Users H Items H Friends H str and H Social Indicates. Hypergraph H Users The association matrix contains information related to the "set of items purchased by the user". In this hypergraph, the user is the hyperedge, and all items are nodes. Hypergraph H Items The association matrix contains data related to the "set of users who purchased the item". This hypergraph represents items through super edges and users through nodes. Hypergraph H Friends The association matrix contains information about "a friend bought an item". In this hypergraph, hyperedges represent items, and nodes represent users connected through social connections. Hypergraph H str The association matrix contains information related to "users who have no social connections but purchase the same items." (Hypergraph) social The association matrix provides information about "socially connected users." It lists frequently encountered acquaintances.
[0098] Inspired by recent developments in spectral clustering, embodiments of this invention utilize multilayer perceptron (MLP) and softmax to compute superedge assignments for users or items. Each user e uk or project e ik Denotes the k of the corresponding hypergraph incidence matrix H th .
[0099] H user =softmax(ReLU(E) user W user,1 W user,2 (3)
[0100] H item =softmax(ReLU(E) item W item,1 W item,2 (4)
[0101] Where W is the trainable weight matrix for learning K hyperedges. Softmax is used to probabilistically assign a node to many hyperedges. All five types of hypergraphs use the same dynamic hypergraph learning. After learning the hypergraph, spectral hypergraph convolution is used as described in Equation (1). Modified Equations (5) to (9) define hypergraph convolution for specific hypergraphs:
[0102]
[0103]
[0104]
[0105]
[0106]
[0107] Obtain hypergraph-specific embeddings from equations (5) to (9). Learn the specific hypergraph H in equation (5). user User representation of high-order information encoded in the matrix. Matrix multiplication H user X user () Propagate the message from the node to the superedge, and then to X. user The pre-multiplication method is used to aggregate hyperedge information and update nodes.
[0108] In this section, embodiments of the invention learn how hypergraph convolutions help construct hypergraphs and capture higher-order information, such as item-to-item similarity, friends and strangers among users, and various ways in which users or items cluster together along hyperedges. Multiple user representations and project representation Through hypergraph convolution l th The representation is obtained from each layer. In formulas (10) and (11), the final representation can be formulated by connecting the representations from each layer.
[0109]
[0110]
[0111] Here, || represents a join operation.
[0112] The friend, stranger, and social hypergraph convolutions follow the same process, and their final representations can be combined by concatenating the representations of each layer. Friend, stranger, and social are the final representations, each represented by X. friend X str and X social Indicates. User characteristic X u By combining X user and X social It represents the result created. Similarly, the project aggregator X i Combined with X item X str and X friend The results are used to provide potential project characteristics.
[0113] 5. Hypergraph Attention Network.
[0114] This invention employs a Hypergraph Attention Network (HGAT). HGAT comprises two main components: an Attention Hyperedge Aggregation Module (AHA) and an Attention Vertex Aggregation Module (AVA). AHA aggregates information about hyperedges, while AVA aggregates information about nodes. The attention network receives the node embedding matrices and hyperedge embedding matrices of all five sub-hypergraphs as input.
[0115] AVA generates superedge embeddings by aggregating information about connected nodes. In this embodiment, a trainable weight matrix W is used to transform node and superedge features. Then, node i(v) is calculated in equation (12). i ) and superedge j(e j The coefficient matrix between ).
[0116]
[0117] Where 'a' represents the shared attention mechanism, and N... i Let W be a set of hyperedges connected to node i, and let W be the linear transformation weight matrix.
[0118] Hypergraph H containing information about "the set of users who purchased the item" item For learning accurate item embeddings, node representation v i (User), the superedge represents e j (Items), and the hypergraph H containing information about "the set of items purchased by the user". user Used to learn the user's embedding vector. The next layer user's node v. i Information comes from the superedge e j This information was obtained from the data. The attention coefficient matrix COE in equation (12) was obtained by using the nonlinear ReLU and softmax functions, where coe ij ∈[0,1]. The coefficient matrix is calculated in formula (13).
[0119] COE = H·softmax(ReLU(VW)(EW)) T (13)
[0120] Where H is the hyperedge correlation matrix (node-hyperedge relationship matrix), The node feature matrix, Let H be the hyperedge feature matrix. N and M represent the number of nodes and the number of hyperedges, respectively. user In this context, projects are nodes, and the project-user matrix is considered a hyperedge. Finally, this embodiment of the invention uses the coefficient matrix COE defined in formula (13) to calculate the weighted sum of the connected nodes in formula (14).
[0121] E features =σ[(COE) T V] (14)
[0122] Where σ is the activation function. Therefore, by using formula (14), the embodiment of the present invention can calculate E. features Hyperedge features. For example, in a hypergraph H user and H item In the middle, the characteristics are user E u And Project E i The same process is used to calculate the node functions of the AHA module. The super-edge-vertex attention coefficient matrix is calculated using formula (15).
[0123] COE = H·softmax(ReLU(EW)(VW)) T (15)
[0124] In order to generate node features, embodiments of the present invention may apply COE in formula (16).
[0125] E features =σ[(COE) T E] (16)
[0126] HGAT generates superedge features by aggregating the features of connected nodes, and these features are also updated with reference to the superedge features. HGAT can use this node-superedge-node transformation method to efficiently define higher-order relationships in the data. The same method is used to obtain node and superedge features for all five types of split hypergraphs.
[0127] The primary goal of hypergraph attention networks is to obtain an association matrix that reveals the relationships between hyperedges. People pay attention to a limited number of social connections; there cannot be an infinite number of social connections. From a social recommendation perspective, a basic simulation of attention is that if two users purchase similar product lists, their attention level is high. Otherwise, the attention level is low.
[0128] Formula (17) calculates the hyperedge e i With e j Attention scores between them.
[0129]
[0130] Where sim(·) calculates the hyperedge e based on the common nodes. i and e j Similarity. Attention relationships are focused on a subset of users, which also improves the efficiency of the suggestion framework.
[0131] If two hyperedges do not share a common node, the attention level will be 0. Additionally, and They do not receive the same attention. For example, user u1 is interested in a list of products that user u2 also buys or likes, but user u2 does not need to share this interest. Therefore, "attention" identifies user interest groups and estimates item-item and user-user similarity. It calculates user-user, item-item, user-item, friend user, and stranger user attention. To calculate the attention coefficient of a node, this embodiment of the invention applies formula (18):
[0132] v j =w T [sim(x i ||y j (18)
[0133] w is defined in formula (2), x i and y j There are two vertices, and || acts as a vector concatenation operator. Using hyperedges, hypergraph information can be obtained through user and item attention. Hypergraph convolution can be used with attention matrices to learn layer-by-layer embeddings. Utilizing X(l) and P used in hypergraph convolution, the hypergraph attention matrix propagates gradients to the incident matrix.
[0134] This invention primarily studies high-order user relationships (user-user, stranger user, and friend user) and user-item interactions to learn user and item embedding vectors. Therefore, an attention operator is used to aggregate information from any super-edge node, whether it's a user (stranger, friend) or an item. Using the l-th layer, this invention can obtain vectors of latent features for users and items.
[0135] 6. Aggregation of user representations and project representations.
[0136] The advantage of this framework lies in the fact that users and items are aggregated in the same way, yet processed separately. The results of hypergraph convolution and hypergraph attention networks are dynamically represented before being combined to identify potential user and item features. Users and items in the hypergraph convolutional network are represented as X. u and X i In attention networks, end users and items are represented as E. u and E i To capture dynamic representations, embodiments of the present invention use RNNs for sequence modeling because of their excellent ability to model sequence data. Specifically, in equations (19) to (22), the method of the embodiments of the present invention employs a Long Short-Term Memory (LSTM) network:
[0137] Y u =LSTM(X) u (19)
[0138] Y i =LSTM(X) i (20)
[0139] F u =LSTM(E u ) (twenty one)
[0140] F i =LSTM(E i ) (twenty two)
[0141] In formulas (23) to (24), O u It is the final user characteristic, O i It is the final characteristic of the item.
[0142]
[0143]
[0144] Finally, in formula (25), this embodiment of the invention uses the inner product to evaluate user u. j For the expected item i k How much do I like it:
[0145]
[0146] 7. Model optimization.
[0147] Model optimization requires an objective function. This embodiment of the invention employs a pairwise logistic optimization method. It assumes that a specific user u prefers observed item j to unobserved item i, therefore observed item i should be ranked higher. Furthermore, as the loss function, in formula (26), this embodiment utilizes pairwise Bayesian personalized ranking:
[0148]
[0149] Where τ represents paired training data, r ui Let $\frac{u}{i}$ be the predicted score for user $u$ on item $i$, $\frac{Θ}{i}$ represent all model parameters, and $\frac{σ}{\sigmoid}$ represent the sigmoid function. To avoid overfitting, a regularization parameter $λ$ is used.
[0150] Finally, embodiments of the present invention use mean absolute error (MAE) and root mean square error (RMSE) as metrics for rating predictions to evaluate the performance of the above model. MAE is the average of the absolute errors between predicted and actual values, and RMSE is the square root of the average of the squared differences between predicted and actual values.
[0151]
[0152]
[0153] The smaller the MAE and RMSE values, the higher the prediction accuracy and the better the recommendation performance.
[0154] Reference Figure 9 This invention provides a social recommendation device based on dynamic hypergraph representation learning, comprising:
[0155] The hypergraph acquisition unit is used to acquire multiple hypergraphs. Each hypergraph is determined based on the relationships between several users and several projects within a set time period. Users and projects are the nodes of the hypergraph, and the social relationships between users and the purchase relationships between users and projects are the hyperedges of the hypergraph.
[0156] The embedding acquisition unit is used to input the multiple hypergraphs into the hypergraph convolutional neural network and the attention neural network respectively, and then pass them through the long short-term memory network to obtain the user embedding and the item embedding.
[0157] The recommendation prediction unit is used to determine the prediction score for each user for each item based on the user embedding and the item embedding.
[0158] This invention also discloses a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, causing the computer device to perform... Figure 1 The method shown.
[0159] In some alternative embodiments, the functions / operations mentioned in the block diagrams may not occur in the order shown in the operation diagrams. For example, depending on the functions / operations involved, two consecutively shown blocks may actually be executed substantially simultaneously, or the blocks may sometimes be executed in reverse order. Furthermore, the embodiments presented and described in the flowcharts of this invention are provided by way of example to provide a more comprehensive understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is altered and sub-operations described as part of a larger operation are executed independently.
[0160] Furthermore, although the invention has been described in the context of functional modules, it should be understood that, unless otherwise stated, one or more of the described functions and / or features may be integrated into a single physical device and / or software module, or one or more functions and / or features may be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the invention. Rather, given the properties, functions, and internal relationships of the various functional modules in the apparatus disclosed herein, the actual implementation of the module will be understood within the scope of conventional skill of an engineer. Therefore, those skilled in the art can implement the invention as set forth in the claims using ordinary techniques without excessive experimentation. It is also understood that the specific concepts disclosed are merely illustrative and not intended to limit the scope of the invention, which is determined by the full scope of the appended claims and their equivalents.
[0161] If the aforementioned functions are implemented as 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 this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0162] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0163] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0164] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0165] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0166] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
[0167] The above is a detailed description of the preferred embodiments of the present invention. However, the present invention is not limited to the embodiments described. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention. All such equivalent modifications or substitutions are included within the scope defined by the claims of the present invention.
Claims
1. A social recommendation method based on dynamic hypergraph representation learning, characterized in that, include: Multiple hypergraphs are obtained, each determined based on the relationships between several users and several projects within a set time period; where users and projects are the nodes of the hypergraph, and the social relationships between users and the purchase relationships between users and projects are the hyperedges of the hypergraph. The multiple hypergraphs are respectively input into a hypergraph convolutional neural network and an attention neural network, and then passed through a long short-term memory network to obtain user embeddings and item embeddings; Determine the predicted score for each user for each item based on the user embedding and the item embedding; The step of inputting the multiple hypergraphs into a hypergraph convolutional neural network and an attention neural network, respectively, and then passing them through a long short-term memory network to obtain user embeddings and item embeddings includes: The multiple hypergraphs are input into a hypergraph convolutional neural network and passed through a first long short-term memory network to obtain a first user embedding and a first item embedding. The multiple hypergraphs are input into an attention neural network and then passed through a second long short-term memory network to obtain a second user embedding and a second item embedding. The step of inputting the multiple hypergraphs into a hypergraph convolutional neural network and passing them through a first long short-term memory network to obtain a first user embedding and a first item embedding includes: The transition probabilities between each vertex of the hypergraph are calculated using the hypergraph convolutional neural network, so that the embedding of each vertex is passed between the layers of the hypergraph convolutional neural network, and after passing through the first long short-term memory network, the first user embedding and the first item embedding are obtained. The step of inputting the multiple hypergraphs into an attention neural network and passing them through a second long short-term memory network to obtain a second user embedding and a second item embedding includes: The attention hyperedge aggregation module in the attention neural network is used to aggregate information about hyperedges and generate hyperedge embeddings. The attention vertex aggregation module in the attention neural network is used to aggregate information about vertices and generate vertex embeddings. The hyperedge embedding and the vertex embedding are passed through a second long short-term memory network to obtain a second user embedding and a second item embedding.
2. The social recommendation method based on dynamic hypergraph representation learning according to claim 1, characterized in that, The method further includes: Determine each user's actual score for each item; The predicted score for each user on each item is recalculated based on the predicted score, the actual score, and the preset objective function.
3. The social recommendation method based on dynamic hypergraph representation learning according to claim 2, characterized in that, The step of re-determining the predicted score for each user for each item based on the predicted score, the actual score, and a preset objective function includes: The predicted score for each user for each item is recalculated based on the average absolute error between the predicted score and the actual score, the square root of the average squared difference between the predicted score and the actual score, and the objective function. The expression of the objective function is wherein, denotes the pair of training data, is the user prediction score on the project , denotes all model parameters, denotes the function, denotes the regularization parameter.
4. The social recommendation method based on dynamic hypergraph representation learning according to any one of claims 1 to 3, characterized in that, The process of constructing the hypergraph includes: The first hypergraph is built based on users purchasing the same project; Construct a second hypergraph based on the set of users who purchased the same project; Build a third hypergraph based on users with social relationships purchasing the same project; A fourth hypergraph is constructed based on users who do not have social relationships purchasing the same project; A fifth hypergraph is constructed based on the social relationships between users.
5. A social recommendation apparatus based on dynamic hypergraph representation learning, characterized in that, include: The supergraph obtaining unit is configured to obtain a plurality of supergraphs, each of which is determined according to association relationships between a plurality of users and a plurality of items within a set time period; wherein the users and the items are nodes of the supergraphs, social relationships between the users, and purchase relationships between the users and the items are superedges of the supergraphs; The embedding obtaining unit is configured to input the plurality of supergraphs into a supergraph convolutional neural network and an attention neural network respectively, and pass the plurality of supergraphs through a long short-term memory network to obtain user embeddings and item embeddings; The recommendation predicting unit is configured to determine a predicted score of each user for each item according to the user embeddings and the item embeddings. Wherein: The embedding obtaining unit is configured to input the plurality of supergraphs into a supergraph convolutional neural network and an attention neural network respectively, and pass the plurality of supergraphs through a long short-term memory network to obtain user embeddings and item embeddings. The embedding obtaining unit is configured to input the plurality of supergraphs into a supergraph convolutional neural network and an attention neural network respectively, and pass the plurality of supergraphs through a long short-term memory network to obtain user embeddings and item embeddings. The embedding obtaining unit is configured to input the plurality of supergraphs into a supergraph convolutional neural network and an attention neural network respectively, and pass the plurality of supergraphs through a long short-term memory network to obtain user embeddings and item embeddings. The embedding obtaining unit is configured to input the plurality of supergraphs into a supergraph convolutional neural network and an attention neural network respectively, and pass the plurality of supergraphs through a long short-term memory network to obtain user embeddings and item embeddings. The embedding obtaining unit is configured to input the plurality of supergraphs into a supergraph convolutional neural network and an attention neural network respectively, and pass the plurality of supergraphs through a long short-term memory network to obtain user embeddings and item embeddings. The embedding obtaining unit is configured to input the plurality of supergraphs into a supergraph convolutional neural network and an attention neural network respectively, and pass the plurality of supergraphs through a long short-term memory network to obtain user embeddings and item embeddings. The embedding obtaining unit is configured to input the plurality of supergraphs into a supergraph convolutional neural network and an attention neural network respectively, and pass the plurality of supergraphs through a long short-term memory network to obtain user embeddings and item embeddings. The processor and the memory are included. The memory is configured to store a program.
6. An electronic device, comprising: The processor executes the program to implement the method of any one of claims 1 to 4. The storage medium stores a program, and the program is executed by a processor to implement the method of any one of claims 1 to 4. 7. A computer-readable storage medium, characterized in that,
Citation Information
Patent Citations
Information diffusion prediction method based on time sequence hypergraph attention neural network
CN113962358A
Sequence recommendation method and device based on hypergraph neural network
CN115082147A