A long- and short-term interest-aware collaborative recommendation method based on graph neural network
By constructing the full map of the user's conversation and the use of the diagram of the neural network model, combined with the two -way door -controlled recycling neural network to handle user interest, it solves the problem of difficulty capturing users in the short -term and long -term interests of the existing recommendation system, and achieves a more accurate and personalized recommendation effect. Essence
Patent Information
- Application Number
- CN202411517228.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-10-29
AI Technical Summary
Existing recommendation systems are difficult to effectively capture users' short-term and long-term interests, resulting in room for improvement in the accuracy and personalization of recommendations.
By constructing the full map of the user session, the historical behavior of the user is used to use the trending neural network model to deeply excavate the user, and combine the two -way door control circulating neural network to deal with the short -term interest of users; The long -term interest of users.
A more accurate and personalized recommendation has been realized, and the short -term interests and long -term interests of users have been fully integrated, and the recommendations and accuracy of the recommendation is improved.
Smart Images

Figure CN119025762B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of intelligent recommendation, and specifically relates to a long-term and short-term interest perception collaborative recommendation method based on graph neural network. Background Art
[0002] With the development of Internet technology, the number of users of e-commerce, social media, online entertainment and other platforms has exploded. In order to better meet user needs, recommendation systems have been widely used in various platforms. Recommendation systems analyze users' behavior data and interest preferences to recommend content or products that they may be interested in, thereby improving user experience and increasing platform user stickiness and revenue.
[0003] Most existing recommendation systems rely on traditional methods such as collaborative filtering, content-based or hybrid recommendation. Although these methods can provide effective recommendations to a certain extent, they usually face challenges such as data sparsity and the inability to effectively capture the dynamic changes in user interests. In addition, as the complexity of user behavior data increases, how to better model users' short-term and long-term interests and accurately reflect these interests in the recommendation system has become an urgent problem to be solved.
[0004] In recent years, with the development of deep learning technology, especially the emergence of Graph Neural Networks (GNNs), the research on recommendation systems has ushered in new breakthroughs. Graph neural networks can effectively process structured data and capture the complex relationships and dependencies between nodes in the graph, providing a richer information representation for the recommendation system. However, most of the existing recommendation methods based on graph neural networks focus on single-aspect interest modeling and fail to fully integrate users' short-term and long-term interests, resulting in room for improvement in the accuracy and personalization of recommendations. Summary of the invention
[0005] In order to solve the problems raised in the above background technology, the present invention proposes a long-term and short-term interest-aware collaborative recommendation method based on graph neural network. The method constructs a full graph of user sessions, uses a directed graph neural network model to deeply mine the user's historical behavior, and combines a bidirectional gated recurrent neural network (Bi-GRU) to process the user's short-term interests; at the same time, based on user portrait information and content similarity, the user's long-term interests are further extracted, thereby achieving more accurate and personalized recommendations.
[0006] An embodiment of the present invention provides a long-term and short-term interest-aware collaborative recommendation method based on a graph neural network, comprising the following steps:
[0007] S1: Input the user's historical session data, connect the items in each independent session and the relationships between them into a unified directed graph structure, and construct the user's full session graph;
[0008] S2: Initialize the embedding of the project, use a directed graph neural network to perform convolution on the full graph of the user session, and determine the final embedding of the project;
[0009] S3: Aggregate the items in the subgraph corresponding to each session to determine the final embedding of the session;
[0010] S4: Input the final embedding of the conversation into the bidirectional gated recurrent neural network according to the temporal relationship to obtain the user interaction embedding with the user's short-term interests;
[0011] S5: Based on the user portrait, embed the user, use the user embedding information to build the user similarity matrix, select the top-k similar users, and perform weighted aggregation on their user interaction embeddings to obtain the user similarity embedding with long-term interest;
[0012] S6: Based on user interaction embedding, a content similarity matrix is constructed, and the top-k similar user interaction embeddings are selected for weighted aggregation to obtain content similarity embeddings with long-term interest;
[0013] S7: Using the multi-head attention mechanism, aggregate user interaction embedding, user similarity embedding and content similarity embedding to obtain the final user interest embedding;
[0014] S8: Calculate the user's preference for the item by taking the inner product of the final user interest embedding and the final item embedding, and select the top N items to generate a recommendation list.
[0015] Furthermore, in step S2, the specific steps of using a directed graph neural network to perform convolution on the entire user session graph and determine the final embedding of the project are as follows:
[0016] S21: Using a directed graph neural network to recursively aggregate node information on the entire user session graph, capture the complex relationships and dependencies between nodes in the graph, and obtain the final embedding of the project with rich feature representation :
[0017] ;
[0018] Where: A is the adjacency matrix of the directed session graph, is the in-degree matrix, is the out-degree matrix, For the The node feature matrix of the layer, T represents the transpose of the matrix, The rows and columns of matrix A are swapped and transposed to obtain a new matrix; Indicates The node feature matrix of the layer; , and For the The trainable weight matrix of the layer, represents the ReLU activation function, Represents a vector concatenation operation;
[0019] S22: Select the last convolution layer Embed as a project.
[0020] Furthermore, in step S3, the items in the subgraph corresponding to each session are aggregated to determine the final embedding of the session. The specific formula is as follows:
[0021] ;
[0022] ;
[0023] Where: represents the final embedding of item v, represents the L2 norm; is the preliminary embedding of the ith session subgraph, is the final embedding of the i-th session subgraph.
[0024] Furthermore, in step S4, the final embedding of the conversation is input into a bidirectional gated recurrent neural network according to the time sequence relationship to obtain a user interaction embedding with the user's short-term interest. The specific steps are:
[0025] S41: Use the bidirectional gated recurrent unit Bi-GRU to capture the timing information in the session sequence. Bi-GRU can be regarded as a two-layer GRU. The formula is as follows:
[0026] ;
[0027] ;
[0028] ;
[0029] ;
[0030] Where: Control update gating, Control reset gate, is the hidden state passed down from the previous node, is the input weight matrix of the update gate, Update the hidden state weight matrix of the gate, is the input weight matrix of the reset gate, is the hidden state weight matrix of the reset gate, W is the weight matrix, Decide what information you choose to forget. Decide which new information to remember. Remember the current state. is the final updated node status, represents the sigmoid function, is the dot product operator;
[0031] S42: In the two-layer GRU, the first layer processes the forward conversation sequence, and the second layer processes the backward conversation sequence. Therefore, it is necessary to concatenate the forward propagation and backward propagation results to obtain the user interaction embedding with the user's short-term interest, as shown in the formula:
[0032] ;
[0033] Where: and Represent the final output of forward propagation and back propagation respectively.
[0034] Furthermore, in step S5, users are embedded based on user portraits, a user similarity matrix is constructed, and the top-k similar users are selected, and their user interaction embeddings are weighted averaged. The specific steps are as follows:
[0035] S51: Embed users through their portrait information (usually including gender, age, geographic location, etc.), then use cosine similarity to calculate the similarity between users and construct a user similarity matrix user-user. The specific formula is as follows:
[0036] ;
[0037] Where: and denote the embedding information of user i and j respectively, · denotes the dot product operation, represents the L2 norm, that is, the Euclidean distance of the vector;
[0038] S52: Select the top-k users who are most similar to the recommended user in the user similarity matrix, perform weighted aggregation on their user interaction embeddings, and obtain the user similarity embeddings with long-term interests. The specific formula is as follows:
[0039] ;
[0040] ;
[0041] Where: is a weighting factor, depending on the similarity value, represents the interaction embedding of the i-th user, k represents the number of users most similar to user i selected in the user similarity matrix, and COS represents the cosine similarity calculation.
[0042] Furthermore, in step S6, based on the user interaction embedding, a content similarity matrix is constructed, and the top-k similar user interaction embeddings are selected for weighted averaging. The specific steps are:
[0043] S61: Use cosine similarity to calculate the similarity between user interaction embeddings and construct the content similarity matrix item-item. The specific formula is as follows:
[0044] ;
[0045] Where: and denote the interaction embeddings of users i and j respectively, · denotes the dot product operation, represents the L2 norm, that is, the Euclidean distance of the vector;
[0046] S62: Select the top-k user interaction embeddings that are most similar to the recommended user interaction embedding in the content similarity matrix for weighted aggregation to obtain the content similarity embedding with long-term interest. The specific formula is as follows:
[0047] ;
[0048] ;
[0049] Where: is a weighting factor, depending on the similarity value, represents the interaction embedding of the i-th user.
[0050] Furthermore, in step S7, the multi-head attention mechanism is used to aggregate user interaction embedding, user similarity embedding and content similarity embedding to obtain the final user interest embedding , the specific formula is as follows:
[0051] ;
[0052] ;
[0053] ;
[0054] ;
[0055] ;
[0056] Where: E is an n×d matrix, let the matrices Q, K and V equal E, n is the type of embedding (here it takes the value of 3), d is the dimension of the embedding vector, , , , is the weight matrix, , , h represents the number of heads in the attention mechanism, represents the aggregate embedding after being processed by the multi-head attention mechanism; for The vector after the attention layer.
[0057] Furthermore, in step S8, the inner product of the final user interest embedding and the final project embedding is performed to calculate the user's preference for the project. The formula is as follows:
[0058] ;
[0059] Where: Represented as user u’s predicted preference for item i, represents the final embedding of item i, represents the final interest embedding of user u.
[0060] Compared with the prior art, the long- and short-term interest-aware collaborative recommendation method based on graph neural network in the embodiment of the present invention has the following beneficial effects:
[0061] The present invention constructs a full graph of user conversations, uses a directed graph neural network model to deeply mine the user's historical behavior, and combines a bidirectional gated recurrent neural network to process the user's short-term interests; at the same time, based on user portrait information and content similarity, the user's long-term interests are further extracted, thereby achieving more accurate and personalized recommendations.
[0062] To sum up, the long-term and short-term interest perception collaborative recommendation method based on graph neural network of the present invention can comprehensively integrate the short-term interests and long-term interests of users, accurately capture the personalized needs of users, and improve the relevance and accuracy of recommendations. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 A schematic diagram of the implementation principle of a long- and short-term interest perception collaborative recommendation method based on a graph neural network of the present invention;
[0064] Figure 2 This is a flowchart of an implementation of a long- and short-term interest perception collaborative recommendation method based on a graph neural network according to the present invention;
[0065] Figure 3A sub-flow chart of a long- and short-term interest perception collaborative recommendation method based on graph neural network of the present invention;
[0066] Figure 4 It is another sub-flow chart of a long-term and short-term interest perception collaborative recommendation method based on graph neural network of the present invention;
[0067] Figure 5 This is another sub-flow chart of a long- and short-term interest perception collaborative recommendation method based on a graph neural network of the present invention;
[0068] Figure 6 The present invention provides a structural block diagram of a computer device. DETAILED DESCRIPTION
[0069] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0070] In related technologies, graph neural networks can effectively process structured data and capture the complex relationships and dependencies between nodes in the graph, providing a richer information representation for the recommendation system. However, most existing recommendation methods based on graph neural networks focus on single-aspect interest modeling and fail to fully integrate users' short-term and long-term interests, resulting in room for improvement in the accuracy and personalization of recommendations.
[0071] To solve the above problems, the present invention provides a long-term and short-term interest-aware collaborative recommendation method based on graph neural network. The method constructs a full graph of user sessions, uses a directed graph neural network model to deeply mine the user's historical behavior, and combines a bidirectional gated recurrent neural network to process the user's short-term interests; at the same time, based on user portrait information and content similarity, the user's long-term interests are further extracted, thereby achieving more accurate and personalized recommendations.
[0072] The specific implementation of the long-term and short-term interest perception collaborative recommendation method based on graph neural network of the present invention is described below in combination with specific embodiments.
[0073] See also Figure 1 and Figure 2 In one embodiment of the present invention, a long-term and short-term interest-aware collaborative recommendation method based on a graph neural network is provided, comprising the following steps:
[0074] S1: Input the user's historical session data, connect the items in each independent session and the relationships between them into a unified directed graph structure, and construct the user's full session graph;
[0075] In the acquisition of user historical session data, user historical session data usually contains user behavior records on a certain platform, such as user browsing, clicking, these data include timestamp, user ID, session ID, project ID. After obtaining the original data, the data needs to be cleaned and preprocessed. This includes removing noise data (such as abnormal clicks, repeated behavior records), filling missing values, data normalization and other operations to ensure the accuracy of subsequent analysis;
[0076] Furthermore, in the process of constructing the user session graph in the embodiment of the present invention, the user session graph is a directed graph structure, which is used to represent the user's behavior in different sessions and their relevance. The nodes of the graph represent items, and the directed edges represent the order in which the user clicks on the items in the session. Through the graph, the temporal relationship and relevance in the user behavior sequence can be intuitively described.
[0077] S2: Initialize the embedding of the project and use a directed graph neural network to perform convolution on the entire user session graph to determine the final embedding of the project;
[0078] Furthermore, step S2 specifically includes:
[0079] S21: Using a directed graph neural network to recursively aggregate node information on the entire user session graph, capture the complex relationships and dependencies between nodes in the graph, and obtain the final embedding of the project with rich feature representation :
[0080] ;
[0081] Where: A is the adjacency matrix of the directed session graph, is the in-degree matrix, is the out-degree matrix, For the The node feature matrix of the layer, T represents the transpose of the matrix, The rows and columns of matrix A are swapped and transposed to obtain a new matrix; Indicates The node feature matrix of the layer, , and For the The trainable weight matrix of the layer, represents the ReLU activation function, Represents a vector concatenation operation;
[0082] S22: Select the last convolution layer Embed as a project.
[0083] S3: Aggregate the items in the subgraph corresponding to each session to determine the final embedding of the session. The specific formula is as follows:
[0084] ;
[0085] ;
[0086] Where: represents the final embedding of item v, represents the L2 norm, is the preliminary embedding of the ith session subgraph, is the final embedding of the i-th session subgraph.
[0087] S4: Input the final embedding of the conversation into the bidirectional gated recurrent neural network according to the temporal relationship to obtain the user interaction embedding with the user's short-term interests, that is, the final conversation full-graph embedding;
[0088] Further, such as Figure 3 As shown, step S4 of the embodiment of the present invention specifically includes:
[0089] S41: Use the bidirectional gated recurrent unit Bi-GRU to capture the timing information in the session sequence. Bi-GRU can be regarded as a two-layer GRU. The formula is as follows:
[0090] ;
[0091] ;
[0092] ;
[0093] ;
[0094] Where: Control update gating, Control reset gate, is the hidden state passed down from the previous node, is the input weight matrix of the update gate, Update the hidden state weight matrix of the gate, is the input weight matrix of the reset gate, is the hidden state weight matrix of the reset gate, W is the weight matrix, Decide what information you choose to forget. Decide which new information to remember. Remember the current state. is the final updated node status, represents the sigmoid function, is the dot product operator;
[0095] S42: In the two-layer GRU, the first layer processes the forward conversation sequence, and the second layer processes the backward conversation sequence. Therefore, it is necessary to concatenate the forward propagation and backward propagation results to obtain the user interaction embedding with the user's short-term interest, as shown in the formula:
[0096] ;
[0097] Where: and Represent the final output of forward propagation and back propagation respectively.
[0098] S5: Based on the user portrait, embed the user, use the user embedding information to build the user similarity matrix, select the top-k similar users, and perform weighted aggregation on their user interaction embeddings to obtain the user similarity embedding with long-term interest;
[0099] Further, such as Figure 4 As shown, step S5 of the embodiment of the present invention specifically includes:
[0100] S51: Embed users through their portrait information (usually including gender, age, geographic location, etc.), then use cosine similarity to calculate the similarity between users and construct a user similarity matrix user-user. The specific formula is as follows:
[0101] ;
[0102] Where: and denote the embedding information of user i and j respectively, · denotes the dot product operation, represents the L2 norm, that is, the Euclidean distance of the vector;
[0103] S52: Select the top-k users who are most similar to the recommended user in the user similarity matrix, perform weighted aggregation on their user interaction embeddings, and obtain the user similarity embeddings with long-term interests. The specific formula is as follows:
[0104] ;
[0105] ;
[0106] Where: is a weighting factor, depending on the similarity value, represents the interaction embedding of the i-th user, k represents the number of users most similar to user i selected in the user similarity matrix, and COS represents the cosine similarity calculation.
[0107] S6: Based on user interaction embedding, a content similarity matrix is constructed, and the top-k similar user interaction embeddings are selected for weighted aggregation to obtain content similarity embeddings with long-term interest;
[0108] Further, such as Figure 5 As shown, step S6 specifically includes:
[0109] S61: Use cosine similarity to calculate the similarity between user interaction embeddings and construct the content similarity matrix item-item. The specific formula is as follows:
[0110] ;
[0111] Where: and denote the interaction embeddings of users i and j respectively, · denotes the dot product operation, represents the L2 norm, that is, the Euclidean distance of the vector;
[0112] S62: Select the top-k user interaction embeddings that are most similar to the recommended user interaction embedding in the content similarity matrix for weighted aggregation to obtain the content similarity embedding with long-term interest. The specific formula is as follows:
[0113] ;
[0114] ;
[0115] Where: is a weighting factor, depending on the similarity value, represents the interaction embedding of the i-th user.
[0116] S7: Using the multi-head attention mechanism, aggregate user interaction embedding, user similarity embedding and content similarity embedding to obtain the final user interest embedding , the specific formula is as follows:
[0117] ;
[0118] ;
[0119] ;
[0120] ;
[0121] ;
[0122] Where: E is an n×d matrix, let the matrices Q, K and V equal E, n is the type of embedding (here it takes the value of 3), d is the dimension of the embedding vector, , , , is the weight matrix, , , h represents the number of heads in the attention mechanism, represents the aggregate embedding after being processed by the multi-head attention mechanism; for The vector after the attention layer.
[0123] S8: Calculate the user's preference for the item by performing an inner product on the final user interest embedding and the final item embedding, and select the top N items to generate recommendations. The specific formula is as follows:
[0124]
[0125] Where: Represented as user u’s predicted preference for item i, represents the final embedding of item i, represents the final interest embedding of user u.
[0126] To sum up, the long-term and short-term interest perception collaborative recommendation method based on graph neural network of the present invention can comprehensively integrate the short-term interests and long-term interests of users, accurately capture the personalized needs of users, and improve the relevance and accuracy of recommendations.
[0127] like Figure 6 As shown, in another embodiment of the present invention, the embodiment of the present invention further provides a computer device, wherein the computer device 100 includes at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of the long-term and short-term interest-aware collaborative recommendation method based on graph neural networks.
[0128] In one embodiment, the present invention also provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the steps of the long-term and short-term interest-aware collaborative recommendation method based on graph neural network.
[0129] A person of ordinary skill in the art can understand that the implementation of all or part of the processes in the long-term and short-term interest perception collaborative recommendation method based on graph neural network in the above-mentioned embodiment can be completed by instructing related hardware through a computer program represented by computer instructions, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory.
[0130] Non-volatile memory may include read-only memory, magnetic tape, floppy disk, flash memory or optical storage, etc. Volatile memory may include random access memory or external cache memory. As an illustration and not limitation, RAM may be in various forms, such as static random access memory or dynamic random access memory, etc.
[0131] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A long-term and short-term interest-aware collaborative recommendation method based on graph neural network, characterized in that: The following steps are involved: S1: Input the user's historical session data, connect the items in each independent session and the relationships between them into a unified directed graph structure, and construct the user session graph; S2: Initialize the embedding of the project and use a directed graph neural network to perform convolution on the entire user session graph to determine the final embedding of the project; S3: Aggregate the items in the subgraph corresponding to each session to determine the final embedding of the session; S4: Input the final embedding of the conversation into the bidirectional gated recurrent neural network according to the temporal relationship to obtain the user interaction embedding with the user's short-term interests; S5: Based on the user's portrait, the user is embedded, and the user similarity matrix is constructed using the user embedding information. The top-k similar users are selected, and their user interaction embeddings are weighted and aggregated to obtain the user similarity embedding with long-term interest; S6: Based on user interaction embedding, a content similarity matrix is constructed, and the top-k similar user interaction embeddings are selected for weighted aggregation to obtain content similarity embeddings with long-term interest; S7: Using the multi-head attention mechanism, aggregate user interaction embedding, user similarity embedding and content similarity embedding to obtain the final user interest embedding; S8: Calculate the user's preference for the item by performing the inner product of the final user interest embedding and the final item embedding, and select the top N items to generate a recommendation list; In step S2, a directed graph neural network is used to perform convolution on the entire user session graph and determine the final embedding of the project. The specific steps are: S21: Using a directed graph neural network to recursively aggregate node information on the entire user session graph, capture the complex relationships and dependencies between nodes in the graph, and obtain the final embedding of the project with rich feature representation : ; Where: A is the adjacency matrix of the directed session graph, is the in-degree matrix, is the out-degree matrix, For the The node feature matrix of the layer, T represents the transpose of the matrix, The rows and columns of matrix A are swapped and transposed to obtain a new matrix; Indicates The node feature matrix of the layer, , and For the The trainable weight matrix of the layer, represents the ReLU activation function, Represents a vector concatenation operation; S22: Select the last layer of convolution Embed as a project.
2. According to claim 1, a long-term and short-term interest perception collaborative recommendation method based on graph neural network is characterized by: In step S3, the items in the subgraph corresponding to each session are aggregated to determine the final embedding of the session. The specific formula is as follows: ; ; Where: represents the final embedding of item v, represents the L2 norm; is the preliminary embedding of the ith session subgraph, is the final embedding of the i-th session subgraph.
3. According to claim 2, a long-term and short-term interest perception collaborative recommendation method based on graph neural network is characterized by: In step S4, the final embedding of the conversation is input into the bidirectional gated recurrent neural network according to the temporal relationship to obtain the user interaction embedding with the user's short-term interest. The specific steps include: S41: Use the bidirectional gated recurrent unit Bi-GRU to capture the timing information in the session sequence. Bi-GRU is a two-layer GRU with the following formula: ; ; ; ; Where: Control update gating, Control reset gate, is the hidden state passed down from the previous node, is the input weight matrix of the update gate, Update the hidden state weight matrix of the gate, is the input weight matrix of the reset gate, is the hidden state weight matrix of the reset gate, W is the weight matrix; Decide what information you choose to forget. Decide which new information to remember. Remember the current state. is the final updated node status, represents the sigmoid function, is the dot product operator; S42: In the two-layer GRU, the first layer processes the forward conversation sequence, and the second layer processes the backward conversation sequence. The forward propagation and backward propagation results are concatenated to obtain the user interaction embedding with the user's short-term interest. The formula is as follows: ;Where: and Represent the final output of forward propagation and back propagation respectively.
4. According to claim 3, a long-term and short-term interest perception collaborative recommendation method based on graph neural network is characterized by: In step S5, users are embedded based on user portraits, a user similarity matrix is constructed, and the top-k similar users are selected and their user interaction embeddings are weighted averaged. The specific steps include: S51: Embed users through their portrait information, calculate the similarity between users using cosine similarity, and construct a user similarity matrix user-user. The specific formula is as follows: ; Where: and denote the embedding information of user i and j respectively, · denotes the dot product operation, represents the L2 norm, that is, the Euclidean distance of the vector; S52: Select the top-k users who are most similar to the recommended user in the user similarity matrix, perform weighted aggregation on their user interaction embeddings, and obtain the user similarity embeddings with long-term interests. The specific formula is as follows: ; ; Where: is a weighting coefficient, depending on the similarity value, represents the interaction embedding of the i-th user; k represents the number of users most similar to user i selected in the user similarity matrix, and COS represents the cosine similarity calculation.
5. According to claim 4, a long-term and short-term interest-aware collaborative recommendation method based on graph neural network is characterized in that: In step S6, based on the user interaction embedding, a content similarity matrix is constructed, and the top-k similar user interaction embeddings are selected for weighted averaging. The specific steps include: S61: Use cosine similarity to calculate the similarity between user interaction embeddings and construct the content similarity matrix item-item. The specific formula is as follows: ; Where: and denote the interaction embeddings of users i and j respectively, · denotes the dot product operation, represents the L2 norm; S62: Select the top-k user interaction embeddings that are most similar to the recommended user interaction embedding in the content similarity matrix for weighted aggregation to obtain the content similarity embedding with long-term interest. The specific formula is as follows: ; ; Where: is a weighting coefficient, depending on the similarity value, represents the interaction embedding of the i-th user.
6. The long- and short-term interest-aware collaborative recommendation method based on graph neural network according to claim 5, characterized in that: In step S7, the multi-head attention mechanism is used to aggregate user interaction embedding, user similarity embedding and content similarity embedding to obtain the final user interest embedding , the specific formula is as follows: ; ; ; ; ; Where: E is an n×d matrix, let the matrices Q, K and V equal E, n is the type of embedding, d is the dimension of the embedding vector, , , , is the weight matrix, , , h represents the number of heads in the attention mechanism, represents the aggregate embedding after being processed by the multi-head attention mechanism; for The vector after the attention layer.
7. The long- and short-term interest-aware collaborative recommendation method based on graph neural network according to claim 6, characterized in that: In step S8, the inner product of the final user interest embedding and the final item embedding is performed to calculate the user's preference for the item. The formula is as follows: ; Where: Represented as user u’s predicted preference for item i, represents the final embedding of item i, represents the final interest embedding of user u.
Citation Information
Patent Citations
Interest point recommendation method based on graph neural network and user long-term and short-term preferences
CN111949865A
Sequence recommendation method for mining long and short term interests of user based on graph neural network
CN114519145A