A Session Recommendation Method Based on Enhanced User Intent
By adding intention nodes to the session sequence and using sparse attention networks and comparative learning to enhance user intentions, the problem of failure to effectively capture user intention characteristics in the prior art is solved, and a more accurate and personalized recommendation effect is achieved.
Patent Information
- Application Number
- CN202310225305.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-09
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2043-03-09
AI Technical Summary
The existing session-based recommendation system fails to effectively capture user intent characteristics in the session, resulting in insufficient accuracy and personalization of recommendations.
Add intent nodes to the session sequence, use sparse attention network to model, calculate the feature representation of the intent nodes, and enhance user intent through comparative learning, combining the self-attention layer and cross-entropy loss to optimize the recommended model.
By fully exploring the user's intention characteristics, the accuracy and personalization of the recommendation system are improved, and the accuracy and real-timeness of the recommendation are improved.
Smart Images

Figure CN116431901B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a recommendation technology based on enhanced user intent, and specifically to a method for effectively recommending candidate items by using user intent features extracted from session sequences, belonging to the technical field of data mining and applications. Background Art
[0002] In recent years, with the development of the Internet and social networks, recommendation systems have become one of the most popular research directions in the field of data mining.
[0003] A recommendation system is a process of mining user preferences and interests by using the interaction information between users and items, and inferring the future behavior of users. Among them, a session-based recommendation system mines user intentions and preferences from session data generated by users to make more accurate and real-time recommendations. Accurately and personalized predicting the information needed by users can be used in many scenarios such as customer preference prediction, news recommendation, video on demand, etc., and can produce extensive social benefits.
[0004] At present, many achievements have been made in the research on session-based recommendation systems, but there are still many challenges. In the interaction between users and items, the information reflected by the order of user clicks is rich and abstract. By using neural networks to model sequence information, comprehensive user preferences can be obtained, and more accurate and personalized recommendations can be made for users, which can play a positive role in promoting research in aspects such as recommendation, search, and advertising, and can also further promote the rapid development of applications and industries related to session-based recommendation.
[0005] Existing session-based recommendation systems mainly use recurrent neural networks, attention mechanisms, and graph neural networks for modeling, and predict user behavior by capturing internal session features. However, since a session contains multiple user intentions, the existing technology does not consider the intention changes of users in the session and cannot accurately and effectively capture the user intention features in the session. Summary of the Invention
[0006] The purpose of the present invention is to address the deficiencies and defects such as the lack of full exploration of user intention information in the session in the prior art, and to solve technical problems such as effectively capturing user intention features in the session. A session recommendation method based on enhanced user intent is creatively proposed.
[0007] The present invention is implemented by the following technical solutions.
[0008] First, the relevant concepts are explained as follows:
[0009] 1. Session sequence S
[0010] The expression is: S = {s1, s2, s3, s4,..., sn-1 , s n}, representing the conversation sequence for which user intention mining is required. There are n items s1, s2, s3, s4,..., s n-1 , s n , where the subscript n is the length of the conversation sequence, and s n represents the nth item in the conversation.
[0011] 2. Intention node set V
[0012] The expression is: y = {v1, v2,..., v k}, referring to the set of nodes that need to be added to the user conversation sequence to fully mine the user intention in the conversation. There are k nodes v1, v2,..., v k in this node set, and the subscript k is the number of intention nodes.
[0013] A conversation recommendation method based on user intention enhancement, including the following steps:
[0014] Step 1: Add intention nodes to the conversation sequence.
[0015] Specifically, set the intention nodes in the intention node set V to be evenly added to the conversation sequence S to obtain the conversation sequence S I = {s1, s2, v1, s3, s4, v2,..., s n-1 , s n , v k}, where the subscript n is the number of items in the conversation sequence containing intention nodes, the subscript k is the number of intention nodes in the conversation sequence containing intention nodes, and the length of the conversation sequence containing intention nodes is n + k.
[0016] Among them, the intention node set is the set of intention nodes initially set to be added to the user conversation sequence.
[0017] Step 2: For the conversation sequence containing intention nodes, use a sparse attention network to model it and calculate the feature representation of the intention nodes in the conversation sequence.
[0018] Specifically, Step 2 can include the following steps:
[0019] Step 2.1: Use the embedding layer of the attention network to embed each item and intention node in the conversation sequence containing intention nodes into a low-dimensional latent space to obtain the embedding representation of each item and intention node. Then, according to the embedding representation of each item and intention node, obtain the embedding representation of the conversation sequence containing intention nodes: where the subscript n is the number of items in the conversation sequence containing intention nodes, the subscript k is the number of intention nodes in the conversation sequence containing intention nodes, and xi Represents the embedding representation of each item in the conversation sequence containing intent nodes, x I Represents the embedding representation of each intent node in the conversation sequence containing intent nodes.
[0020] Step 2.2: Use the self-attention layer in the attention network to calculate the feature representations of each item and intent node in the conversation sequence containing intent nodes. Specifically as follows:
[0021]
[0022] Among them, W Q , W K , W V are the mapping matrices of the self-attention layer. X is the embedding representation of the conversation sequence containing intent nodes obtained in Step 2.1, and d is the vector dimension of the embedding representation.
[0023] H is the feature representation of the conversation sequence containing intent nodes, h i is the feature representation of each item in the conversation sequence containing intent nodes, h I is the feature representation of each intent node in the conversation sequence containing intent nodes. The subscript n is the number of items in the conversation sequence containing intent nodes, and the subscript k is the number of intent nodes in the conversation sequence containing intent nodes.
[0024] Step 3: For the feature representation of each intent node in the conversation sequence containing intent nodes, use contrastive learning to enhance the user intent represented by each intent node and calculate the contrastive loss between intent nodes.
[0025] Specifically, Step 3 includes the following steps:
[0026] Step 3.1: Add the feature representation h I of each intent node in the conversation obtained in Step 2 to an empty set to obtain the set of feature representations of intent nodes in the conversation
[0027] Step 3.2: Calculate the sum of the contrastive losses between any two different intent nodes in the set of feature representations of intent nodes to obtain the contrastive loss between intent nodes. Specifically as follows:
[0028]
[0029]
[0030] Among them, I is the set of feature representations of intent nodes obtained in Step 3.1, e i , e jis the feature representation of two different intent nodes in the set I of feature representations of intent nodes, sim represents the calculation of the cosine similarity of two vectors, and L cl is the contrast loss between intent nodes.
[0031] Step 4: Use the feature representation H of the conversation sequence containing intent nodes obtained in Step 2 to calculate the vector representation of the conversation sequence.
[0032] Add the feature representation of the last item in the conversation sequence containing intent nodes and the feature representation of the last intent node to obtain the vector representation of the conversation sequence. Specifically as follows:
[0033]
[0034] Among them, is the feature representation of the nth item in the conversation sequence containing intent nodes, is the feature representation of the kth intent node in the conversation sequence containing intent nodes, and m is the vector representation of the conversation sequence.
[0035] Step 5: Calculate the recommendation probability of candidate items, specifically as follows:
[0036] y i = softmax(m T x i ) (5)
[0037] Among them, y i represents the recommendation probability of the i-th candidate item, x i is the embedding representation of the i-th candidate item in the conversation sequence obtained in Step 2.1, and m is the vector representation of the conversation sequence obtained in Step 4.
[0038] After obtaining the recommendation probability of each candidate item, use cross-entropy as the recommendation prediction loss, use the contrast loss between intent nodes as the auxiliary loss, use the sum of the recommendation prediction loss and the contrast loss as the loss function, and use the gradient descent method to update the parameters to minimize the prediction error of the model.
[0039] So far, from Step 1 to Step 5, obtain the recommendation probability of candidate items for the given conversation sequence, and based on the recommendation probability, implement conversation recommendation enhanced by user intent.
[0040] Beneficial effects
[0041] The method of the present invention has the following advantages compared with the prior art:
[0042] This method fully considers the problem that conversational recommendation does not fully exploit the user intent information in the conversation. It uses the intention enhancement method to effectively capture the user intent features, making full use of the information in the conversation and improving the recommendation performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 Flowchart of the method of the present invention. DETAILED DESCRIPTION
[0044] The method of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments.
[0045] like Figure 1 As shown, a conversation recommendation method based on user intent enhancement includes the following steps:
[0046] Step A: Add intent nodes to the conversation sequence;
[0047] Specifically in this embodiment, by adding an intention node to the conversation sequence, a conversation sequence including the intention node is obtained, which is the same as step 1 of the invention;
[0048] Step B: Generate item embeddings and intent node embeddings for conversation sequences containing intent nodes;
[0049] Specifically in this embodiment, through the conversation sequence containing the intent node, the item embedding and the intent node embedding in the 100-dimensional conversation sequence are obtained, which is the same as step 2.1 of the invention content;
[0050] Step C: Calculate the feature representation of the intent node;
[0051] Specifically in this embodiment, the details are the same as step 2.2 of the invention;
[0052] Step D: Calculate the contrast loss between intent nodes:
[0053] Specifically in this embodiment, it is the same as step 3.1 and step 3.2 in the invention content;
[0054] Step E: Calculate the vector representation of the conversation sequence;
[0055] Specifically in this embodiment, it is the same as step 4 in the invention content.
[0056] Step F: Calculate the recommendation probability of candidate items;
[0057] Specifically in this embodiment, it is the same as step 5 in the content of the invention.
[0058] Example
[0059] Taking the session sequence "Session sequence: [Item 1, Item 2, Item 3, Item 4, Item 5, Item 6]; Set of intent nodes: {Intention Figure 1 , Intention 2, Intention 3}" as an example, this embodiment will use specific examples to elaborate in detail the specific operation steps of a recommendation method based on an adaptive session selection mechanism described in the present invention;
[0060] A session recommendation method based on enhanced user intent, as Figure 1 shown, includes the following steps:
[0061] Step A: Add intent nodes to the session sequence;
[0062] Specifically in this embodiment, by adding intent nodes to the session sequence, a session sequence containing intent nodes is obtained: [Item 1, Item 2, Intention Figure 1 , Item 3, Item 4, Intention 2, Item 5, Item 6, Intention 3];
[0063] Step B: Generate item embeddings and intent node embeddings of the session sequence containing intent nodes;
[0064] Specifically in this embodiment, through the embedding layer of the attention network, the items and intent nodes in the session sequence containing intent nodes are embedded into the latent space, obtaining 100-dimensional item embeddings and intent node embeddings in the session sequence;
[0065] Step C: Calculate the feature representation of the intent nodes;
[0066] Specifically in this embodiment, the self-attention layer of the attention network is used to train the items and intent nodes in the session sequence containing intent nodes to obtain the feature representations of the items and intent nodes;
[0067] Step D: Calculate the contrastive loss between intent nodes:
[0068] Specifically in this embodiment, calculate the Figure 1 cosine similarities between the three intent nodes of Intention Figure 1 , Intention 2, and Intention 3 and sum them to obtain the contrastive loss between intent nodes;
[0069] Step E: Calculate the vector representation of the session sequence;
[0070] Specifically in this embodiment, add the feature representation of Item 6 and the feature representation of Intention 3 to obtain the vector representation of the session sequence.
[0071] Step F: Calculate the candidate item recommendation probability;
[0072] Specifically in this embodiment, calculate the recommendation probability by taking the inner product of the vector representation of the session sequence and the candidate items to obtain the item most likely to be recommended.
Claims
1. A session recommendation method based on enhanced user intent, characterized in that, It includes the following steps: Step 1: Add intent nodes to the conversation sequence; The intention nodes in the set V of intention nodes are evenly added to the session sequence S to obtain the session sequence S containing intention nodes I ={s1, s2, v1, s3, s4, v2,..., s n-1 , s n , v k}, where the subscript n is the number of items in the session sequence containing intention nodes, the subscript k is the number of intention nodes in the session sequence containing intention nodes, and the length of the session sequence containing intention nodes is n + k; Among them, the intention node set is a set of intention nodes that are initially set and need to be added to the user session sequence. Its expression is: V = {v1, v2,..., v k}, which refers to the set of nodes that need to be added to the user session sequence to fully mine the user intention in the session. There are k nodes v1, v2,..., v k in this node set, and the subscript k is the number of intention nodes; Conversation sequence S = {s1, s2, s3, s4,..., s n-1 , s n}, representing the conversation sequence for which user intention mining is required. There are n items s1, s2, s3, s4,..., s n-1 , s n in this sequence. The subscript n is the length of the conversation sequence, and s n represents the nth item in the conversation; Step 2: For the conversation sequence containing intent nodes, model it using a sparse attention network and calculate the feature representations of the intent nodes in the conversation sequence; Step 3: For the feature representations of each intent node in the conversation sequence containing intent nodes, enhance the user intent represented by each intent node using contrastive learning and calculate the contrastive loss between intent nodes; The steps are as follows: Step 3.1: Add the feature representation h of each intent node in the conversation obtained in Step 2 I to an empty set to obtain a set of feature representations of intent nodes in the conversation Step 3.2: Calculate the sum of the contrastive losses between any two different intent nodes in the set of feature representations of intent nodes to obtain the contrastive loss between intent nodes, specifically as follows: Among them, I is the set of feature representations of the intent nodes obtained in step 3.1, e i , e j are the feature representations of two different intent nodes in the set of feature representations I of the intent nodes, sim represents the calculation of the cosine similarity of two vectors, and L cl is the contrastive loss between intent nodes; Step 4: Use the feature representation of the conversation sequence containing intent nodes obtained in Step 2 to calculate the vector representation of the conversation sequence; Step 5: Calculate the recommendation probability of candidate items; After obtaining the recommendation probabilities of each candidate item, use cross-entropy as the recommendation prediction loss, use the contrastive loss between intent nodes as the auxiliary loss, use the sum of the recommendation prediction loss and the contrastive loss as the loss function, and update the parameters using gradient descent to minimize the prediction error of the model.
2. The session recommendation method based on enhanced user intention as claimed in claim 1, wherein, Step 2 includes the following steps: Step 2.1: Using the embedding layer of the attention network, embed each item and the intent node in the session sequence containing the intent node into a low-dimensional latent space to obtain the embedding representations of each item and the intent node; then, based on the embedding representations of each item and the intent node, obtain the embedding representation of the session sequence containing the intent node: The subscript n is the number of items in the session sequence containing the intent node, the subscript k is the number of intent nodes in the session sequence containing the intent node, and x i represents the embedding representation of each item in the session sequence containing the intent node, and x I represents the embedding representation of each intent node in the session sequence containing the intent node; Step 2.2: Use the self-attention layer in the attention network to calculate the feature representations of each item and intent node in the conversation sequence containing intent nodes; specifically as follows: Among them, W Q , W K , W V is the mapping matrix of the self-attention layer; X is the embedding representation of the session sequence containing intent nodes obtained in step 2.1, and d is the vector dimension of the embedding representation; H is the feature representation of a conversation sequence containing intent nodes, h i is the feature representation of each item in the conversation sequence containing intent nodes, h I is the feature representation of each intent node in the conversation sequence containing intent nodes, where the subscript n is the number of items in the conversation sequence containing intent nodes, and the subscript k is the number of intent nodes in the conversation sequence containing intent nodes.
3. The session recommendation method based on enhanced user intention as claimed in claim 1, wherein Step 4 includes the following steps: Add the feature representation of the last item and the feature representation of the last intent node in the conversation sequence containing intent nodes to obtain the vector representation of the conversation sequence, specifically as follows: Among them, is the feature representation of the nth item in the conversation sequence containing intent nodes, is the feature representation of the kth intent node in the conversation sequence containing intent nodes, and m is the vector representation of the conversation sequence.
4. The session recommendation method based on enhanced user intention as claimed in claim 1, wherein In Step 5, the method for calculating the recommendation probability of candidate items is as follows: Among them, y i represents the recommendation probability of the i-th candidate item, and x i is the embedding representation of the i-th candidate item in the session sequence obtained in step 2, and m is the vector representation of the session sequence obtained in step 4.
Citation Information
Patent Citations
Graph neural network recommendation method based on time interval enhancement
CN113821724A
Session recommendation method, system and equipment based on self-supervised graph learning
CN114969561A