A conversation recommendation method based on heterogeneous graph and contrastive learning

By using methods based on heterogeneous graphs and contrastive learning, we capture the connections between different types of user behaviors and items, learn universal representations, and solve the problems in the existing technology of user preference and demand characterization deviations and the lack of universality of item representations. , achieving accurate conversational recommendation, improving recommendation effect and system revenue.

CN115018573BActive Publication Date: 2024-10-18ZHEJIANG UNIV
View PDF 6 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing conversational recommendation methods fail to make full use of users' rich interactive behaviors, resulting in model biases in portraying user preferences and needs, and item representations are not universal, limiting recommendation effects and benefits.

Method used

Using methods based on heterogeneous graphs and contrastive learning, the hierarchical attention mechanism is used to capture the connections between different types of user behaviors, and the contrastive learning mechanism is used to learn universal representations of items from heterogeneous graphs, and cross-over is used in offline training. Entropy and information noise are compared and estimated for model optimization, sliding windows are used for data enhancement, and Top-K recommendations are finally made in practical applications.

Benefits of technology

It achieves an accurate depiction of user interests, preferences and demand status, improves the recommendation effect, can provide accurate recommendations under anonymous access and privacy protection mechanisms, and improves the overall revenue of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115018573B_ABST
    Figure CN115018573B_ABST
Patent Text Reader

Abstract

The present invention relates to the training and learning of big data, and aims to provide a conversation recommendation method based on heterogeneous graphs and contrastive learning. It includes: constructing a heterogeneous graph model of the node connection of interactive items according to the interactive behavior type of the user during the conversation, applying the model to realize the information intersection between the behavior sequences through the hierarchical attention mechanism, capturing the connection and difference between different types of user behaviors, mining the user's interest preferences and current demand status, and applying the contrastive learning mechanism to learn the universal representation of items from the heterogeneous graph. When modeling the conversation sequence, the present invention fully considers the various types of interactive behaviors of users, models various types of interactive behaviors by applying heterogeneous graph neural networks, and combines the hierarchical attention mechanism to mine the existing connections between different types of user behavior sequences, and applies contrastive learning technology to learn the general representation of items. It can make accurate recommendations to users and improve the recommendation effect of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to big data training and learning technology, and in particular to a conversation recommendation method based on heterogeneous graphs and contrastive learning. Background Art

[0002] In the process of online shopping based on network e-commerce, the conversational recommendation method is a solution proposed for the inability to obtain and use user historical behavior and profile information. It identifies user intentions and preferences through user interaction behaviors within the conversation and makes accurate recommendations. From the user's perspective, effective recommendations within the conversation can enable users to obtain the required content / items faster, saving user time while avoiding overly inefficient push that reduces users' consumption desire and confidence in the platform. From the platform's perspective, good recommendation effects can reduce the cost of information push and increase the overall platform revenue.

[0003] There are some related studies on conversational recommendation, such as the Chinese invention application "A conversational recommendation method based on heterogeneous graphs with hierarchical attention mechanism" (CN202111035918.6), the Chinese invention application "A cross-border e-commerce recommendation method based on heterogeneous graph expression learning" (CN202110728252.6), and the Chinese invention application "A crowdsourcing task recommendation method based on heterogeneous graph attention network" (CN202110631471.2). The above patents combine the characteristics of application scenarios and use graph neural network methods to build recommendation systems and make recommendations to users. Although these methods can solve the recommendation problems in related fields, they still have the following defects: (1) The existing methods only focus on the items that users interact with during the conversation, and fail to take into account the rich types of user interaction behaviors in the modeling considerations, resulting in deviations in the model's characterization of user preferences and needs. (2) The item representations obtained by the existing methods are not universal, and these item representations cannot be directly applied to the recommendation of related items or other tasks. (3) The defects of the existing conversational recommendation methods restrict the recommendation effect and the actual benefits that can be brought.

[0004] In addition, due to the existence of anonymous user access, privacy protection mechanisms, cookie expiration and other reasons in real recommendation scenarios, it is difficult to obtain the user's valid identity, making it impossible for traditional recommendation models to use user portrait information and long-term historical behavior for recommendation, which in turn affects the user experience and the platform's marketing revenue.

[0005] Therefore, how to build models based solely on the various types of behaviors that occur during a user session and make accurate recommendations to users is a technical problem that the present invention aims to solve. Summary of the invention

[0006] The technical problem to be solved by the present invention is to overcome the deficiencies in the prior art and provide a conversation recommendation method based on heterogeneous graphs and contrastive learning.

[0007] In order to solve the above technical problems, the solution adopted by the present invention is:

[0008] A conversation recommendation method based on heterogeneous graphs and contrastive learning is provided, comprising: constructing a heterogeneous graph model of interactive item node connections according to the user's interactive behavior type during the conversation, applying the model to achieve information crosstalk between behavior sequences through a hierarchical attention mechanism, capturing the connections and differences between different types of user behaviors, mining user interest preferences and current demand status, and applying a contrastive learning mechanism to learn the universal representation of items from the heterogeneous graph; when training the model offline, cross entropy and information noise contrast estimation are used as model optimization targets, and a sliding window method is used for data enhancement; in actual application, the model obtained by offline training is used in combination with the user's current conversation behavior for Top-K recommendation.

[0009] Description of the invention principle:

[0010] Due to anonymous user access, privacy protection mechanisms, cookie expiration, etc., traditional recommendation systems cannot obtain their portrait information and long-term history based on their valid identity, which in turn affects the recommendation effect of the system. To address this problem, the present invention adopts a session recommendation mechanism and applies multiple different types of user interaction behaviors and context information in the current session to implement recommendations.

[0011] Specifically, the present invention uses heterogeneous graph modeling to apply users' rich interactive behaviors (such as searching, clicking, browsing, collecting and purchasing, etc.) to construct a user-item relationship graph, which can fully characterize the relationship between users and items from different perspectives, and deeply mine users' long-term preferences and current demand status; in order to reasonably capture the impact of different types of behaviors on the user's current status, the present invention proposes a hierarchical attention method, which uses attention association mechanisms at two different levels, namely behavior granularity and behavior type granularity, to encourage the model to pay more attention to the correlation between existing information, thereby improving the effectiveness of the model's behavior representation learning; in addition, in order to further improve the model's ability to represent items, the present invention innovatively introduces a contrastive learning mechanism to enhance the model's representation learning ability. This mechanism uses the co-occurrence relationship between items in different sessions in the model training data, and uses information noise contrast estimation to maximize similar item information, and effectively improves the performance of the solution in subsequent recommendation tasks.

[0012] Compared with the prior art, the technical effects of the present invention are:

[0013] 1. As the existing conversation recommendation system is limited by factors such as single target task and simple model structure, it is unable to fully utilize the rich interactive behaviors of users during the conversation to deeply mine user preferences and demand states, resulting in deviations in subsequent predictions of the recommendation model. To address this problem, the present invention proposes a conversation recommendation method based on heterogeneous graphs and contrastive learning as a solution. The present invention can introduce user heterogeneous behavior information to model and learn different types of behaviors in the conversation and make subsequent recommendations.

[0014] 2. The present invention establishes heterogeneous edges between items interacted by different types of behaviors to characterize the connection between behaviors through heterogeneous graph modeling, and captures user preferences and demand states through different types of behaviors. In addition, the present invention applies contrastive learning technology to construct contrastive learning tasks based on the co-occurrence of items in different sessions, and obtains a general representation of the granularity of items through the task, and further combines the user preferences and demand states mined from different types of behaviors in user sessions to effectively estimate the possibility of subsequent interaction of candidate items, thereby achieving the purpose of accurate recommendation.

[0015] 3. When modeling conversation sequences, the present invention fully considers various types of interactive behaviors of users, models various types of interactive behaviors by applying heterogeneous graph neural networks, combines hierarchical attention mechanisms to explore the connections between different types of user behavior sequences, and applies contrastive learning techniques to learn the general representation of items.

[0016] 4. The present invention enables users to make accurate recommendations and improves the recommendation effect of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 It is a flow chart of the implementation of the present invention;

[0018] Figure 2 is the model structure of the heterogeneous graph in the present invention;

[0019] Figure 3 This is the application mode of the comparative learning mechanism in the present invention. DETAILED DESCRIPTION

[0020] The specific implementation modes of the present invention are described in detail below in conjunction with the accompanying drawings.

[0021] The present invention constructs a heterogeneous graph model of the node connections of interactive items based on the rich types of user interactive behaviors during the conversation process, and uses the heterogeneous graph to realize information intersection between behavior sequences through a hierarchical attention mechanism, thereby capturing the connections and differences between different types of user behaviors, mining user interest preferences and current demand status, and using a contrastive learning mechanism to learn the general representation of items from the heterogeneous graph.

[0022] When training the model offline, we use cross entropy and information noise contrast estimation as the model optimization target, and use sliding window and other methods to enhance data. In actual application, we use the model obtained by offline training combined with the user's current session behavior to make Top-K recommendations. The overall technical solution process is as follows: Figure 1 shown.

[0023] 1. Construct a heterogeneous graph of user interaction behaviors

[0024] In view of the situation that there are multiple types of interactive behaviors in the user session, the present invention constructs the original graph of the order between the interactive items for the target behavior type; but for other types of behaviors, all the interactive items before the behavior are directly connected with it to express the correlation between these items. Since the in-degree matrix has a concise and clear expression form on the one hand, and can also be conveniently used for parallel calculations in the model on the other hand, the present invention uses the out-degree matrix and in-degree matrix of the directed graph of each type of behavior connection as the data form used when the algorithm is running, and uses the following calculation method to extract each behavior b from the graph model t The characterization vector h t :

[0025]

[0026]

[0027]

[0028]

[0029]

[0030] in, is the aggregation vector, which is the aggregation vector i in the current iteration round. t The intermediate results obtained by characterizing the neighbor nodes in the heterogeneous graph; It refers to the user's t-th interaction item i t The corresponding row vector in the heterogeneous graph matrix A; h i is the characterization vector corresponding to the user's i-th behavior, i = 1, 2, ..., N; [h1, ..., h N ] represents the concatenation of each behavior representation vector; x T represents the transpose of vector x; W G , W z , W r , W o , U z , U r , U o are all learnable matrices; b is a learnable vector; h is at Each behavior b extracted from the graph model t The representation vector of is the candidate result of the current iteration round; t and r t For h t The result of the update and reset operations, σ represents the selected activation function sigmoid.

[0031] 2. Exploring the associations between different types of behaviors

[0032] The present invention adopts the bottom-level attention mechanism and the upper-level attention mechanism to obtain the connections between different types of user behaviors, and obtains the user preferences and current demand status representation based on these connections.

[0033] The underlying attention mechanism is used to enhance the representation ability of the preference vector and the demand state vector for the user's current situation. The attention mechanism is applied within various user behavior sequences. Since the user's recent interactive items can reflect the user's current interests and needs, the correlation between the embedding vector of the interactive item and the representation vector of each behavior in the sequence is used as the attention score α t Furthermore, the score is applied to perform weighted aggregation on the behavior representation vector to obtain the user's current preference vector p′ s User demand state vector corresponding to each behavior The calculation formula is as follows:

[0034]

[0035]

[0036] Among them, α t is the attention score of the user's t-th behavior; exp is an exponential function with e as the base; The last interactive item in the current session T The corresponding item representation vector; W υ is the learnable matrix; h t is the characterization vector corresponding to the user's t-th behavior; t is the subscript of the user's behavior order; and are the timestamp sets corresponding to user behavior types τ and υ respectively.

[0037] The upper-level attention mechanism is used to capture the connections and differences between different types of user behaviors. The upper-level attention mechanism uses the p obtained in different user behavior sequences in the previous stage. s and The user preference vector p′ reflected by the main behavior sequence sThe attention score α for other types of behaviors is calculated by comparing the satisfaction of user needs reflected by other types of behaviors υ , and apply each demand state vector according to the score Enhance and modify the current user's preference interests. The calculation formula is as follows:

[0038]

[0039]

[0040] Among them, α υ is the attention score corresponding to the user demand representation of the user behavior type υ; υ represents the specified user behavior type; exp is an exponential function with e as the base; and b are both learnable vectors; W τ is a learnable matrix; and p s They respectively represent the user demand state vector and current preference vector corresponding to each type of user behavior.

[0041] Figure 2 The overall model structure of the heterogeneous graph neural network in the proposed method is shown. Components (2) and (3) correspond to the construction of the heterogeneous graph and the learning and acquisition of each behavior representation in step 1. The different attention modules in component (4) correspond to the bottom-level attention and upper-level attention mechanisms in this step. Next, this paper introduces the remaining components respectively.

[0042] 3. Learning universal representations of interactive objects

[0043] This step corresponds to Figure 2 In order to further obtain the universal representation of the object (i.e., general representation), the present invention adopts the contrastive learning (CL) mechanism in self-supervised learning (SSL) and applies the set of sessions s involved in the current training batch during model training. And generate the corresponding positive sample item pair set on this set And the set of negative sample items Used to perform comparative learning on the representation vectors of items involved in the current training batch. Figure 3 Demonstrates how contrastive learning can be applied.

[0044] The present invention obtains the general representation of objects through contrastive learning, so the information noise contrast estimation InfoNCE is used as the optimization target of this part, which is denoted as And calculate according to the following formula:

[0045]

[0046]

[0047] in, Represents the set of sessions in the current training batch; Represents a collection of sessions The set of all positive sample pairs generated; represents the set of positive sample item pairs extracted from session s, where (x, y) represents a sample pair consisting of two different items x and y in the set, and e x and e y Respectively represent the representation vectors corresponding to these two items; Indicates except The set of items remaining in addition to the items that appear in x - For the items in the collection, Represents the corresponding item characterization vector; δ is a hyperparameter representing the temperature coefficient, using a constant of 1; similarity function sim: Used to calculate the similarity between two item representations, using the cosine function as the similarity calculation function between two vectors.

[0048] 4. Offline training and model update

[0049] The present invention uses the existing conversation behavior sequence records as the model training set for offline training, and uses the sliding window method to perform data enhancement on the original conversation records, splits them into multiple conversation subsequences, and uses the last item in the subsequence as the prediction target. (Here b t represents the user's corresponding interactive behavior at time t) generates multiple subsequences and corresponding prediction targets, such as [ <b1>, b2], ..., Each interaction behavior b t Contains two attributes: the identification of the interactive item and the behavior type, respectively represented by i t and c t express.

[0050] Since the application goal of the present invention is to select the items that the user is most likely to interact with from the candidate items set for recommendation, the model calculation result is the probability of each candidate item interacting with the user in the next behavior. Therefore, the cross entropy loss function for the probability estimation problem is used as the optimization target in the model training process, which is recorded as For a given candidate set of items And the user's actual interaction with the candidate items y s,i , the optimization objective is calculated as follows:

[0051]

[0052] Among them, i represents the candidate item estimated by the model; represents the candidate item set; y s,i and They represent the actual interaction situation of item i and the interaction probability estimated by the model respectively;

[0053] Combination and The ultimate optimization goal of the model proposed in this method is where λ self is the weight of the loss for the contrastive learning task.

[0054] 5. Apply the model for online recommendation

[0055] This step corresponds to Figure 2 The top-level user next interaction prediction component in . When this session recommendation method makes online recommendations to users, it applies the recommendation model and its parameters learned offline, and calculates the current user preference p according to the existing interaction behaviors in the user session s. s And the user demand status reflected by each behavior The following formula is used to calculate the probability of the user interacting with each candidate item i (such as clicking, purchasing, etc.) in the next interaction: Make an estimate and take the K items with the highest estimated results as the Top-K recommendation results:

[0056]

[0057]

[0058] in, Represents the estimated score of the model output; is the transpose of the learned object representation vector; W is the learnable matrix; the meanings of other symbols are the same as above.

Claims

1. A conversation recommendation method based on heterogeneous graph and contrastive learning, characterized in that: include: According to the user's interactive behavior type during the conversation, a heterogeneous graph model of the node connection of interactive items is constructed. The model is applied to realize the information intersection between behavior sequences through the hierarchical attention mechanism, capture the connection and difference between different types of user behaviors, and mine the user's interest preferences and current demand status. The contrastive learning mechanism is used to learn the universal representation of items from the heterogeneous graph; when training the model offline, cross entropy and information noise contrast estimation are used as model optimization targets, and the sliding window method is used for data enhancement; in actual application, the model obtained by offline training is combined with the user's current conversation behavior for Top-K recommendation; among them, (1) When constructing a heterogeneous graph of user interaction behaviors, for the target behavior type in the user session, an original graph is constructed according to the order of the interacted items. For other types of behaviors other than the target behavior, all the interacted items before the behavior are directly connected to it to indicate the correlation between these items. (2) When constructing the user interaction behavior operation, the out-degree matrix and in-degree matrix of each type of behavior connection directed graph are used as the data form of the operation; During the operation, each behavior b is extracted from the graph model by the following calculation method t The characterization vector h t : in, is the aggregation vector, which is the aggregation vector i in the current iteration round. t The intermediate results obtained by characterizing the neighbor nodes in the heterogeneous graph; It refers to the user's t-th interaction item i t The corresponding row vector in the heterogeneous graph matrix A; h i is the characterization vector corresponding to the user's i-th behavior, i = 1, 2, ..., N; [h1, ..., h N ] represents the concatenation of each behavior representation vector; x T represents the transpose of vector x; W G , W z , W r , W o , U z , U r , U o are all learnable matrices; b is a learnable vector; h is a t Each behavior b extracted from the graph model t The representation vector of is the candidate result of the current iteration round; t and r t For h t The result of the update and reset operation, σ represents the selected activation function sigmoid; (3) Adopting the bottom-level attention mechanism and the upper-level attention mechanism to obtain the connections between different types of user behaviors, and obtaining the representation of user preferences and current demand states based on these connections; the bottom-level attention mechanism is used to enhance the representation ability of preference vectors and demand state vectors on the user's current situation, and the attention mechanism is applied within each type of user behavior sequence; the upper-level attention mechanism is used to capture the connections and differences between different types of user behaviors; (3.1) When using the underlying attention mechanism for calculation, the correlation between the embedding vector of the user’s recent interactive items and the representation vector of each behavior in the sequence is used as the attention score α t ; Further apply the score to perform weighted aggregation on the behavior representation vector to obtain the user's current preference vector p′ s User demand state vector corresponding to each behavior The calculation formula is as follows: Among them, α t is the attention score of the user's t-th behavior; exp is an exponential function with e as the base; The last interactive item in the current session T The corresponding item representation vector; W υ is the learnable matrix; h t is the characterization vector corresponding to the user's t-th behavior; t is the subscript of the user's behavior order; and are the timestamp sets corresponding to user behavior types τ and υ respectively; (3.2) When using the upper-level attention mechanism for calculation, the p obtained in different user behavior sequences in the previous stage is applied s and The user preference vector p′ reflected by the main behavior sequence s The attention score α for other types of behaviors is calculated by comparing the satisfaction of user needs reflected by other types of behaviors υ , and apply each demand state vector according to the score Enhance and modify the current user's preference interests. The calculation formula is as follows: Among them, α v is the attention score corresponding to the user demand representation of the user behavior type υ; υ represents the specified user behavior type; exp is an exponential function with e as the base; v T and b are both learnable vectors; W τ is a learnable matrix; and p s Respectively represent the user demand state vector and current preference vector corresponding to each type of user behavior; (4) In the process of learning the universal representation of interactive items, the contrastive learning mechanism in self-supervised learning is adopted. When training the model, the set of sessions s involved in the current training batch is applied. And generate the corresponding positive sample item pair set on this set And the set of negative sample items To be used for comparative learning of the representation vectors of the items involved in the current training batch; When obtaining a universal representation of an object through contrastive learning, it specifically includes: The information noise contrast estimation InfoNCE is used as the optimization objective, denoted as And calculate according to the following formula: in, Represents the set of sessions in the current training batch; Represents a collection of sessions The set of all positive sample pairs generated; represents the set of positive sample item pairs extracted from session s, where (x, y) represents a sample pair consisting of two different items x and y in the set, and e x and e y Respectively represent the representation vectors corresponding to these two items; Indicates except The set of items remaining in addition to the items that appear in x - For the items in the collection, Represents the corresponding item characterization vector; δ is a hyperparameter representing the temperature coefficient, using a constant of 1; similarity function sim: Used to calculate the similarity between two item representations, using the cosine function as the similarity calculation function between two vectors; (5) Perform offline training of the model using the following method: (5.1) Use the existing conversation behavior sequence records as the model training set for offline training, and use the sliding window method to perform data enhancement on the original conversation records, splitting them into multiple conversation subsequences; use the last item in the subsequence as the prediction target, and each interaction behavior contains two attributes: the identification of the interaction item and the behavior type; (5.2) In order to select the items that users are most likely to interact with from the candidate item set, the cross entropy loss function for the probability estimation problem is used as the optimization target in the model training process. The probability of each candidate item interacting with the user in the next behavior is used as the calculation result of the model; specifically including: For a given candidate set of items And the user's actual interaction with the candidate items y s,i , the optimization goal Calculate as follows: Among them, i represents the candidate item estimated by the model; represents the candidate item set; y s,i and They represent the actual interaction situation of item i and the interaction probability estimated by the model respectively; Combination and The final optimization goal of the model is where λ self The weight of the loss for the contrastive learning task; (6) The trained model is applied to online recommendation by the following method: According to the existing interactive behaviors in the user session s, calculate and obtain the current user preference ps and the user demand state reflected by each behavior The probability of the user interacting with each candidate item i in the next interaction is calculated according to the following formula: Make an estimate and take the K items with the highest estimated results as the Top-K recommendation results: in, Represents the estimated score of the model output; is the transpose of the learned item representation vector; W is the learnable matrix.

Citation Information

Patent Citations

  • A Crowdsourced Task Recommendation Method Based on Heterogeneous Graph Attention Networks

    CN113361928B

  • A cross-border e-commerce recommendation method based on heterogeneous graph representation learning

    CN113409121B

  • A Heterogeneous Graph-Based Session Recommendation Method Based on Hierarchical Attention Mechanism

    CN113704438B