Context-enhanced dialogue recommendation method based on comparative learning

Through contrastive learning and context enhancement technology, the problem of the impact of noise information in anonymous recommendations is solved, the robustness and performance of the recommendation system are improved, and it is suitable for a variety of conversational recommendation scenarios.

CN118690085APending Publication Date: 2024-09-24ANHUI POLYTECHNIC UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410884331.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-03
Publication Date
2024-09-24

AI Technical Summary

Technical Problem

Existing recommendation methods based on graph neural networks are difficult to effectively capture users' true preferences in anonymous recommendation scenarios, and ignore the complex relationships between non-adjacent items when constructing the global graph, resulting in an increase in noise information and reducing the rashness of the model. Great sex.

Method used

A context-enhanced dialogue recommendation method based on contrastive learning is adopted. By constructing a conversational interest graph, introducing context vectors and contrastive learning, the noise robustness is optimized, information outside adjacent items is transferred, and the node representation learning of the graph neural network is improved.

Benefits of technology

It effectively alleviates the noise information in behavior sequences and cross-session graphs, improves the performance and robustness of the recommendation system, enables the graph neural network to obtain more information when learning node representations, and is suitable for the optimization of various session recommendation models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118690085A
    Figure CN118690085A
Patent Text Reader

Abstract

The invention discloses a context-enhanced dialogue recommendation method based on comparative learning, which comprises the following steps of: 1, constructing a dialogue interest graph and converting a compact global dialogue graph; 2, adding a context vector and transmitting information except for adjacent items by the context vector; step 3, introducing comparative learning to carry out high-accuracy session recommendation; according to the method, the noise carried by the behavior sequence and the noise information introduced in the process of constructing the cross-session graph are well relieved by introducing contrast learning, and the performance is improved while the robustness is reduced; meanwhile, the context vector provides a natural mode to transmit information except for adjacent items, so that the graph neural network obtains more information during node representation learning, and meanwhile, the method is simple, is suitable for optimization and enhancement of session recommendation models in various different environments, and has good universality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer recommendation systems, and in particular to a context-enhanced dialogue recommendation method based on contrastive learning. Background Art

[0002] In an era of rapid development of social media and surge in various information data, recommendation systems play a very important role in helping people alleviate information overload. However, these traditional recommendation algorithms all have a premise, that is, they assume that users' personal information and past activities are constantly recorded. In some anonymous recommendation scenarios, such as when a user browses a website as a tourist, these user information is inaccessible, and their historical preferences and long-term preferences cannot be mined, resulting in poor recommendation effects. Therefore, session-based recommendations came into being. Session-based recommendation systems predict the next item that a given user may interact with by giving them an anonymous continuous behavior sequence, and have received widespread attention for their powerful ability to capture user dynamics and short-term preferences.

[0003] At present, the latest progress in session-based recommendation is mainly focused on deep learning-based methods, many of which use graph structures to model sessions and propagate information between adjacent items through graph neural networks. These methods have improved the performance of recommendation systems to a certain extent; however, user behavior sequences usually contain noisy preference information, which cannot fully reflect the user's actual preferences. For example, users may mistakenly click on irrelevant items or click on items they are not interested in because of curiosity, and they will not develop preferred items to interact with later. Therefore, these records may serve as noise in the user's behavior history, thereby deteriorating the modeling of their real interests;

[0004] In addition, existing recommendation methods based on graph neural networks have difficulty in modeling the relationships between non-adjacent items in the process of constructing the global graph, and ignore the complex high-order relationships between non-adjacent items;

[0005] At the same time, the noise existing in the user behavior sequence itself and the noise information introduced in the process of constructing the cross-session graph reduce the robustness of the model. Therefore, the present invention proposes a context-enhanced dialogue recommendation method based on contrastive learning to solve the problems existing in the prior art. Summary of the invention

[0006] In view of the above problems, the purpose of the present invention is to propose a context-enhanced dialogue recommendation method based on contrastive learning. The context-enhanced dialogue recommendation method based on contrastive learning has a good alleviating effect on the noise carried by the behavior sequence itself and the noise information introduced in the process of constructing the cross-session graph by introducing contrastive learning, thereby reducing the robustness and improving the performance. At the same time, the context vector provides a natural way to transmit information beyond adjacent items, so that the graph neural network can obtain more information when performing node representation learning.

[0007] To achieve the purpose of the present invention, the present invention is implemented by the following technical solution: a context-enhanced dialogue recommendation method based on contrastive learning, comprising the following steps:

[0008] Step 1: First, construct a conversation interest graph by calculating the similarity between item pairs, and convert the loose item sequence into a tight global conversation graph;

[0009] Step 2: Add a context vector to each session in the global session graph, and use the context vector to convey information beyond the adjacent items in a natural way;

[0010] Step 3: Introduce contrastive learning to enhance the robustness to interaction noise by jointly optimizing the contrastive self-supervision task and the recommendation task, and perform high-accuracy conversational recommendations.

[0011] A further improvement is that the step 1 is specifically as follows:

[0012] The first step is to construct the interest session graph from the perspective of the current session and the cross-session, and define the current session graph CSG = (V g ,E g ) and the global session graph GSG=(V g ,E g ,C g ), where V g Represents the project nodes of all sessions, E g represents the edge established by calculating the similarity, C g A context vector representing the conversation;

[0013] Step 2: Calculate the similarity value α between item pairs through cosine linear velocity ij =cos(W⊙v i ,W⊙v j ), and automatically build a conversation graph for each interaction sequence to explore its interest distribution;

[0014] Step 3: Set the similarity threshold α ij = 0.3 to shield nodes whose values ​​are smaller than the non-negative threshold due to noise, and focus on important connected node pairs.

[0015] A further improvement is that the step 2 is specifically as follows:

[0016] Step 1: Initialize the context vector, iteratively update the node vector through the practical gated graph neural network, and replace the last item v m The representation of is taken as the local embedding of session S, i.e., s l =v m , aggregate all node vectors of the session into a global preference embedding s g , expressed by formula (1)

[0017]

[0018] In formula (1), represents the attention weight of the node vector, and then the local embedding s l and global embeddings g Mix to get session embeds h =W3[s1;s g ], and s h as the initial context vector for the corresponding session;

[0019] Step 2: Update the node vector by calculating the node v i and the context vector c i,j The similarity between them is used as the attention weight, and their linear combination is defined as formula (2)

[0020]

[0021] in Represents the computing node v i and the context vector c i,j The similarity between them is then calculated by and Perform non-linear mapping to calculate priorities The importance of the two vectors is balanced, and finally the information from the adjacent nodes and the relevant context vector are integrated, which is defined by formula (3):

[0022]

[0023] Step 3: Context vector update. First, for each node v i Assign different weights, linearly combine the item representations, and aggregate to update the context vector, defined by formula (4)

[0024]

[0025] in represents the attention weight of the node vector, Represents the final context vector.

[0026] A further improvement is that the step three is specifically as follows:

[0027] S1. The data enhancement graph AG-GSG of GSG is obtained by using the edge discarding method. The same sessions in the original graph GSG and the enhanced graph AG-GSG are regarded as positive pairs, and the other 2 (N-1) sessions in the two graphs are regarded as negative samples. For each session pair, since the context vector of each session can be regarded as the overall representation of the current session, the context vector obtained from the session pair is regarded as a pair of positive samples. The InfoNCE loss of the context vectors in the two graphs is used as the optimization object defined, which is expressed by formula (5).

[0028]

[0029] where sim(·,·) is the similarity function and τ is a hyperparameter that controls scaling;

[0030] S2, obtain the final node vector v′ by merging the information in the current session graph CSG and the global session graph GSG j , in the same way as the session embedding in the initial context vector, the node vectors are aggregated using the soft attention mechanism to obtain the final session representation. After obtaining all items and session embeddings, the recommendation score of each target item is calculated

[0031] S3. Use the cross entropy of the prediction results as the main recommendation loss, defined by formula (6)

[0032]

[0033] S4. Combining the recommendation loss with the self-supervised contrastive learning loss for performance optimization is defined by formula (7):

[0034] L=L rec +λL ssl

[0035] where λ is a hyperparameter that controls the ratio of the contrastive learning loss.

[0036] The beneficial effects of the present invention are as follows: the present invention has a good alleviating effect on the noise carried by the behavior sequence itself and the noise information introduced in the process of constructing the cross-session graph by introducing contrastive learning, reducing robustness while improving performance; at the same time, the context vector provides a natural way to transmit information beyond adjacent items, so that the graph neural network obtains more information when performing node representation learning. The method of the present invention is concise, suitable for the optimization and enhancement of conversation recommendation models in various environments, and has good versatility. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 This is a framework diagram of the method of the present invention.

[0038] Figure 2 This is a line graph comparing the impact of learning loss rate on algorithm performance in the present invention.

[0039] Figure 3 It is a line graph showing the effect of the CSG ratio on the algorithm performance of the present invention. DETAILED DESCRIPTION

[0040] In order to deepen the understanding of the present invention, the present invention will be further described in detail below in conjunction with examples. The examples are only used to explain the present invention and do not constitute a limitation on the protection scope of the present invention.

[0041] according to Figure 1 As shown, this embodiment provides a context-enhanced dialogue recommendation method based on contrastive learning, comprising the following steps:

[0042] Step 1: First, construct a conversation interest graph by calculating the similarity between item pairs, converting the loose item sequence into a tight global conversation graph, making it easier to distinguish the user's primary interest and secondary interest;

[0043] The first step is to consider that only considering the information within the session cannot better capture user preferences. From the perspective of the current session and the cross-session, the interest session graph is constructed, and the current session graph CSG is defined as (V g ,E g ) and the global session graph GSG=(V g ,E g ,C g ), where V g Represents the project nodes of all sessions, E g represents the edge established by calculating the similarity, C g A context vector representing the conversation;

[0044] Step 2: Calculate the similarity value α between item pairs through cosine linear velocity ij =cos(W⊙v i ,W⊙v j ), and automatically build a conversation graph for each interaction sequence to explore its interest distribution;

[0045] Step 3: Considering the introduction of noise, set the similarity threshold α ij = 0.3 to shield nodes whose values ​​are smaller than the non-negative threshold due to noise, and focus on important connected node pairs.

[0046] Step 2: Add a context vector to each session in the global session graph, and use the context vector to convey information beyond the adjacent items in a natural way;

[0047] Step 1: Initialize the context vector, iteratively update the node vector through the practical gated graph neural network, and replace the last item v m The representation of is taken as the local embedding of session S, i.e., s l =v m , aggregate all node vectors of the session into a global preference embedding s g , expressed by formula (1)

[0048]

[0049] In formula (1), represents the attention weight of the node vector, and then the local embedding s l and global embeddings g Mix to get session embeds h =W3[s1;s g ], and s h as the initial context vector for the corresponding session;

[0050] Step 2: Node vector update. During the information propagation process, for each node in the graph, information is obtained from adjacent nodes and context vectors. Since items may appear in multiple sessions, each node can be connected to multiple context vectors. Therefore, by calculating the node v i and the context vector c i,j The similarity between them is used as the attention weight, and their linear combination is defined as formula (2)

[0051]

[0052] in Represents the computing node v i and the context vector c i,j The similarity between them is then calculated by and Perform non-linear mapping to calculate priorities The importance of the two vectors is balanced, and finally the information from the adjacent nodes and the relevant context vector are integrated, which is defined by formula (3):

[0053]

[0054] Step 3: Context vector update. For each context vector in the global session graph, its information comes from the corresponding node information in the current session. Since the importance of the information carried by each node is different, firstly, for each node v i Assign different weights, linearly combine the item representations, and aggregate to update the context vector, defined by formula (4)

[0055]

[0056] in represents the attention weight of the node vector, Represents the final context vector.

[0057] Step 3: Introduce contrastive learning to enhance robustness to interaction noise by jointly optimizing contrastive self-supervision tasks and recommendation tasks, and perform high-accuracy conversational recommendations.

[0058] S1. The data enhancement graph AG-GSG of GSG is obtained by using the edge discarding method. The same sessions in the original graph GSG and the enhanced graph AG-GSG are regarded as positive pairs, and the other 2 (N-1) sessions in the two graphs are regarded as negative samples. For each session pair, since the context vector of each session can be regarded as the overall representation of the current session, the context vector obtained from the session pair is regarded as a pair of positive samples. The InfoNCE loss of the context vectors in the two graphs is used as the optimization object defined, which is expressed by formula (5)

[0059]

[0060] where sim(·,·) is the similarity function and τ is a hyperparameter that controls scaling;

[0061] S2, obtain the final node vector v′ by merging the information in the current session graph CSG and the global session graph GSG j , in the same way as the session embedding in the initial context vector, the node vectors are aggregated using the soft attention mechanism to obtain the final session representation. After obtaining all items and session embeddings, the recommendation score of each target item is calculated

[0062] S3. Use the cross entropy of the prediction results as the main recommendation loss, defined by formula (6)

[0063]

[0064] S4. Combining the recommendation loss with the self-supervised contrastive learning loss for performance optimization is defined by formula (7):

[0065] L=L rec +λL ssl

[0066] where λ is a hyperparameter that controls the ratio of the contrastive learning loss.

[0067] The above shows and describes the basic principles, main features and advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention. The scope of protection of the present invention is defined by the attached claims and their equivalents.

Claims

1. A context-enhanced dialogue recommendation method based on contrastive learning, characterized in that: The following steps are involved: Step 1: First, construct a conversation interest graph by calculating the similarity between item pairs, and convert the loose item sequence into a tight global conversation graph; Step 2: Add a context vector to each session in the global session graph, and use the context vector to convey information beyond the adjacent items in a natural way; Step 3: Introduce contrastive learning to enhance the robustness to interaction noise by jointly optimizing the contrastive self-supervision task and the recommendation task, and perform high-accuracy conversational recommendations.

2. The context-enhanced dialogue recommendation method based on contrastive learning according to claim 1, characterized in that: The step 1 specifically includes: The first step is to construct the interest session graph from the perspective of the current session and the cross-session, and define the current session graph CSG = (V g ,E g ) and the global session graph GSG=(V g ,E g ,C g ), where V g Represents the project nodes of all sessions, E g represents the edge established by calculating the similarity, C g A context vector representing the conversation; Step 2: Calculate the similarity value α between item pairs through cosine linear velocity ij =cos(W⊙v i ,W⊙v j ), and automatically build a conversation graph for each interaction sequence to explore its interest distribution; Step 3: Set the similarity threshold α ij = 0.3 to shield nodes whose values ​​are smaller than the non-negative threshold due to noise, and focus on important connected node pairs.

3. The context-enhanced dialogue recommendation method based on contrastive learning according to claim 1, characterized in that: The specific steps of step 2 are as follows: Step 1: Initialize the context vector, iteratively update the node vector through the practical gated graph neural network, and replace the last item v m The representation of is taken as the local embedding of session S, i.e., s l =v m , aggregate all node vectors of the session into a global preference embedding s g , expressed by formula (1) In formula (1), represents the attention weight of the node vector, and then the local embedding s l and global embeddings g Mix to get session embeds h =W3[s1;s g ], and s h as the initial context vector for the corresponding session; Step 2: Update the node vector by calculating the node v i and the context vector c i,j The similarity between them is used as the attention weight, and their linear combination is defined as formula (2) in Represents the computing node v i and the context vector c i,j The similarity between them is then calculated by and Perform non-linear mapping to calculate priorities The importance of the two vectors is balanced, and finally the information from the adjacent nodes and the relevant context vector are integrated, which is defined by formula (3): Step 3: Context vector update. First, for each node v i Assign different weights, linearly combine the item representations, and aggregate to update the context vector, defined by formula (4) in represents the attention weight of the node vector, Represents the final context vector.

4. The context-enhanced dialogue recommendation method based on contrastive learning according to claim 1, characterized in that: The specific steps of step three are as follows: S1. The data enhancement graph AG-GSG of GSG is obtained by using the edge discarding method. The same sessions in the original graph GSG and the enhanced graph AG-GSG are regarded as positive pairs, and the other 2 (N-1) sessions in the two graphs are regarded as negative samples. For each session pair, since the context vector of each session can be regarded as the overall representation of the current session, the context vector obtained from the session pair is regarded as a pair of positive samples. The InfoNCE loss of the context vectors in the two graphs is used as the optimization object defined, which is expressed by formula (5). where sim(·,·) is the similarity function and τ is a hyperparameter that controls scaling; S2, obtain the final node vector v′ by merging the information in the current session graph CSG and the global session graph GSG j , in the same way as the session embedding in the initial context vector, the node vectors are aggregated using the soft attention mechanism to obtain the final session representation. After obtaining all items and session embeddings, the recommendation score of each target item is calculated S3. Use the cross entropy of the prediction results as the main recommendation loss, defined by formula (6) S4. Combining the recommendation loss with the self-supervised contrastive learning loss for performance optimization is defined by formula (7): L=L rec +λL ssl where λ is a hyperparameter that controls the ratio of the contrastive learning loss.