Neighbor enhancement-based graph neural network conversation recommendation method, system and device
By adopting neighbor-enhanced graph neural network and Fastformer model in the recommendation system, the problem of existing systems being difficult to capture user preferences when dealing with unknown identities and information of users is solved, achieving more efficient and accurate recommendation effects.
Patent Information
- Application Number
- CN202210867990.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-22
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2042-07-22
AI Technical Summary
Existing session-based recommendation systems are difficult to accurately capture the user's short-term and long-term preferences when processing user's unknown identities and information, and ignore cross-session information between different sessions.
Using a graph neural network session recommendation system based on neighbor enhancement, we can find similar neighbor sessions of the target session through the K proximity algorithm, build a neighbor enhancement graph, combine the gated graph neural network and Fastformer model to learn complex interaction relationships inside and outside the session and long-distance dependencies. Information, generates a user's global and local preference representation.
It improves the model's ability to capture cross-session information and users' long-term preferences, improves the efficiency and accuracy of the recommendation system, and performs better than other classic session-based recommendation systems.
Smart Images

Figure CN115130001B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a graph neural network conversation recommendation method and system based on neighbor enhancement, belonging to the field of user preference product recommendation. Background Art
[0002] In recent years, with the popularity of mobile devices, the amount of information and data generated by the Internet has shown an explosive growth. RSs (Recommendation Systems) have relieved users of this information overload pressure in digital consumption, services and decision-making, becoming one of the most common applications of artificial intelligence. RSs can not only filter out more effective information for users, but also help suppliers improve the platform user experience and retain more users.
[0003] Most current RSs assume that user profiles and past interaction records are continuously recorded. However, the conflict between personalized recommendations and personal privacy is escalating. In many services, the identity and information of users may be unknown, and only the history of users in ongoing sessions is available. Therefore, in this case, traditional recommendation systems that rely on sufficient user interactions have many problems in terms of result accuracy.
[0004] SBRSs (Session Based Recommendation Systems) use the sessions generated during the user consumption process to learn the user's preferences. Each session consists of an interaction between a user and an item that occurs in a continuous time, which enables SBRSs to capture the user's accurate short-term preferences. Most existing session-based recommendation systems use RNN (Recurrent Neural Network) to model the information of the item sequence. For example, GRU4Rec uses GRU (Gated Recurrent Unit) to model the session using the features of clicks and clicked items. NRAM integrates the attention mechanism into the deep learning network for the first time. The attention mechanism calculates the attention weights between the outputs of two RNN submodules so that NRAM can adaptively select more important items, thereby more effectively representing the user's preferences. In STAMP, the user's last click is considered particularly important, and the item representation of the last clicked item is regarded as the user's short-term interest. However, the above scheme can only simulate the one-way conversion between consecutive items, while ignoring the one-way conversion between other context items in the same session.
[0005] To solve this problem, SR-GNN models the target session in a graph structure and uses GNN (Graph Neural Network) to model the complex transformations between item nodes on the graph. Although RNN and GNN-based models have achieved good results in session recommendation, they still have some problems. SR-GNN only focuses on the item transformation within the target session, but ignores the rich cross-session information between different sessions. Summary of the invention
[0006] The technical problem to be solved by the present invention is based on the defects of the background technology, and provides a graph neural network conversation recommendation system method based on neighbor enhancement. On the one hand, neighbor conversations similar to the target conversation are used to consider the co-occurrence relationship between different conversations and the interactive relationship between items in different conversations. On the other hand, Fastformer is used to capture long-distance dependencies within the conversation to model the long-term preferences of users.
[0007] The present invention adopts the following technical solutions to solve the above technical problems:
[0008] The present invention relates to a graph neural network conversation recommendation system based on neighbor enhancement, the steps of which are as follows:
[0009] The first step is to find the K neighboring sessions closest to the target recommendation session through the K-nearest neighbor algorithm, and restrict their last clicked items to be the same to form a neighboring session set Ns;
[0010] The second step is to model the target session and the K closest neighbor sessions into a graph structure to consider the complex interaction relationship between items in different sessions, and this graph is named the neighbor enhancement graph. In addition, the original target session is modeled as an original target session graph;
[0011] Step 3: Use the gated graph neural network to learn the node representations in the neighbor enhancement graph and the original target session graph, and take the node representation of the last item clicked as the user's local preference.
[0012] Step 4: Introduce Fastformer to capture the transformation of the entire input and output sequence itself without considering the distance, and use the result as the user's global preference;
[0013] Step 5: Fusion the user’s global preference and local preference as the final representation of the user, predict the next item the user will click, and use the binary cross entropy function as the loss function.
[0014] The cosine similarity calculated by the number of identical items between sessions in the first step above represents the similarity between two sessions. The formula is:
[0015]
[0016] Among them, L s represents the number of identical items between two sessions, L a and L b Denotes the length of two sessions. Then, the first K similar sessions are sampled to form a neighbor set Ns.
[0017] In the second step above, the neighbor session set Ns and the target session are modeled into the same graph, defined as g Ns =(V Ns ,E Ns ), the original target session graph is defined as g t =(V s ,E s ). Where V Ns represents the set of all nodes in the neighbor-enhanced session graph, E Ns represents the set of all edges in the neighbor-enhanced session graph, V s represents the set of all nodes in the original target session graph, E s Represents the set of all edges in the original target session graph.
[0018] The process of the graph neural network model described in the third step above is:
[0019] The information propagation between nodes at time t is calculated by the adjacency matrix A of the graph
[0020]
[0021]
[0022]
[0023] in, Neighbor Enhanced Sessions Ns The node vector list at time t-1, A in , A out Respectively represent g Ns The in-degree and out-degree matrices, W in , are the learnable in-degree and out-degree parameter matrices that control the weights, and b in , b out are the in-degree and out-degree biases respectively, and || represents the concatenation operation.
[0024] represents the update gate, which controls the forgotten information. Its formula is:
[0025]
[0026] in is a learnable parameter matrix, and σ(·) represents the sigmoid function.
[0027] Represents the reset gate, which determines the update information. The formula is:
[0028]
[0029] in is a learnable parameter matrix, and σ(·) represents the sigmoid function.
[0030] Represents updated information, and its formula is:
[0031]
[0032] where tanh(·) is the hyperbolic tangent function, is a learnable parameter matrix and ⊙ represents an element-wise multiplication operator.
[0033] The present invention defines the hidden representation vector of a node at time t as The calculation formula is:
[0034]
[0035] The Fastformer network model described in the fourth step above specifically includes the following steps:
[0036] (1) For all items in the session, the latent representation s = [h1,h2,...,h |s| ], firstly transform it linearly into three matrices, namely the query matrix Q = [q1, q2, ..., q |s| ], key matrix K = [k1, k2, ..., k |s| ], value matrix V = [v1,v2,...,v |s| ], Q, K, Next, Q is summarized into a global query vector q using an additive attention mechanism:
[0037]
[0038]
[0039] in, is a learnable parameter vector, d represents the vector q i Dimension, α i is the weight of the i-th vector in s, i,j∈[1,|s|].
[0040] (2) Use the element-wise product between the global query vector and each key vector to model their interactions and combine them into a global context-aware key matrix p i =q*k i In addition, the additive attention mechanism is also used to summarize the global context-aware key matrix:
[0041]
[0042]
[0043] in is a learnable parameter vector, β i is the global context-aware key vector p i The weight of .
[0044] (3) Use element-wise product to model the interaction between P and K, i.e. u i =k*v i Based on the idea of residual, the original query matrix Q is added to the linearly transformed U to obtain the final model output, which is regarded as the user's global preference in this paper:
[0045] s g =Q+W r U
[0046] The above-mentioned prediction of the next clicked item specifically includes the following steps:
[0047] The present invention uses a concatenation function to combine the user's global preference and local preference as the final representation of the user:
[0048] s final =s c ||s g ;
[0049] Among them, || represents the splicing operation, s c The last clicked item embedding representation in the session obtained in the third step is used to calculate the final session embedding representation of each candidate item v i Recommended score
[0050] The formula can be defined as:
[0051]
[0052] Finally, the present invention uses the softmax function to calculate each candidate item v i Probability of being clicked
[0053]
[0054] in, represents v=[v1,v2,...,v i ] will become the probability of the next clicked item. The present invention defines the predicted cross entropy and the ground truth as a loss function, and its formula is as follows:
[0055]
[0056] Among them, y i A one hot encoded vector representing the ground truth terms.
[0057] Secondly, the present invention also proposes a graph neural network conversation recommendation system based on neighbor enhancement, comprising:
[0058] A neighbor session set generating unit is configured to perform the following actions: find out the K neighbor sessions closest to the target recommendation session through a K-nearest algorithm, and the last clicked items of the K neighbor sessions are the same, so as to form a neighbor session set Ns;
[0059] A modeling unit configured to perform the following actions: modeling the target session and K nearest neighbor sessions into a neighbor-enhanced session graph, and modeling the original target session into an original target session graph;
[0060] A neural network learning unit is configured to perform the following actions: using a gated graph neural network to obtain node representations in a neighbor-enhanced session graph and an original target session graph through learning, and treating the node representation of the last item clicked as the user's local preference; and
[0061] The Fastformer network model is introduced to capture the transformation of the entire input and output sequence itself without considering the distance, and the result is used as the user's global preference;
[0062] The result output unit is configured to perform the following actions: fuse the user's global preference and local preference as the user's final representation, predict the next item clicked by the user, and use the binary cross entropy function as the loss function.
[0063] Furthermore, the present invention also proposes an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the graph neural network conversation recommendation method based on neighbor enhancement when executing the computer program.
[0064] Finally, the present invention proposes a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the aforementioned graph neural network conversation recommendation method based on neighbor enhancement of the present invention are implemented.
[0065] The present invention adopts the above technical solution, which has the following technical effects compared with the prior art:
[0066] The solution adopted by the present invention improves the model's ability to learn cross-session information by constructing a neighbor enhancement graph, and introduces Fastformer to achieve the conversion of capturing the entire input and output sequence itself without considering the distance with lower computational complexity. In terms of session-based recommendation systems, both the efficiency and accuracy of recommendations have obvious advantages over other classic session-based recommendation systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 It is a flow chart of the present invention.
[0068] Figure 2 is an example of building a neighbor-augmented conversation graph. DETAILED DESCRIPTION
[0069] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0070] like Figure 1 As shown, the framework process of this method is as follows:
[0071] (1) For the target session, the present invention uses KNN to find the nearest neighboring session Ns to the target session. At this time, Ns and the target session can be Figure 2 The method shown is modeled as a graph g Ns , the present invention regards it as a neighbor enhancement session of the target session, which is independent of Ns and the target session.
[0072] (2) The original target session graph g t and g Ns Feedback is then fed into a gated neural network layer to capture complex interactions between items to obtain item embeddings.
[0073] (3) The input items of the present invention are embedded into the Fastformer layer, and Fastformer can draw global dependencies between input and output, so the present invention can obtain global session embedding.
[0074] (4) Embed s for global session c and the current session embeds g Perform linear transformation to obtain the final session representation sfinal .
[0075] (5) The prediction layer will calculate the recommendation score of each candidate based on the final result And select the top K items for recommendation.
[0076] Next, the method of the present invention will be specifically introduced in stages:
[0077] For target sessions t The present invention first uses the K-nearest neighbor algorithm KNN to find the K nearest neighbor sets Ns, and restricts Ns and s t Same as the last item clicked.
[0078] Specifically, the present invention uses the number of identical items between two sessions to calculate the cosine similarity:
[0079]
[0080] Among them, L s represents the number of identical items between two sessions, L a and L b represents the length of the two sessions. Then, the first K similar sessions are sampled to form a neighbor set Ns. For each target session s t It can be modeled as a directed graph g t =(V s ,E s ). Each node represents the item clicked in the sequence v s , each edge (v s1 ,v s2 ) indicates that the user clicks on item v s1 Then click v s2 The present invention will t The set of all items in is denoted as V s , denote the set of all interactions as E s .
[0081] Similarly, the present invention converts Ns and s t Modeling to a graph. The specific operation is as follows Figure 2 The present invention represents the new graph as g Ns =(V Ns ,E Ns ). The present invention will g Ns Considered independent of t and Ns. In this session, the present invention uses similar neighboring sessions to enhance the co-occurrence relationship between different sessions. Ns Indicates an independent session, so g Ns and g t The subsequent processing is the same.
[0082] In the process of graph construction, the present invention explains how to construct a session graph g based on the target session. t and neighbor enhanced conversation graph g Ns Next, the present invention will describe how to use the gated graph neural network to obtain the potential feature vector of the node. Ns , the information propagation between nodes at time t can be calculated through the graph adjacency matrix A
[0083]
[0084]
[0085]
[0086] in, Neighbor Enhanced Sessions Ns The node vector list at time t-1, A in , A out Respectively represent g Ns The in-degree and out-degree matrices, W in , are the learnable in-degree and out-degree parameter matrices that control the weights, and b in , b out are the in-degree and out-degree biases respectively, and || represents the concatenation operation.
[0087] Since the interaction of each node is not unique, the present invention normalizes the weight of each side. The present invention takes the session [v1, v2, v3, v2, v4, v3,] to construct the adjacency matrix A as an example. Since v3 and v2 appear multiple times in the session, it is necessary to weight the incoming and outgoing edges for normalization. For v3, since v3 is clicked after clicking on items v2 and v4, the weight of v3's incoming edge should be modified to 0.5.
[0088] Then, the present invention extracts the adjacent latent vectors into GGNN (Gated Graph Neural Network) to obtain the hidden representation vector of the node at time t The gated graph neural network is similar to the GRU, with two gates determining the information to be discarded or retained in each round of training:
[0089]
[0090] In the formula, represents the update gate, which controls the forgetting information. is a learnable parameter matrix. σ(·) represents the sigmoid function.
[0091]
[0092] In the formula, Represents the reset gate and decides to update the information, that is, is a learnable parameter matrix. σ(·) represents the sigmoid function.
[0093]
[0094] In the formula, represents the updated information, where tanh(·) is the hyperbolic tangent function, is a learnable parameter matrix and ⊙ represents an element-wise multiplication operator.
[0095] The present invention defines the hidden representation vector of a node at time t as The calculation formula is:
[0096]
[0097] As mentioned above, the present invention will t and Ns are treated as two separate sessions and use the same processing method, so for the original target session graph g t , use with g Ns The same training mode. Finally, the graph neural network can output the potential representation s = [h1,h2,...,h |s| ].
[0098] For target sessions t , in g t and g Ns After inputting into the gated graph neural network, the present invention can obtain the potential representation s=[h1,h2,...,h |s| ]. The present invention regards the node representation of the last item as the embedding of the user's short-term preference and the current target session, i.e., s c =h |s| . However, when predicting the user's next action, the present invention should also consider the user's global preferences. Fastformer is a variant of Transformer with lower computational complexity. The present invention uses it to capture the transformation of the entire input and output sequence itself without considering the distance. Specifically, for s, it is first linearly transformed into three matrices, namely the query matrix Q = [q1, q2, ..., q |s| ], key matrix K = [k1, k2, ..., k |s| ], value matrix V = [v1,v2,...,v |s| ], Q, K, Next, Q is summarized into a global query vector q using an additive attention mechanism:
[0099]
[0100]
[0101] in, is a learnable parameter vector, d represents the vector q i Dimension, α i is the weight of the i-th vector in s, i,j∈[1,|s|].
[0102] Then, we use the element-wise product between the global query vector and each key vector to model their interactions and combine them into a global context-aware key matrix p i =q*k i In addition, the additive attention mechanism is also used to summarize the global context-aware key matrix:
[0103]
[0104]
[0105] in is a learnable parameter vector, β i is the global context-aware key vector p i The weight of .
[0106] Finally, as described above, the interaction between P and K is modeled using element-wise product, i.e., u i =k*v i Based on the idea of residual, the original query matrix Q is added to the linearly transformed U to obtain the final model output, which is regarded as the user's global preference in this paper:
[0107] s g =Q+W r U.
[0108] Furthermore, in the case of multiple attention heads, each attention head operates the same but with different parameters. Finally, the output of each head is concatenated to the hidden dimension.
[0109] In order to accurately describe the user's preferences, the present invention combines the user's long-term preferences with short-term preferences. Specifically, for session s = [v1, v2, ..., v |s| ], extracting the global context information of the conversation sequence through the Fastformer layer, the present invention obtains the global feature representation s of the conversation g , which is embedded as a global feature of the session.
[0110] As mentioned above, the present invention uses the feature vector representation of the last item as the local embedding of the session, i.e., s c .
[0111] The present invention combines the two using a concatenation function:
[0112] s final =s c ||s g
[0113] After obtaining the final embedding representation of the session, the present invention uses it to calculate each candidate item v i Recommended score The formula can be defined as:
[0114]
[0115] Finally, the present invention uses the softmax function to calculate each candidate item v i Probability of being clicked
[0116]
[0117] in, Represents the item v = [v1, v2, ..., v i ] will become the probability of the next clicked item. The present invention defines the predicted cross entropy and the ground truth as a loss function, and its formula is as follows:
[0118]
[0119] Among them, y i A one hot encoded vector representing the ground truth terms.
[0120] The present invention uses the time back propagation algorithm to train the method proposed in the present invention. The performance of different models on two data sets Diginetica and Yoochoose1 / 64 is shown in Table 1:
[0121] Table 1 Performance of different session-based recommendation systems on two datasets
[0122]
[0123] The experimental results in Table 1 show that the present invention exhibits the highest P@20 and MMR@20 indicators compared to all baseline models. In other words, the idea of using co-occurrence information in neighbor conversations to enhance the representation of conversation nodes is effective and feasible. The present invention provides the following analysis for the experimental results in Table 1:
[0124] For traditional methods, the results of Pop and S-Pop are poor. Pop ignores items that have not appeared before because it uses the most popular items in the training set for recommendation. However, S-Pop performs better than Pop and has shown relatively good performance in previous work, which shows the importance of contextual information in the session. Among them, Item-KNN shows excellent performance among traditional methods. Although Item-KNN ignores the sequential information of the session, its performance even exceeds some Markov chain-based methods, which means that neighborhood information has an important positive impact on the recommendation effect.
[0125] For the two Markov chain-based methods, FPMC and BPR-MF, both show relatively poor results. This may be because the Markov chain assumes that the current interaction depends only on one or a few recent interactions, which can only capture point-wise dependencies and ignore collaborative dependencies.
[0126] In recent years, many deep learning-based methods have been proposed. From the experimental results, the performance of most methods has been significantly improved, thanks to the ability of deep learning networks to mine complex interactions between users and items. GRU4REC and NARM based on RNN use GRU to capture the long-term preferences of users expressed by item conversions and make personalized recommendations for each session, but ignore the short-term preferences of users. STAMP defines the last clicked item as the short-term preference of the user, further optimizing the model's description of user preferences. SR-GNN uses graph neural networks to model sessions, and its performance is better than GRU4REC, NAMR, and STAMP. This is because SR-GNN models sessions into graph structures, allowing GNN to capture more complex two-way interactions between items.
[0127] However, based on the use of graph neural networks, the present invention further considers the co-occurrence relationship between neighboring sessions and the current session, models neighboring sessions similar to the target session into the same graph, and uses Fastformer to capture contextual information in the session to more comprehensively express the user's global preferences. Experimental results show that the recommendation performance of the present invention is better than that of advanced methods such as SRGNN, which proves the effectiveness of the present invention.
[0128] Secondly, the present invention also proposes a graph neural network conversation recommendation system based on neighbor enhancement, comprising:
[0129] A neighbor session set generating unit is configured to perform the following actions: find out the K neighbor sessions closest to the target recommendation session through a K-nearest algorithm, and the last clicked items of the K neighbor sessions are the same, so as to form a neighbor session set Ns;
[0130] A modeling unit configured to perform the following actions: modeling the target session and K nearest neighbor sessions into a neighbor-enhanced session graph, and modeling the original target session into an original target session graph;
[0131] A neural network learning unit is configured to perform the following actions: using a gated graph neural network to obtain node representations in a neighbor-enhanced session graph and an original target session graph through learning, and treating the node representation of the last item clicked as the user's local preference; and
[0132] The Fastformer network model is introduced to capture the transformation of the entire input and output sequence itself without considering the distance, and the result is used as the user's global preference;
[0133] The result output unit is configured to perform the following actions: fuse the user's global preference and local preference as the user's final representation, predict the next item clicked by the user, and use the binary cross entropy function as the loss function.
[0134] It should be noted that the description of the system of the embodiment of the present application is similar to the description of the above-mentioned method embodiment, and has similar beneficial effects as the method embodiment, so it will not be repeated.
[0135] As another embodiment of the present invention, the present invention also proposes an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the graph neural network conversation recommendation method based on neighbor enhancement when executing the computer program.
[0136] Finally, the present invention proposes a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the aforementioned graph neural network conversation recommendation method based on neighbor enhancement of the present invention are implemented.
[0137] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0138] The program code for implementing the method of the present application can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, implements the functions / operations specified in the flow chart and / or block diagram. The program code can be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0139] In the context of the present application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0140] It will be easily understood by those skilled in the art that the above description is only an embodiment of the present invention and is not intended to limit the present invention. However, any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A graph neural network conversation recommendation method based on neighbor enhancement, characterized in that: The following steps are involved: S1. Use the K-nearest neighbor algorithm to find the K neighbor sessions closest to the target recommendation session, and the last clicked item of these K neighbor sessions is the same to form a neighbor session set Ns; S2, modeling the target session and the K closest neighbor sessions into a neighbor-enhanced session graph, and modeling the original target session into an original target session graph; S3. Using the gated graph neural network, we learn the node representations in the neighbor-enhanced session graph and the original target session graph, and take the node representation of the last item clicked as the user's local preference. S4, introduce the Fastformer network model to capture the transformation of the entire input and output sequence itself without considering the distance, and use the result as the user's global preference; S5. The user's global preference and local preference are integrated as the final representation of the user, the next item to be clicked by the user is predicted, and the binary cross entropy function is used as the loss function; Among them, the formula of the graph neural network model described in step S3 is: The information propagation between nodes at time t is calculated by the adjacency matrix A of the graph in, Neighbor Enhanced Sessions Ns The node vector list at time t-1, A in , A out Respectively represent g Ns The in-degree and out-degree matrices of are the learnable in-degree and out-degree parameter matrices that control the weights, and b in , b out are the in-degree and out-degree biases respectively, and || represents the concatenation operation; represents the update gate, which controls the forgotten information. Its formula is: in is a learnable parameter matrix, σ(·) represents the sigmoid function; Represents the reset gate, which determines the update information. The formula is: in is a learnable parameter matrix, σ(·) represents the sigmoid function; Represents updated information, and its formula is: where tanh(·) is the hyperbolic tangent function, is a learnable parameter matrix, ⊙ represents the element-wise multiplication operator; The hidden representation vector of the node at time t is defined as The calculation formula is: In step S4, the Fastformer network model is introduced, which specifically includes the following steps: (1) For all items in the session, the latent representation s = [h1,h2,...,h |s| ], firstly transform it linearly into three matrices, namely the query matrix Q = [q1, q2, ..., q |s| ], key matrix K = [k1, k2, ..., k |s| ], value matrix V = [v1,v2,...,v |s| ],in Next, Q is summarized into a global query vector q using an additive attention mechanism: in, is a learnable parameter vector, d represents the vector q i Dimension, α i is the weight of the i-th vector in s, i,j∈[1,|s|]; (2) Use the element-wise product between the global query vector and each key vector to model their interactions and combine them into a global context-aware key matrix p i =q*k i ; In addition, the additive attention mechanism is also used to summarize the global context-aware key matrix: in is a learnable parameter vector, β i is the global context-aware key vector p i The weight of (3) Use element-wise product to model the interaction between P and K, i.e. u i =k*v i Based on the idea of residual, the original query matrix Q is added to the linearly transformed U to obtain the final model output, which is regarded as the user's global preference: s g =Q+W r U。 2. The graph neural network conversation recommendation method based on neighbor enhancement according to claim 1 is characterized in that ,In step S1, the cosine similarity calculated by the number of ,the same items between sessions is used to represent the similarity between ,two sessions, and the formula is: Among them, L s represents the number of identical items between two sessions, L a and L b Indicates the length of two sessions; Then, the top K similar sessions are sampled to form a neighbor session set Ns.
3. The graph neural network conversation recommendation method based on neighbor enhancement according to claim 2 is characterized in that: In step S2, the neighbor session set Ns obtained in step S1 and the target session are modeled into the same graph, which is defined as the neighbor enhanced session graph g Ns =(V Ns ,E Ns ), where V Ns represents the set of all nodes in the neighbor-enhanced session graph, E Ns represents the set of all edges in the neighbor-enhanced session graph, and the original target session graph is defined as g t =(V s ,E s ), where V s represents the set of all nodes in the original target session graph, E s Represents the set of all edges in the original target session graph.
4. The graph neural network conversation recommendation method based on neighbor enhancement according to claim 1 is characterized in that ,Step S5 specifically includes the following steps: Use the concatenation function to combine the user's global preferences and local preferences as the final representation of the user: s final =s c ||s g Among them, s c The embedding representation of the last clicked item in the session obtained in step S3 is used to calculate each candidate item v after obtaining the final session embedding representation of the session. i Recommended score The formula is defined as: Finally, the softmax function is used to calculate each candidate item v i Probability of being clicked in, represents v=[v1,v2,...,v i ] will be the probability of the next clicked item; the cross entropy of the prediction and the ground truth is defined as the loss function, which is formulated as follows: Among them, y i A one hot encoded vector representing the ground truth terms.
5. A graph neural network conversation recommendation system based on neighbor enhancement, characterized in that: include: A neighbor session set generating unit is configured to perform the following actions: find out the K neighbor sessions closest to the target recommendation session through a K-nearest algorithm, and the last clicked items of the K neighbor sessions are the same, so as to form a neighbor session set Ns; A modeling unit configured to perform the following actions: modeling the target session and K nearest neighbor sessions into a neighbor-enhanced session graph, and modeling the original target session into an original target session graph; A neural network learning unit is configured to perform the following actions: using a gated graph neural network, obtaining node representations in a neighbor-enhanced session graph and an original target session graph through learning, and treating the node representation of the last item clicked as a local preference of the user; as well as Introducing the Fastformer network model to capture the transformation of the entire input and output sequence itself without considering the distance, and use the result as the user's global preference; A result output unit, which is configured to perform the following actions: fuse the user's global preference and local preference as the user's final representation, predict the next item clicked by the user, and use the binary cross entropy function as a loss function; Among them, in the neural network learning unit, the formula of the graph neural network model is: The information propagation between nodes at time t is calculated by the adjacency matrix A of the graph in, Neighbor Enhanced Sessions Ns The node vector list at time t-1, A in , A out Respectively represent g Ns The in-degree and out-degree matrices of are the learnable in-degree and out-degree parameter matrices that control the weights, and b in , b out are the in-degree and out-degree biases respectively, and || represents the concatenation operation; represents the update gate, which controls the forgotten information. Its formula is: in is a learnable parameter matrix, σ(·) represents the sigmoid function; Represents the reset gate, which determines the update information. The formula is: in is a learnable parameter matrix, σ(·) represents the sigmoid function; Represents updated information, and its formula is: where tanh(·) is the hyperbolic tangent function, is a learnable parameter matrix, ⊙ represents the element-wise multiplication operator; The hidden representation vector of the node at time t is defined as The calculation formula is: The introduction of the Fastformer network model specifically includes the following steps: (1) For all items in the session, the latent representation s = [h1,h2,...,h |s| ], firstly transform it linearly into three matrices, namely the query matrix Q = [q1, q2, ..., q |s| ], key matrix K = [k1, k2, ..., k |s| ], value matrix V = [v1,v2,...,v |s| ],in Next, Q is summarized into a global query vector q using an additive attention mechanism: in, is a learnable parameter vector, d represents the vector q i Dimension, α i is the weight of the i-th vector in s, i,j∈[1,|s\]; (2) Use the element-wise product between the global query vector and each key vector to model their interactions and combine them into a global context-aware key matrix p i =q*k i ; In addition, the additive attention mechanism is also used to summarize the global context-aware key matrix: in is a learnable parameter vector, β i is the global context-aware key vector p i The weight of (3) Use element-wise product to model the interaction between P and K, i.e. u i =k*v i Based on the idea of residual, the original query matrix Q is added to the linearly transformed U to obtain the final model output, which is regarded as the user's global preference: s g =Q+W r U。 6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Efficient non-sampling graph convolutional network recommendation method
CN114282122A
Recommendation method based on interactive neighbor session
CN114625969A