Graph neural network session recommendation method based on user behaviors

By constructing directed graphs and graph attention blocks in session recommendations, combining macro and micro representation learning modules, the relationship between click behavior and purchase behavior is captured, and the relationship between behavior progressive relationships and perspective transfer modes in the prior art are solved. Problem, improving the accuracy and relevance of recommendations.

CN119248919AInactive Publication Date: 2025-01-03NANJING UNIV OF AERONAUTICS & ASTRONAUTICS
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411395404.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-08
Publication Date
2025-01-03
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing session recommendation method ignores the progressive relationship between click behavior and purchase behavior, resulting in data sparsity problems and poor recommendation results, and fails to effectively capture behavior transfer patterns from different perspectives.

Method used

A graph neural network session recommendation method based on user behavior is proposed. By constructing directed graphs and graph attention blocks, the relationship between click behavior and purchase behavior is learned, and the macro and micro representation learning modules are combined to capture the Behavior transfer model strengthens the learning process of purchasing behavior.

Benefits of technology

It improves the accuracy and relevance of recommendations, effectively alleviates the problem of data sparsity, better captures user interests and preferences, and provides more immediate and personalized recommendations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119248919A_ABST
    Figure CN119248919A_ABST
Patent Text Reader

Abstract

The invention discloses a graph neural network session recommendation method based on user behaviors, and the method comprises the following steps: preparing a session recommendation data set which comprises a behavior sequence of an anonymous user in a single session, i.e., the interaction history of clicking and purchasing of the user, and for an input user session sequence, carrying out the interaction history of clicking and purchasing of the user; dividing the sequence into four types of sequences: a click behavior sequence, a purchase behavior sequence, a project sequence and a behavior sequence corresponding to the project sequence, and respectively constructing directed graphs; the project representation learning process is divided into two view angles, namely a macroscopic view angle and a microscopic view angle; in a macroscopic perspective, using a graph neural network to take a click behavior learning result as input of purchase behavior learning, so as to capture a behavior progressive relationship in a macroscopic level; in the microscopic perspective, the graph neural network is used for learning the embedded representation of the item sequence, the gated recurrent neural network is used for learning the embedded representation of the behavior sequence, and then fusion is carried out, so that the behavior transfer mode of the microscopic level is captured; and then an attention mechanism is introduced, project attention weights and influence coefficients representing projects are calculated, aggregation is carried out according to the coefficients, final session representation is obtained through calculation, and a prediction result is given. According to the method, the graph neural network and the attention mechanism are selected, the transfer mode of the nodes can be captured, and the good session modeling capability is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of conversation recommendation systems, and uses a graph neural network and an attention mechanism to implement a method for predicting a user's next purchase item. Background Art

[0002] As an effective solution to alleviate the problem of information overload in the information age, recommender systems have made significant progress in recent years. Traditional recommendation systems usually rely on users' existing profiles and long-term interaction histories. However, in some cases, these assumptions may no longer hold. For example, when users are not logged in or have insufficient interaction history, the effectiveness of traditional recommendation systems is limited. In addition, users' interests and needs may change significantly over different time periods. Therefore, more adaptive methods are needed to handle these rapidly changing environments. Session-based recommendations (SBR) prioritize short-term user interaction sequences, consider users' current interests, and provide more immediate and personalized recommendations to address these challenges.

[0003] At present, scholars have proposed many deep neural network methods to address the challenges of SBR. Recurrent neural networks (RNNs) can capture the sequential information of sequences and are very popular in this field, but they also have certain limitations, especially in dealing with long-term dependencies and effectively capturing complex user preferences. The attention mechanism is a valuable supplement that enhances the model's ability to focus on relevant information in a sequence. Graph neural networks (GNNs) are the current mainstream method and offer various advantages, especially in modeling complex user-item interactions. GNNs are good at capturing structural information, modeling user preferences, and improving recommendation accuracy. However, most current methods focus on single user behaviors and ignore the impact of multiple behaviors in a session.

[0004] In many platforms, direct benefits are often associated with a single user's behavior, such as purchase behavior in e-commerce platforms, but the number of such interactions is small. Relying solely on such a single behavior for recommendation may lead to serious data sparsity problems. However, click behavior in e-commerce platforms can effectively alleviate the challenge of data sparsity by providing users with additional product information and helping them make decisions. By combining multiple types of user behaviors, the recommendation system can learn more comprehensive and informative user preferences, ultimately improving the quality and relevance of recommendations. Summary of the invention

[0005] Most of the existing conversational recommendation methods only use click sequences to recommend the next clicked item for users, which ignores the platform's revenue issues. Some scholars propose to use purchase behavior as the target behavior and click behavior as an auxiliary behavior to recommend the next purchase item for users, but they only process these two behaviors separately and merge them at the end, ignoring the progressive relationship between click behavior and purchase behavior. In order to capture the relationship between the two behaviors, we propose to use the embedded representation learned from click behavior as input to strengthen the learning process of purchase behavior. In addition, they also ignore the behavior transfer patterns from different perspectives. For this reason, we propose an additional micro-representation learning module to learn behavior transfer patterns from different perspectives. In general, the present invention proposes a method for graph neural network conversational recommendation based on user behavior.

[0006] To achieve the above object, the technical solution adopted by the present invention is: a method for graph neural network conversation recommendation based on user behavior, comprising the following steps:

[0007] Step 1: Prepare a session recommendation dataset and construct a directed graph. The session recommendation dataset contains the interaction history of anonymous users during a session, where purchase behavior is considered as the target behavior and click behavior is considered as an auxiliary behavior. For a session sequence, the sequence is divided into four types of sequences, namely click sequence, purchase sequence, item sequence, and behavior sequence corresponding to the item sequence, and a directed graph is constructed for each.

[0008] In step 1, we use three session recommendation datasets, namely Yoochoose, Tmall, and Cosmetics. For an anonymous sequence in the dataset, we divide the training sequence and label according to the following rules: For the purchase sequence s(b) = [v b,1 ,v b,2 ,…,v b,s(b)| ], we will [v b,1 ,v b,2 ,…,v b,i-1 ] is considered as the input sequence, and v b,o As a label. For the click sequence s(c), we only keep the sequence before the label to prevent data leakage. We set the maximum length L of each sequence. If the sequence length exceeds L, only the last L items are kept. Then the training set and test set are divided in chronological order. Taking the Yoochoose dataset as an example, it contains 24239 items, the training set contains 163005 sequences, the validation set contains 12985 sequences, and the test set contains 25971 sequences.

[0009] For an input session sequence s, it is constructed as a directed graph in represents an item in the sequence, It is represented as a directed edge, which is the adjacent item in the conversation. The directed graph contains four types of edges, namely, incoming edges, outgoing edges, bidirectional edges, and self-loop edges.

[0010] Step 2: Build a graph attention block, whose input is the constructed directed graph. For the input directed graph, weights are assigned to the neighboring nodes of each node in the graph to determine their influence on the current node, and then the neighboring nodes are aggregated according to the influence to complete information aggregation. Then, multi-layer graph neural networks are stacked to capture multi-hop neighbor information and enhance the model's ability to represent complex graph structures.

[0011] In step 2, the overall structure of the graph attention block is as follows:

[0012] v→Graph Attention Block→v'

[0013] Where v is the initial item embedding and v' is the updated item embedding. For the constructed directed graph, the graph attention network is used to update the node embedding. Considering that different nodes in the graph have different importance to the current node, the attention coefficient is first calculated:

[0014]

[0015] In the formula, p ij Indicates the importance of node j to node i, represents the node embedding representation of the l-1th layer, Represents the embedding vectors of four types of edges, and ⊙ represents element-wise multiplication. LeakyReLU is used as the activation function here. Then the softmax function is used to calculate the normalized attention weights to make the weights comparable:

[0016]

[0017] in Represents the neighboring nodes of node i. Finally, the updated embedding representation of the l-th layer item is calculated based on the weight:

[0018]

[0019] Through the graph attention block, multiple layers of graph neural networks can be stacked to capture multi-hop neighbor information and enhance the model's ability to represent complex graph structures.

[0020] Step 3: Construct a macro representation learning module. From a macro perspective, users always click first and then purchase. For the input item embedding representation, first use the directed graph constructed by the click sequence to transfer information of the graph attention to obtain the updated item embedding Vc; then use the directed graph constructed by the purchase sequence to aggregate information to obtain the item representation Vb, and the input of the graph attention block is Vc. In this way, the module can capture the progressive relationship between behaviors.

[0021] In step 3, the overall process of the macro representation learning module is as follows:

[0022] v→Click on the graph attention block→v c →Buy graph attention block →v b

[0023] in Represents the initial item embedding matrix. Taking v as the input matrix and inputting it into the click graph attention block, we can capture the item transfer pattern in the click behavior and get the output in is the l-th layer output of the graph attention block Then v c As the input matrix, it is input into the purchase graph attention block to get the output v b . Therefore, it is possible to learn the transfer pattern of purchase behavior based on the transfer pattern of click behavior, and strengthen the learning process of purchase behavior by taking click behavior as the basis of purchase behavior.

[0024] Step 4: Construct a micro-representation learning module. From a micro perspective, users always have behavior transfer in a session. For a session sequence, convert the session sequence into a project sequence and a behavior sequence. Use the graph attention block to complete the information aggregation of the project sequence, use the gated recurrent neural network to capture the behavior transfer pattern, and fuse the two to obtain the project embedding representation from a micro perspective.

[0025] In step 4, the overall process of the micro-representation learning module is as follows:

[0026] v,o→micro-representation learning→v'

[0027] in represents a sequence of items that are independent of behavior, and o = [o1, o2, ..., o n] represents the behavior sequence corresponding to the item sequence. In order to capture the user behavior preference information from a micro perspective, the micro representation learning module inputs the corresponding two sequences and adopts different information propagation mechanisms for the two sequences. For the item sequence, the graph attention block is used, because in the conversation sequence, the propagation paradigm of the items is complex. Not only the previous item will affect the current item, but the following items will also have an impact on the current item. Therefore, the graph neural network can better capture effective information. For the behavior sequence, the information that this module needs to capture is the progressive relationship of the behavior. Therefore, it is more appropriate to use a gated recurrent neural network.

[0028] For the gated recurrent neural network module, the input is the embedding matrix of the item sequence:

[0029] z i =σ(W z o i +U z h i-1 )

[0030] r i =σ(W r o i +U r h i-1 )

[0031]

[0032] In the formula, z i is the update gate, r i is the reset gate, W and U are trainable parameters, and σ is the sigmoid activation function. i Represents the hidden state of the i-th step, initialized to That is, the embedding representation of the first behavior. After the gated recurrent neural network, the updated behavior sequence embedding representation can be obtained. Finally, the item sequence embedding and the behavior sequence embedding are aggregated to obtain the output of the micro-representation learning module:

[0033]

[0034] In the formula, || represents the concatenation operation. By using the above method, it can be ensured that sequences with the same items may have different representations when their operation sequences are different, so that user preferences can be identified and understood at the micro level.

[0035] Step 5: Construct a session representation learning module, whose input is the updated item representation. Using the attention mechanism, calculate the item attention weight, which represents the influence coefficient between items, and aggregate according to the coefficient to calculate the final session representation and give the prediction result.

[0036] In step 5, the overall process of the conversation representation learning module is as follows:

[0037] v→Conversational Representation Learning→s

[0038] For an updated sequence v = [x1, x1, …, x m ], and input it as the input sequence to the session representation learning module to obtain the corresponding session representation. Since different positions in the sequence have different effects on user preferences, the later interactive items have a greater impact on user preferences. Therefore, this module integrates the position embedding in the item sequence to learn this feature:

[0039] t i =σ(W1[x i ||p i ]+b1)

[0040] In the formula, p i represents reverse position embedding, and is a trainable parameter, σ represents the activation function, and tanh is used here. Next, the attention mechanism is used to calculate the embedding representation of the session sequence. Since the last item in the sequence can express the user's current preference, this item is used to guide the calculation of attention. Specifically, for an item x in the session, t , the attention weight is calculated as follows:

[0041]

[0042] In the formula, x m is the embedding representation of the last item in the sequence, and then the session representation s of the current session sequence can be calculated v :

[0043]

[0044] Through the session representation learning module, we can get a session representation of a session sequence. In the previous item representation learning module, we learned different item representations from micro and macro perspectives and obtained two sequence representations. Therefore, we fuse these two representations to get the final session representation s:

[0045] s=Agg(s macro ,s micro )=s macro +s micro

[0046] Then, the probability of each candidate item can be calculated through the inner product, and recommendations can be made for users based on the probability:

[0047]

[0048] The candidate project x i Finally, the cross entropy loss function is used to train the model:

[0049]

[0050] Through the above steps, the next item that the user may purchase can be recommended to the user based on the user's anonymous session sequence. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 This is the overall structure diagram of the graph attention block in the present invention;

[0052] Figure 2 This is the overall structure diagram of the macro representation learning in the present invention;

[0053] Figure 3 It is the overall structure diagram of microscopic representation learning in the present invention;

[0054] Figure 4 This is the overall structural diagram of conversation representation learning in the present invention;

[0055] Figure 5 It is the overall structure diagram of the model in the present invention; DETAILED DESCRIPTION

[0056] The present invention will be further explained below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0057] A method for graph neural network conversation recommendation based on user behavior of the present invention comprises the following steps:

[0058] Step 1: Prepare a session recommendation dataset and construct a directed graph. The session recommendation dataset contains the interaction history of anonymous users during a session, where purchase behavior is considered as the target behavior and click behavior is considered as an auxiliary behavior. For a session sequence, the sequence is divided into four types of sequences, namely click sequence, purchase sequence, item sequence, and behavior sequence corresponding to the item sequence, and a directed graph is constructed for each.

[0059] Step 2: Build a graph attention block, whose input is the constructed directed graph. For the input directed graph, weights are assigned to the neighboring nodes of each node in the graph to determine their influence on the current node, and then the neighboring nodes are aggregated according to the influence to complete information aggregation. Then, multi-layer graph neural networks are stacked to capture multi-hop neighbor information and enhance the model's ability to represent complex graph structures.

[0060] Step 3: Construct a macro representation learning module. From a macro perspective, users always click first and then purchase. For the input item embedding representation, first use the directed graph constructed by the click sequence to transfer information of the graph attention to obtain the updated item embedding Vc; then use the directed graph constructed by the purchase sequence to aggregate information to obtain the item representation Vb, and the input of the graph attention block is Vc. In this way, the module can capture the progressive relationship between behaviors.

[0061] Step 4: Construct a micro-representation learning module. From a micro perspective, users always have behavior transfer in a session. For a session sequence, convert the session sequence into a project sequence and a behavior sequence. Use the graph attention block to complete the information aggregation of the project sequence, use the gated recurrent neural network to capture the behavior transfer pattern, and fuse the two to obtain the project embedding representation from a micro perspective.

[0062] Step 5: Construct a session representation learning module, whose input is the updated item representation. Using the attention mechanism, calculate the item attention weight, which represents the influence coefficient between items, and aggregate according to the coefficient to calculate the final session representation and give the prediction result.

[0063] In step 1, we use three session recommendation datasets, namely Yoochoose, Tmall, and Cosmetics. For an anonymous sequence in the dataset, we divide the training sequence and label according to the following rules: For the purchase sequence s(b) = [v b,1 ,v b,2 ,…,v b,|s(b)| ], we will [v b,1 ,v b,2 ,…,v b,i-1 ] is considered as the input sequence, and v b,o As a label. For the click sequence s(c), we only keep the sequence before the label to prevent data leakage. We set the maximum length L of each sequence. If the sequence length exceeds L, only the last L items are kept. Then the training set and test set are divided in chronological order. Taking the Yoochoose dataset as an example, it contains 24239 items, the training set contains 163005 sequences, the validation set contains 12985 sequences, and the test set contains 25971 sequences.

[0064] For an input session sequence s, it is constructed as a directed graph in represents an item in the sequence, It is represented as a directed edge, which is the adjacent item in the conversation. The directed graph contains four types of edges, namely, incoming edges, outgoing edges, bidirectional edges, and self-loop edges.

[0065] In step 2, the overall structure of the graph attention block is as follows: Figure 1 As shown in Figure 2, the overall structure of the graph attention block is as follows:

[0066] v→Graph Attention Block→v'

[0067] Where v is the initial item embedding and v' is the updated item embedding. For the constructed directed graph, the graph attention network is used to update the node embedding. Considering that different nodes in the graph have different importance to the current node, the attention coefficient is first calculated:

[0068]

[0069] In the formula, p ij Indicates the importance of node j to node i, represents the node embedding representation of the l-1th layer, Represents the embedding vectors of four types of edges, and ⊙ represents element-wise multiplication. LeakyReLU is used as the activation function here. Then the softmax function is used to calculate the normalized attention weights to make the weights comparable:

[0070]

[0071] in Represents the neighboring nodes of node i. Finally, the updated embedding representation of the l-th layer item is calculated based on the weight:

[0072]

[0073] Through the graph attention block, multiple layers of graph neural networks can be stacked to capture multi-hop neighbor information and enhance the model's ability to represent complex graph structures.

[0074] In step 3, the overall structure of the macro representation learning is as follows Figure 2 As shown in Figure 2, the overall process of the macro representation learning module is as follows:

[0075] v→Click on the graph attention block→v c →Buy graph attention block →v b

[0076] in Represents the initial item embedding matrix. Taking v as the input matrix and inputting it into the click graph attention block, we can capture the item transfer pattern in the click behavior and get the output in is the l-th layer output of the graph attention block Then v c As the input matrix, it is input into the purchase graph attention block to get the output vb . Therefore, it is possible to learn the transfer pattern of purchase behavior based on the transfer pattern of click behavior, and strengthen the learning process of purchase behavior by taking click behavior as the basis of purchase behavior.

[0077] In step 4, the overall structure of micro-representation learning is as follows Figure 3 As shown in Figure 2, the overall process of the micro-representation learning module is as follows:

[0078] v,o→micro-representation learning→v'

[0079] in represents a sequence of items that are independent of behavior, and o = [o1, o2, ..., o n ] represents the behavior sequence corresponding to the item sequence. In order to capture the user behavior preference information from a micro perspective, the micro representation learning module inputs the corresponding two sequences and adopts different information propagation mechanisms for the two sequences. For the item sequence, the graph attention block is used, because in the conversation sequence, the propagation paradigm of the items is complex. Not only the previous item will affect the current item, but the following items will also have an impact on the current item. Therefore, the graph neural network can better capture effective information. For the behavior sequence, the information that this module needs to capture is the progressive relationship of the behavior. Therefore, it is more appropriate to use a gated recurrent neural network.

[0080] For the gated recurrent neural network module, the input is the embedding matrix of the item sequence:

[0081] z i =σ(W z o i +U z h i -1 )

[0082] r i =σ(W r o i +U r h i - 1 )

[0083]

[0084] In the formula, z i is the update gate, r i is the reset gate, W and U are trainable parameters, and σ is the sigmoid activation function. i Represents the hidden state of the i-th step, initialized to That is, the embedding representation of the first behavior. After the gated recurrent neural network, the updated behavior sequence embedding representation can be obtained. Finally, the item sequence embedding and the behavior sequence embedding are aggregated to obtain the output of the micro-representation learning module:

[0085]

[0086] In the formula, || represents the concatenation operation. By using the above method, it can be ensured that sequences with the same items may have different representations when their operation sequences are different, so that user preferences can be identified and understood at the micro level.

[0087] In step 5, the overall structure diagram of session representation learning is as follows Figure 4 As shown in Figure 2, the overall process of the session representation learning module is as follows:

[0088] v→Conversational Representation Learning→s

[0089] For an updated sequence v = [x1, x1, …, x m ], and input it as the input sequence to the session representation learning module to obtain the corresponding session representation. Since different positions in the sequence have different effects on user preferences, the later interactive items have a greater impact on user preferences. Therefore, this module integrates the position embedding in the item sequence to learn this feature:

[0090] t i =σ(W1[x i ||p i ]+b1)

[0091] In the formula, p i represents reverse position embedding, and is a trainable parameter, σ represents the activation function, and tanh is used here. Next, the attention mechanism is used to calculate the embedding representation of the session sequence. Since the last item in the sequence can express the user's current preference, this item is used to guide the calculation of attention. Specifically, for an item x in the session, t , the attention weight is calculated as follows:

[0092]

[0093] In the formula, x m is the embedding representation of the last item in the sequence, and then the session representation s of the current session sequence can be calculated v :

[0094]

[0095] Through the session representation learning module, we can get a session representation of a session sequence. In the previous item representation learning module, we learned different item representations from micro and macro perspectives and obtained two sequence representations. Therefore, we fuse these two representations to get the final session representation s:

[0096] s=Agg(s macro ,s micro )=s macro +s micro

[0097] Then, the probability of each candidate item can be calculated through the inner product, and recommendations can be made for users based on the probability:

[0098]

[0099] The candidate project x i Finally, the cross entropy loss function is used to train the model:

[0100]

[0101] Through the above steps, the next item that the user may purchase can be recommended to the user based on the user's anonymous session sequence.

[0102] In the present invention, in terms of data set processing, a real conversation recommendation data set is used for training, which enhances the real usability of the algorithm; in terms of network structure, the present invention uses graph neural network and attention mechanism, which can capture different behavior transfer patterns of users and enhance the ability to capture user interests; in terms of prediction targets, the present invention uses click behavior as auxiliary behavior and purchase behavior as target behavior to predict the user's next possible purchase item, which can bring better benefits to the platform. Experiments have proved that the model provided by this method can basically achieve effective prediction of user interests, and the final effect is authentic.

[0103] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for graph neural network session recommendation based on user behavior, comprising the following steps: Step 1: Prepare a session recommendation dataset and construct a directed graph. The session recommendation dataset contains the interaction history of anonymous users during a session, where purchase behavior is considered as the target behavior and click behavior is considered as an auxiliary behavior. For a session sequence, the sequence is divided into four types of sequences, namely click sequence, purchase sequence, item sequence, and behavior sequence corresponding to the item sequence, and a directed graph is constructed for each. Step 2: Build a graph attention block, whose input is the constructed directed graph. For the input directed graph, weights are assigned to the neighboring nodes of each node in the graph to determine their influence on the current node, and then the neighboring nodes are aggregated according to the influence to complete information aggregation. Then, multi-layer graph neural networks are stacked to capture multi-hop neighbor information and enhance the model's ability to represent complex graph structures. Step 3: Construct a macro representation learning module. From a macro perspective, users always click first and then purchase. For the input item embedding representation, first use the directed graph constructed by the click sequence to transfer information of the graph attention to obtain the updated item embedding Vc; then use the directed graph constructed by the purchase sequence to aggregate information to obtain the item representation Vb, and the input of the graph attention block is Vc. In this way, the module can capture the progressive relationship between behaviors. Step 4: Construct a micro-representation learning module. From a micro perspective, users always have behavior transfer in a session. For a session sequence, convert the session sequence into a project sequence and a behavior sequence. Use the graph attention block to complete the information aggregation of the project sequence, use the gated recurrent neural network to capture the behavior transfer pattern, and fuse the two to obtain the project embedding representation from a micro perspective. Step 5: Construct a session representation learning module, whose input is the updated item representation. Using the attention mechanism, calculate the item attention weight, which represents the influence coefficient between items, and aggregate according to the coefficient to calculate the final session representation and give the prediction result.

2. According to claim 1, the method for graph neural network conversation recommendation based on user behavior is characterized by: In step 1, we use three session recommendation datasets, namely Yoochoose, Tmall, and Cosmetics. For an anonymous sequence in the dataset, we divide the training sequence and label according to the following rules: For the purchase sequence s(b) = [v b,1 ,v b,2 ,…,v b,s(b)| ], we will [v b,1 ,v b,2 ,…,v b,i-1 ] is considered as the input sequence, and v b,i As a label. For the click sequence s(c), we only keep the sequence before the label to prevent data leakage. We set the maximum length L of each sequence. If the sequence length exceeds L, only the last L items are kept. Then the training set and test set are divided in chronological order. Taking the Yoochoose dataset as an example, it contains 24239 items, the training set contains 163005 sequences, the validation set contains 12985 sequences, and the test set contains 25971 sequences. For an input session sequence s, it is constructed as a directed graph in represents an item in the sequence, It is represented as a directed edge, which is the adjacent item in the conversation. The directed graph contains four types of edges, namely, incoming edges, outgoing edges, bidirectional edges, and self-loop edges.

3. The method for graph neural network conversation recommendation based on user behavior according to claim 1, characterized in that: In step 2, the overall structure of the graph attention block is as follows: v→Graph Attention Block→v' Where v is the initial item embedding and v' is the updated item embedding. For the constructed directed graph, the graph attention network is used to update the node embedding. Considering that different nodes in the graph have different importance to the current node, the attention coefficient is first calculated: In the formula, p ij Indicates the importance of node j to node i, represents the node embedding representation of the l-1th layer, Represents the embedding vectors of four types of edges, and ⊙ represents element-wise multiplication. LeakyReLU is used as the activation function here. Then the softmax function is used to calculate the normalized attention weights to make the weights comparable: in Represents the neighboring nodes of node i. Finally, the updated embedding representation of the l-th layer item is calculated based on the weight: Through the graph attention block, multiple layers of graph neural networks can be stacked to capture multi-hop neighbor information and enhance the model's ability to represent complex graph structures.

4. The method for graph neural network conversation recommendation based on user behavior according to claim 1, characterized in that: In step 3, the overall process of the macro representation learning module is as follows: v→Click on the graph attention block→v c →Buy graph attention block →v b in Represents the initial item embedding matrix. Taking v as the input matrix and inputting it into the click graph attention block, we can capture the item transfer pattern in the click behavior and get the output in is the l-th layer output of the graph attention block Then v c As the input matrix, it is input into the purchase graph attention block to get the output v b . Therefore, it is possible to learn the transfer pattern of purchase behavior based on the transfer pattern of click behavior, and use click behavior as the basis of purchase behavior to strengthen the learning process of purchase behavior.

5. The method for graph neural network conversation recommendation based on user behavior according to claim 1, characterized in that: In step 4, the overall process of the micro-representation learning module is as follows: v,o→micro-representation learning→v' in represents a sequence of items that are independent of behavior, and o = [o1, o2, ..., o n ] represents the behavior sequence corresponding to the item sequence. In order to capture the user behavior preference information from a micro perspective, the micro representation learning module inputs the corresponding two sequences and adopts different information propagation mechanisms for the two sequences. For the item sequence, the graph attention block is used, because in the conversation sequence, the propagation paradigm of the items is complex. Not only the previous item will affect the current item, but the following items will also have an impact on the current item. Therefore, the graph neural network can better capture effective information. For the behavior sequence, the information that this module needs to capture is the progressive relationship of the behavior. Therefore, it is more appropriate to use a gated recurrent neural network. For the gated recurrent neural network module, the input is the embedding matrix of the item sequence: With i =σ(W z about i +U z h i-1 ) r i =σ(W r the i +U r h i-1 ) In the formula, z i is the update gate, r i is the reset gate, W and U are trainable parameters, and σ is the sigmoid activation function. i Represents the hidden state of the i-th step, initialized to That is, the embedding representation of the first behavior. After the gated recurrent neural network, the updated behavior sequence embedding representation can be obtained. Finally, the item sequence embedding and the behavior sequence embedding are aggregated to obtain the output of the micro-representation learning module: In the formula, ∥ represents the concatenation operation. By using the above method, it can be ensured that sequences with the same items may have different representations when their operation sequences are different, so that user preferences can be identified and understood at the micro level.

6. The method for graph neural network conversation recommendation based on user behavior according to claim 1, characterized in that: In step 5, the overall process of the conversation representation learning module is as follows: v→Conversational Representation Learning→s For an updated sequence v = [x1, x1, …, x m ], and input it as the input sequence to the session representation learning module to obtain the corresponding session representation. Since different positions in the sequence have different effects on user preferences, the later interactive items have a greater impact on user preferences. Therefore, this module integrates the position embedding in the item sequence to learn this feature: t i =σ(W1[x i ||p i ]+b1) In the formula, p i represents reverse position embedding, and is a trainable parameter, σ represents the activation function, and tanh is used here. Next, the attention mechanism is used to calculate the embedding representation of the session sequence. Since the last item in the sequence can express the user's current preference, this item is used to guide the calculation of attention. Specifically, for an item x in the session, t , the attention weight is calculated as follows: In the formula, x m is the embedding representation of the last item in the sequence, and then the session representation s of the current session sequence can be calculated v : Through the session representation learning module, we can get a session representation of a session sequence. In the previous item representation learning module, we learned different item representations from micro and macro perspectives and obtained two sequence representations. Therefore, we fuse these two representations to get the final session representation s: s=Agg(s macro ,s micro )=s macro +s micro Then, the probability of each candidate item can be calculated through the inner product, and recommendations can be made for users based on the probability: The candidate project x i Finally, the cross entropy loss function is used to train the model: Through the above steps, the next item that the user may purchase can be recommended to the user based on the user's anonymous session sequence.

Citation Information

Patent Citations

  • A session sequence recommendation method and system based on a graph convolutional neural network

    CN109816101A