Conversation Recommendation Method Based on Graph Neural Network

By building global and local conversation graphs, using graph neural networks and attention mechanisms, the problems of missing session recommendation information and insufficient global information utilization in the existing technology are solved, the results and diversity of recommendations are improved, and high reliability and Accurate session recommendations.

CN114461928BActive Publication Date: 2024-12-03CENT SOUTH UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210165379.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-18
Publication Date
2024-12-03
Estimated Expiration
2042-02-18

AI Technical Summary

Technical Problem

The existing session recommendation method based on graph neural network is simple in the construction of session graphs, resulting in missing information, and the global session information cannot be effectively utilized in anonymous session recommendations, resulting in insufficient effectiveness, diversity and accuracy of recommendations.

Method used

Using a combination of global and local session graphs, by constructing a global session graph with no authority and directed local session graph, using graph neural network to extract feature representations, and fusion features through attention mechanisms to calculate users and products Recommended scores.

Benefits of technology

Effectively reduce information loss, add global session information, improve the effectiveness and diversity of recommendations, and improve the reliability and accuracy of recommendations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114461928B_ABST
    Figure CN114461928B_ABST
Patent Text Reader

Abstract

The present invention discloses a conversation recommendation method based on graph neural network, including constructing a global conversation graph using all conversation sequences; constructing a local conversation graph using the current conversation sequence; inputting the global conversation graph into the global conversation graph neural network to obtain a global information feature representation; inputting the local conversation graph into the local conversation graph neural network to obtain a local information feature representation; integrating the global information feature representation and the local information feature representation to obtain a conversation sequence feature representation; using an attention mechanism to obtain the final feature representation; calculating the scores of the user and each product and outputting the final conversation recommendation result. The present invention uses a new and different graph construction method, which can effectively reduce information loss, while adding global conversation information, and can effectively add collaborative information to improve the recommendation effect and diversity of the current conversation; and the method of the present invention has high reliability, good accuracy, and is scientific and effective.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer technology, and in particular relates to a conversation recommendation method based on graph neural network. Background Art

[0002] With the development of economy and technology, e-commerce, social networking, long and short videos and other fields have developed rapidly. With the increase in the number of users, the popularization and application of big data technology and the increasing requirements of users for user experience, it is particularly important to provide personalized recommendations for different users.

[0003] A session refers to a sequence of products that a user interacts with over a period of time, such as click records on an e-commerce platform or viewing records on a short video platform. Sessions are usually naturally separated by time, and the interaction information within a session can better reflect the user's interests and preferences at the time. For example, a user browsed a series of sports products on an e-commerce platform on one day and bought some clothes on another day. Therefore, compared to traditional recommendation algorithms, session-based recommendation methods can effectively capture users' dynamic interests and make personalized recommendations.

[0004] In recent years, with the rapid development of graph neural network models, graph neural networks have performed well in conversation recommendation. However, the current conversation recommendation methods based on graph neural network models have the problem of simple conversation graph construction methods, which will lead to the loss of conversation information and thus fail to give full play to the feature aggregation extraction of graph neural network models. In addition, in anonymous conversation recommendation methods, existing recommendation methods cannot effectively utilize global conversation information, and the effectiveness, diversity, and accuracy of recommendations need to be improved. Summary of the invention

[0005] The purpose of the present invention is to provide a conversation recommendation method based on graph neural network with high reliability, good accuracy and scientific and effective.

[0006] The conversation recommendation method based on graph neural network provided by the present invention comprises the following steps:

[0007] S1. Use all conversation sequences to build a global conversation graph;

[0008] S2. Use the current conversation sequence to build a local conversation graph;

[0009] S3. Based on the global conversation graph obtained in step S1, input the global conversation graph neural network to obtain a global information feature representation;

[0010] S4. Based on the local conversation graph obtained in step S2, the local conversation graph neural network is input to obtain a local information feature representation;

[0011] S5. Combining the global information feature representation obtained in step S3 and the local information feature representation obtained in step S4 to obtain a conversation sequence feature representation;

[0012] S6. Based on the feature representation of the conversation sequence obtained in step S5, an attention mechanism is used to obtain a final feature representation;

[0013] S7. Based on the final feature representation obtained in step S6, the scores of the user and each product are calculated, and the final session recommendation result is output based on the scores.

[0014] The step S1 of using all the conversation sequences to construct a global conversation graph specifically includes the following steps:

[0015] A. Traverse all session sequences and count the occurrence frequency of all products;

[0016] B. According to the frequency of occurrence of all commodities counted in step A, select the top α high-frequency commodities to form a high-frequency commodity set N f ; α is the set value;

[0017] C. Traverse each session sequence S again 1 ,v 2 ,...,v i ,...,v l}, for any two nodes v in the conversation sequence S i and v j , if node v i At node v j Appears before and v i and v j All belong to the high-frequency commodity set N f , then construct an edge (v i ,v j );

[0018] D. Finally, a global session graph is constructed, and the constructed global session graph is an unweighted and undirected graph.

[0019] The construction of a local conversation graph using the current conversation sequence described in step S2 specifically includes the following steps:

[0020] a. For the current session sequence S = {v 1 ,v 2 ,...,v i ,...,v l}, for node v i Build a link to node v with the nodes within the first ε steps i ; ε is the set parameter;

[0021] b. Count the time users stay at each node, calculate the time interval between adjacent nodes, and perform normalization to obtain the initial weight;

[0022] c. Finally, a local session graph is constructed, and the constructed local session graph is a directed weighted graph.

[0023] Step S3, based on the global conversation graph obtained in step S1, inputs the global conversation graph neural network to obtain a global information feature representation, specifically comprising the following steps:

[0024] (1) For each input conversation sequence feature H = [h v1 ,h v2 ,...,h vi ,...,h vn ], calculate the mean s of the conversation sequence feature H as Where h vi is the feature representation of the i-th node in the session sequence, S is the current session sequence, |S| is the number of nodes contained in session S;

[0025] (2) The following formula is used to calculate the session-based attention coefficient δ(v i ,v j ):

[0026] δ(v i ,v j )=p T leakyRelu(W 1 (s⊙h vi ))

[0027] Where p is the first parameter matrix; W 1 is the second parameter matrix; leakyRelu() is the activation function; ⊙ vector dot product operation;

[0028] (3) Normalize the attention coefficient calculated in step (2);

[0029] (4) Use the attention coefficient to aggregate features and obtain In the formula is the global feature representation of the ith node in the conversation sequence; δ(v i ,v j ) is the normalized node v i and v j The attention coefficient between Represents the set of neighbor nodes of node i;

[0030] (5) The feature aggregation result obtained in step (4) is passed through L g After layering graph neural network, we get the global information feature representation H gfor in is the global feature representation of the i-th node in the conversation sequence.

[0031] Step S4, based on the local conversation graph obtained in step S2, inputs the local conversation graph neural network to obtain a local information feature representation, specifically including the following steps:

[0032] The local session graph obtained in step S2 is transformed into l After layering graph neural network, the local information feature representation H is obtained l for In the formula For node v i The local feature representation of .

[0033] Step S5 integrates the global information feature representation obtained in step S3 and the local information feature representation obtained in step S4 to obtain the conversation sequence feature representation, which specifically includes the following steps:

[0034] The final conversation sequence feature representation H' is H' = [h' v1 ,h' v2 ,...,h' vi ,...,h' vn ], where h' vi For node v i The feature representation after fusing local and global information, and For node v i The local feature representation of is the global feature representation of the i-th node in the conversation sequence, and β is the weighting coefficient.

[0035] Step S6, based on the feature representation of the conversation sequence obtained in step S5, uses the attention mechanism to obtain the final feature representation, which specifically includes the following steps:

[0036] The final feature representation SS is calculated using the following formula:

[0037]

[0038] Where l is the sequence length; h' vi For node v i Feature representation after fusing local and global information; β i is the attention weighting coefficient and q is the third parameter matrix, σ() is the activation function, W 1 is the second parameter matrix, W 2 is the fourth parameter matrix, b is the learnable parameter, is the mean of the session node features and

[0039] Step S7 calculates the scores of the user and each product based on the final feature representation obtained in step S6, and outputs the final session recommendation result based on the score, which specifically includes the following steps:

[0040] 1) Based on the final feature representation obtained in step S6, the dot product and softmax function are used to calculate the scores of the user and each product. in is the score size of node i, and Where SS is the final feature representation of the session obtained in step S6, h' vi For node v i Feature representation after fusing local and global information;

[0041] 2) The loss function uses the cross entropy loss function m is the number of session nodes; y i is the real category.

[0042] The conversation recommendation method based on graph neural network provided by the present invention adopts two methods to construct graphs for the global conversation graph and the local conversation graph respectively, utilizes the feature aggregation and extraction of the graph neural network to obtain the corresponding feature representations respectively, and uses the attention mechanism to obtain the final conversation feature representation, and then performs the inner product to obtain the user's score for the product, and outputs the conversation recommendation result according to the score; the present invention uses a new and different graph construction method, which can effectively reduce information loss, and at the same time add global conversation information, and can effectively add collaborative information to improve the recommendation effect and diversity of the current conversation; and the method of the present invention has high reliability, good accuracy, and is scientific and effective. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 The figure is a schematic diagram of the method flow of the present invention. DETAILED DESCRIPTION

[0044] like Figure 1 The method flow chart of the method of the present invention is shown as follows: The conversation recommendation method based on graph neural network provided by the present invention comprises the following steps:

[0045] S1. Use all conversation sequences to build a global conversation graph. The global conversation graph is built using all conversation sequence data. On the one hand, it is to reduce the complexity of the global conversation graph and introduce too much noise. Considering that users usually make repeated purchases or interact with some high-frequency products, it is also to capture the collaborative information between global conversation sequences. The specific implementation includes the following steps:

[0046] A. Traverse all session sequences and count the occurrence frequency of all products;

[0047] B. According to the frequency of occurrence of all commodities counted in step A, select the high-frequency commodities ranked in the top α (for example, the top 50%) to form a high-frequency commodity set N f ; α is the set value;

[0048] C. Traverse each session sequence S again 1 ,v 2 ,...,v i ,...,v l}, for any two nodes v in the conversation sequence S i and v j , if node v i At node v j Appears before and v i and v j All belong to the high-frequency commodity set N f , then construct an edge (v i ,v j );

[0049] D. Finally, a global session graph is constructed, and the constructed global session graph is an unweighted and undirected graph;

[0050] In specific implementation, a dataset of user interaction conversation sequences with products on an entertainment software or e-commerce platform can be obtained; interaction behaviors usually include clicks, purchases, favorites, etc.

[0051] S2. Use the current conversation sequence to construct a local conversation graph; the local conversation graph focuses on local information; specifically includes the following steps:

[0052] a. For the current session sequence S = {v 1 ,v 2 ,...,v i ,...,v l}, for node v i Build a link to node v with the nodes within the first ε steps (for example, 2 steps) i ; ε is the set parameter;

[0053] b. Count the time users spend at each node (the longer users stay at the current product, the more interested they may be), calculate the time intervals between adjacent nodes, and perform normalization to obtain the initial weights;

[0054] c. Finally, a local session graph is constructed, and the constructed local session graph is a directed weighted graph;

[0055] S3. Based on the global conversation graph obtained in step S1, the global conversation graph neural network is input to obtain a global information feature representation; specifically, the steps include:

[0056] (1) For each input conversation sequence feature H = [h v1 ,h v2 ,...,h vi ,...,h vn ], calculate the mean s of the conversation sequence feature H as Where h vi is the feature representation of the i-th node in the session sequence, S is the current session sequence, |S| is the number of nodes contained in session S;

[0057] (2) The following formula is used to calculate the session-based attention coefficient δ(v i ,v j ):

[0058] δ(v i ,v j )=p T leakyRelu(W 1 (s⊙h vi ))

[0059] Where p is the first parameter matrix; W 1 is the second parameter matrix; leakyRelu() is the activation function; ⊙ represents the vector dot product operation;

[0060] (3) Normalize the attention coefficient calculated in step (2);

[0061] (4) Use the attention coefficient to aggregate features and obtain In the formula is the global feature representation of the ith node in the conversation sequence; δ(v i ,v j ) is the normalized node v i and v j The attention coefficient between Represents the set of neighbor nodes of node i;

[0062] (5) The feature aggregation result obtained in step (4) is passed through L g After layering graph neural network, we get the global information feature representation H g for in is the global feature representation of the i-th node in the conversation sequence;

[0063] S4. Based on the local conversation graph obtained in step S2, the local conversation graph neural network is input to obtain a local information feature representation; specifically, the steps include:

[0064] The local session graph obtained in step S2 is transformed into lAfter layering graph neural network, the local information feature representation H is obtained l for In the formula For node v i Local feature representation of ;

[0065] S5. Combining the global information feature representation obtained in step S3 and the local information feature representation obtained in step S4, a conversation sequence feature representation is obtained; specifically comprising the following steps:

[0066] The final conversation sequence feature representation H' is H' = [h' v1 ,h' v2 ,...,h' vi ,...,h' vn ],h' vi For node v i The feature representation after fusing local and global information, and For node v i The local feature representation of is the global feature representation of the i-th node in the conversation sequence, and β is the weighting coefficient;

[0067] S6. Based on the conversation sequence feature representation obtained in step S5, the attention mechanism is used to obtain the final feature representation; specifically, the following steps are included:

[0068] The final feature representation SS is calculated using the following formula:

[0069]

[0070] Where l is the sequence length; h' vi For node v i Feature representation after fusing local and global information; β i is the attention weighting coefficient and q is the third parameter matrix, σ() is the activation function, W 1 is the second parameter matrix, W 2 is the fourth parameter matrix, b is the learnable parameter, is the mean of the session node features and

[0071] S7. Based on the final feature representation obtained in step S6, the scores of the user and each product are calculated, and the final session recommendation result is output based on the score; specifically, the steps include:

[0072] 1) Based on the final feature representation obtained in step S6, the dot product and softmax function are used to calculate the scores of the user and each product. in is the score size of node i, and Where SS is the final feature representation of the session obtained in step S6, h' vi For node v i Feature representation after fusing local and global information;

[0073] 2) The loss function uses the cross entropy loss function m is the number of session nodes; y i is the real category.

Claims

1. A conversation recommendation method based on graph neural network, comprising the following steps: S1. Construct a global conversation graph using all conversation sequences; specifically, the following steps are included: A. Traverse all session sequences and count the occurrence frequency of all products; B. According to the frequency of occurrence of all commodities counted in step A, select the top α high-frequency commodities to form a high-frequency commodity set N f ; α is the set value; C. Traverse each session sequence S again 1 ,v 2 ,...,v i ,...,v l }, for any two nodes v in the conversation sequence S i and v j , if node v i At node v j Appears before and v i and v j All belong to the high-frequency commodity set N f , then construct an edge (v i ,v j ); D. Finally, a global session graph is constructed, and the constructed global session graph is an unweighted and undirected graph; S2. Use the current conversation sequence to construct a local conversation graph; specifically, the following steps are included: a. For the current session sequence S = {v 1 ,v 2 ,...,v i ,...,v l }, for node v i Build a link to node v with the nodes within the first ε steps i ; ε is the set parameter; b. Count the time users stay at each node, calculate the time interval between adjacent nodes, and perform normalization to obtain the initial weight; c. Finally, a local session graph is constructed, and the constructed local session graph is a directed weighted graph; S3. Based on the global conversation graph obtained in step S1, input the global conversation graph neural network to obtain a global information feature representation; S4. Based on the local conversation graph obtained in step S2, the local conversation graph neural network is input to obtain a local information feature representation; S5. Combining the global information feature representation obtained in step S3 and the local information feature representation obtained in step S4, a conversation sequence feature representation is obtained; specifically comprising the following steps: The final conversation sequence feature representation H' is H' = [h v ' 1 ,h v ' 2 ,...,h v ' i ,...,h v ' n ], where h v ' i For node v i The feature representation after fusing local and global information, and For node v i Local session feature representation, is the global feature representation of the i-th node in the conversation sequence, and β is the weighting coefficient S6. Based on the feature representation of the conversation sequence obtained in step S5, an attention mechanism is used to obtain a final feature representation; S7. Based on the final feature representation obtained in step S6, the scores of the user and each product are calculated, and the final session recommendation result is output based on the scores.

2. The conversation recommendation method based on graph neural network according to claim 1, Features Step S3, based on the global conversation graph obtained in step S1, inputs the global conversation graph neural network to obtain a global information feature representation, specifically comprising the following steps: (1) For each input conversation sequence feature H = [h v1 ,h v2 ,...,h vi ,...,h vn ], calculate the mean s of the conversation sequence feature H as Where h vi is the feature representation of the i-th node in the session sequence, S is the current session sequence, |S| is the number of nodes contained in session S; (2) The following formula is used to calculate the session-based attention coefficient δ(v i ,v j ): δ(v i ,v j )=p T leakyRelu(W 1 (s⊙h vi )) Where p is the first parameter matrix; W 1 is the second parameter matrix; leakyRelu() is the activation function; ⊙ represents the vector dot product operation; (3) Normalize the attention coefficient calculated in step (2); (4) Use the attention coefficient to aggregate features and obtain In the formula is the global feature representation of the ith node in the conversation sequence; δ(v i ,v j ) is the normalized node v i and v j The attention coefficient between Represents the set of neighbor nodes of node i; (5) The feature aggregation result obtained in step (4) is passed through L g After layering graph neural network, we get the global information feature representation H g for in is the global feature representation of the i-th node in the conversation sequence.

3. The conversation recommendation method based on graph neural network according to claim 2, Features Step S4, based on the local conversation graph obtained in step S2, inputs the local conversation graph neural network to obtain a local information feature representation, specifically including the following steps: The local session graph obtained in step S2 is transformed into l After layering graph neural network, the local information feature representation H is obtained l for In the formula For node v i The local feature representation of .

4. The conversation recommendation method based on graph neural network according to claim 1, Features Step S6, based on the conversation sequence feature representation obtained in step S5, uses the attention mechanism to obtain the final feature representation, which specifically includes the following steps: The final feature representation SS is calculated using the following formula: Where l is the sequence length; h v ' i For node v i Feature representation after fusing local and global information; β i is the attention weighting coefficient and q is the third parameter matrix, σ() is the activation function, W 1 is the second parameter matrix, W 2 is the fourth parameter matrix, b is the learnable parameter, is the mean of the session node features and 5. The conversation recommendation method based on graph neural network according to claim 4, Features Step S7 calculates the scores of the user and each product based on the final feature representation obtained in step S6, and outputs the final session recommendation result based on the score, which specifically includes the following steps: 1) Based on the final feature representation obtained in step S6, the dot product and softmax function are used to calculate the scores of the user and each product. in is the score size of node i, and Where SS is the final feature representation of the session obtained in step S6, and h v ' i For node v i Feature representation after fusing local and global information; 2) The loss function uses the cross entropy loss function m is the number of session nodes; y i is the real category.