A dialogue recommendation method based on hypergraph neural network

By constructing a hypergraph neural network and combining users' long-term and short-term preferences, the problem of insufficient recommendation accuracy in dialogue recommendation models is solved, achieving more accurate item recommendations and dialogue generation, and improving user satisfaction.

CN117892006BActive Publication Date: 2026-08-25CHONGQING UNIV OF TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410075854.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-18
Publication Date
2026-08-25
Estimated Expiration
2044-01-18

AI Technical Summary

Technical Problem

Existing dialogue recommendation models (CRS) have shortcomings in recommendation accuracy, particularly in ignoring users' long-term preferences and implicit preferences under sparse dialogue, and failing to effectively utilize high-order and complex intrinsic relationships.

Method used

We employ a hypergraph neural network-based approach to construct a dialogue hypergraph, a knowledge hypergraph, and a comment hypergraph. We utilize a knowledge graph encoder and a dual attention mechanism to learn node features, combine long-term and short-term user preferences, and generate user representations through pooling layers and a decoder to optimize the dialogue recommendation model.

Benefits of technology

It improves the accuracy of dialogue recommendations, enabling it to more accurately capture user needs, generate more suitable item recommendations, enhance the model's generalization ability and the richness of generated content, and improve user satisfaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117892006B_ABST
    Figure CN117892006B_ABST
Patent Text Reader

Abstract

The application provides a dialogue recommendation method based on a hypergraph neural network, comprising: obtaining user historical dialogue information, and constructing a dialogue hypergraph; obtaining an external knowledge graph, and constructing a knowledge hypergraph; obtaining item review information, and constructing a review hypergraph; using a knowledge graph encoder to encode entities in the hypergraphs, and generating node representations; learning node features based on the node representations, and generating historical session, knowledge and review representations; connecting the historical session, knowledge and review representations, and generating user long-term and short-term preference embeddings; using a pooling layer to combine the long-term and short-term preference embeddings, and generating a user final representation; recommending items according to the user final representation; encoding the historical dialogue information and current dialogue information; decoding item, historical and current dialogue embeddings; establishing and training an optimized dialogue recommendation model, and outputting appropriate dialogue; and the application can capture high-order relationships in multi-aspect knowledge, explore user implicit preferences and improve recommendation accuracy by constructing hypergraphs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of dialogue recommendation technology, and in particular to a dialogue recommendation method based on a hypergraph neural network. Background Technology

[0002] The digital economy has become a new engine for my country's development, driving industrial upgrading and structural optimization. As an application of artificial intelligence, recommender systems assist users in filtering information that matches their preferences in an era of information overload. Recommender systems have attracted significant attention in both industry and academia, aiming to provide accurate and efficient recommendation services. To achieve this goal, users need to communicate their interests and preferences to the recommender system to build accurate user profiles; developers, on the other hand, need to guide users to discover new points of interest, thereby generating business revenue. Current mainstream recommender systems are trained based on historical data, but some problems still exist, such as unreliable estimation of user preferences, neglect of online context factors, and the assumption that users are aware of their own preferences.

[0003] With the development of dialogue technology, combining dialogue with recommendation technology has become an effective means of solving traditional problems. Dialogue Recommendation (CRS) models capture users' immediate preferences through multi-turn dialogues and model these preferences using explicit feedback signals from natural language dialogue. CRS has become a hot research topic, but current research mostly focuses on the current dialogue and short-term preferences, neglecting long-term preferences and implicit preferences under sparse dialogue. Furthermore, existing research often explores user preferences based on pairwise relationships, ignoring the impact of higher-order and complex intrinsic relationships on recommendation accuracy, resulting in low dialogue recommendation accuracy for CRS models. Summary of the Invention

[0004] This invention aims to at least solve the technical problem of low accuracy in dialogue recommendation models (CRS) in the prior art, and innovatively proposes a dialogue recommendation method based on hypergraph neural networks.

[0005] To achieve the above-mentioned objectives of this invention, this invention provides a dialogue recommendation method based on a hypergraph neural network, comprising:

[0006] S100: Obtain user's historical dialogue information to construct a dialogue hypergraph; obtain external knowledge graphs to construct a knowledge hypergraph; obtain item review information to construct a review hypergraph;

[0007] S200. Encode the entities in the dialogue hypergraph, knowledge hypergraph, and comment hypergraph using a knowledge graph encoder to generate node representations;

[0008] S300. Based on the node representation, a hypergraph neural network constructed using a dual attention mechanism is used to learn node features and generate historical session representation, knowledge representation, and comment representation;

[0009] S400: Perform a concatenation operation on the historical conversation representation, knowledge representation, and comment representation to generate a long-term user preference embedding; and extract the short-term user preference embedding from the user's current dialogue information.

[0010] S500: The user's long-term preference embedding and short-term preference embedding are combined using a pooling layer to generate the final user representation, and suitable items are recommended to the user based on the final user representation;

[0011] S600: Encode the historical dialogue information and the current dialogue information using an encoder to generate the historical conversation embedding and the current conversation embedding;

[0012] S700, use a decoder to decode the item embedding, the historical session embedding, and the current session embedding;

[0013] S800. Establish a dialogue recommendation model, train and optimize the dialogue recommendation model, and output appropriate dialogue.

[0014] As an optional embodiment of the present invention, optionally, the formula for encoding entities in the dialogue hypergraph, knowledge hypergraph, and comment hypergraph using a knowledge graph encoder to generate node representations is:

[0015]

[0016] in, Let σ(·) represent entity e at layer l+1, σ(·) represent the nonlinear activation function, and r represent the relation. Let e' represent a set of relations, and let e' represent the adjacent nodes of entity e. Z represents the set of adjacent nodes of entity e under relation r. e,r Represents the normalization factor. and W (l) For learnable matrices, This represents the representation of entity e at level l.

[0017] As an optional embodiment of the present invention, the method may further include, in the dual attention mechanism, equipping it with two aggregators;

[0018] Expressed using a formula:

[0019]

[0020]

[0021] in, This represents the representation of node i in the l-th layer. Indicates a hyper-edge aggregator. This represents the representation of node i in the (l-1)th layer. Indicates the superedge e in layer l j The expression, Indicates any, ε i Indicates the connection node v i hyperedge set, Represents a node aggregator. Indicates the superedge e j The characteristics of the connected nodes in the previous layer, v k Represents a node.

[0022] As an optional embodiment of the present invention, the step of repeatedly learning node features based on the node representation using a dual attention mechanism includes:

[0023] S301. Utilize the node-to-edge attention mechanism to focus on key nodes and aggregate the features of key nodes.

[0024] Expressed as a formula:

[0025]

[0026]

[0027]

[0028] in, Indicates the superedge e in layer l j The representation of σ(·) is given by σ(·), which represents the nonlinear activation function, and v k Representing nodes k and e j Let the superedge j, a jk Indicates the superedge e j Middle node v k The attention coefficient, W1 represents the weight vector. Indicates v k In the (l-1)th layer, exp(·) represents an exponential function with the natural constant e as its base. u represents a trainable weight vector used to measure node importance. k Indicates v k Transformed node features, v p Representing nodes p and u p Indicates v p The transformed node features, where LeakyReLU(·) represents the nonlinear activation function;

[0029] S302. Utilize the attention mechanism of hyperedge pairs to pay attention to the importance of key hyperedge pairs and aggregate the features of key hyperedges.

[0030] Expressed as a formula:

[0031]

[0032]

[0033]

[0034] in, Let σ(·) represent the representation of node i in layer l, and let e be the nonlinear activation function. i Indicates connection v i The superedge set, v i Let node i and β be... ij Indicates the superedge e j For node v i The attention coefficient, W2 represents a weight parameter. Indicates the superedge e in layer l j The expression, Let v represent another weight vector. j Representing nodes j and e p Let p and ε represent hyperedges. j Represents node v j The superedge set, v p Let || represent node p, and || represent the join operation. Indicates the superedge e p The characteristics of the connected nodes in the previous layer.

[0035] As an optional embodiment of the present invention, the expression for combining the user's long-term preference embedding and the user's short-term preference embedding using the pooling layer is optionally:

[0036]

[0037]

[0038] in, This indicates the embedding of long-term user preferences, where [;;] and [;] represent join operations, and r s Representing historical sessions, r k Representing knowledge representation, r c The comment indicates that p u This represents the final user representation, and Pooling(·) represents average pooling. This indicates the embedding of short-term user preferences.

[0039] As an optional embodiment of the present invention, the expression for recommending suitable items to the user based on the final user representation is optionally:

[0040]

[0041] Among them, P rec p represents the probability of recommending an item to user u, Softmax(·) represents the normalization operation, and p u This represents the final user's opinion. Represents a set of items The representation of item i in the table.

[0042] As an optional embodiment of the present invention, the expression formula for decoding the item embedding, the historical session embedding, and the current session embedding using the decoder is optionally as follows:

[0043]

[0044]

[0045]

[0046]

[0047]

[0048]

[0049] in, R represents n-1 The output after the self-attention layer, R n-1 Let MHA(,,) represent the output of the (n-1)th layer decoder, and MHA(,,) represent the multi-head attention mechanism. The representation of an item after passing through the cross-attention layer, N C Indicates the item representation, X represents the current dialogue after passing through the cross-attention layer. C Indicates the current session embedding, The historical dialogue representation is the representation after passing through the cross-attention layer, X H Indicates historical session embedding, R represents the output after balancing the historical dialogue embedding and the current dialogue embedding, β represents the balancing factor, and R n represents the output of the nth layer decoder, and FFN(·) represents a fully connected feedforward network;

[0050] The multi-head attention mechanism is represented as follows:

[0051] MHA(Q,K,V)=[h1;...;h h W o

[0052] h i =Attention(QW iq ,KW i k VW i v )

[0053] Where Q represents the query matrix, K is the key matrix, V is the value matrix, and h h W represents the number of attention mechanisms, where Attention(,,) represents the attention mechanism. i q W i k W i v and W 0 This represents the parameter matrix.

[0054] As an optional embodiment of the present invention, the fully connected feedforward network may be expressed by the following formula:

[0055] FFN(x)=ReLU(xW1+b1)W2+b2

[0056] Where ReLU(·) represents the corrected linear unit, x represents the input feature, W1 and W2 represent the weight parameters, and b1 and b2 are two bias terms.

[0057] As an optional embodiment of the present invention, the method may further include enhancing the information content of the generated content by utilizing a copying mechanism based on the output of the decoder;

[0058] Expressed using a formula:

[0059] Pr(y i |y1,...,y i-1 )=Pr1(y i |R i )+Pr2(y i |u)+Pr3(y i |R i ,u)

[0060] Where Pr(·) represents the probability of the next word, y i Let R represent the i-th word, Pr1(·) be the probability function for generating the vocabulary, and R be the probability of generating the vocabulary. i Pr2(·) represents the output representation of the decoder, and Pr2(·) represents the final user representation p. u The probability function of the generated word deviation, Pr3(·), represents the probability function implemented through the replication mechanism, and u represents the user.

[0061] As an optional embodiment of the present invention, the optimization of the dialogue recommendation model may include:

[0062]

[0063]

[0064] in, Indicates the recommended loss of the item. For small batch sizes, Let y represent the probability of item i. ij Let be the item label, log(·) denote the logarithmic function, j represent the j-th batch, and i represent the items in item set I. Indicates the loss from dialogue recommendation. Indicates the truncated length of the utterance, y t-1 This represents the (t-1)th word. This represents the probability of generating a word.

[0065] The beneficial effects of this invention are as follows: By constructing a dialogue hypergraph, knowledge hypergraph, and comment hypergraph, this invention enables the dialogue recommendation model to capture high-order relationships from multiple aspects of knowledge, thereby exploring users' implicit preferences and improving the accuracy of conversation recommendations. This invention combines multi-source information such as long-term user preferences, historical conversations, knowledge, and comments, enabling the dialogue recommendation model to more accurately characterize user needs and recommend more suitable items, thus improving the accuracy of conversation recommendations. This invention introduces a replication mechanism, making the content generated by the dialogue recommendation model richer and containing more information, thereby improving user satisfaction. This invention improves the expressive power of the dialogue recommendation model by using a multi-head attention mechanism and a fully connected feedforward network, giving the dialogue recommendation model better generalization ability when dealing with different scenarios.

[0066] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0067] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:

[0068] Figure 1 This is a flowchart of a dialogue recommendation method based on a hypergraph neural network according to the present invention.

[0069] Figure 2 This is a schematic diagram of the structural framework of the dialogue recommendation model of this invention. Detailed Implementation

[0070] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0071] like Figure 1 and 2 As shown, a dialogue recommendation method based on a hypergraph neural network includes:

[0072] S100: Obtain user's historical dialogue information to construct a dialogue hypergraph; obtain external knowledge graphs to construct a knowledge hypergraph; obtain item review information to construct a review hypergraph;

[0073] When constructing a hypergraph, use Represents a set of items, representing User set, Represents a collection of comments. A session. Represented as a set of discourses, denoted as S t Let denot , and n denote the size of the conversation set, where each utterance consists of a sequence of words. The goal of the dialogue recommendation method (CRS) based on hypergraph neural networks is to provide accurate item recommendations. To meet the user's needs and generate an appropriate response in the (t+1)th round of dialogue.

[0074] A hypergraph is a unique type of graph, represented as follows: in Let ε represent a set of N nodes, where ε = {e1, e2, ..., e...}. M Let} represent a set of M hyperedges. Compared to a traditional graph, each hyperedge e i Each ∈ ε can connect more than two nodes. Hypergraph The correlation matrix is ​​concisely represented as follows:

[0075]

[0076] in, Represents a node Is it super-edge e? j Connected to ∈ε Represents an entity set.

[0077] It should be noted that, in order to more effectively obtain higher-order relationships from external knowledge from multiple aspects to explore user preferences, this embodiment utilizes a hypergraph structure and constructs three different hypergraphs based on session context, knowledge graph, and item review information, which are respectively called session hypergraph, knowledge hypergraph, and review hypergraph.

[0078] Dialogue Hypergraph: Because historical dialogues contain a wealth of fine-grained entity details within the context, traditional graph structures cannot model the inherent high-order relationships within this information, thus failing to explore implicit user preferences. To address this limitation, this embodiment constructs a dialogue hypergraph based on historical conversation context to mine high-order relationships between and within conversations, thereby facilitating user preference learning. Specifically, as shown in the hypergraph construction module above, each dialogue round initiated by the user is called a conversation, each conversation is considered a hyperedge, and all items appearing in the current conversation are considered nodes. In this way, a representation can be derived as... The session hypergraph, in which This indicates the node corresponding to the item that appears in the session. The association matrix represents the session hypergraph.

[0079] Knowledge Hypergraph: In real-world scenarios, historical dialogues between users interacting with the system are relatively limited. In such cases, the contextual information obtained from these historical dialogues is insufficient to uncover inherent user preferences. To address this limitation, this embodiment utilizes an external knowledge graph and models it as a hypergraph structure to capture high-order semantic relationships and enrich the representation of relevant entities. The core idea of ​​this approach is that a vertex and its extended neighbors can share common semantics. For example... Figure 2 As shown in the hypergraph construction module, this embodiment models each project as a hyperedge and its connected n-hop neighbors as nodes. This modeling strategy ensures that hyperedges from historical projects are interconnected through shared entities, thus forming a knowledge-based hypergraph, represented as... in, This represents the project nodes that appear in the dialogue and their N-order neighbors in the knowledge graph. This represents the correlation matrix.

[0080] Comment Hypergraph: A project's comment information comprises a set of sentences written by online users, which helps explore user interests and enrich project representations. Building upon existing methods, this invention introduces item comment information to further enrich project representations. This embodiment uses a hypergraph structure to model item comment information, aiming to reveal higher-order relevance in user comments. The motivation is that projects and user comments may share similar semantic meanings when modeling similar user preferences. Figure 2 As shown in the hypergrid construction module, this embodiment treats a project review consisting of sentences as a hyperedge and all important entities appearing in the sentences as nodes. The review hypergraph is represented as follows: in, Includes nodes from the dialogue and related entities from the comments. This represents an association matrix. This innovative representation of review information not only incorporates the informational value of user reviews but also captures the complex relationships between entities, thus providing a nuanced understanding of user preferences.

[0081] S200. Encode the entities in the dialogue hypergraph, knowledge hypergraph, and comment hypergraph using a knowledge graph encoder to generate node representations;

[0082] It should be noted that the knowledge graph encoder mentioned in this embodiment is a hypergraph attention network of an aggregator, whose function is to transform entities in the hypergraph into node representations with higher semantic meaning. Through the action of the knowledge graph encoder, the inherent relationships between entities can be better revealed, thereby facilitating the subsequent recommendation calculation process.

[0083] S300. Based on the node representation, a hypergraph neural network constructed using a dual attention mechanism is used to learn node features and generate historical session representation, knowledge representation, and comment representation;

[0084] It should be noted that the dual-attention mechanism mentioned in this embodiment is a multi-layered attention mechanism. Its function is to further explore the relationships between entities in each hypergraph based on the node representation, thereby improving the expressive power of the dialogue recommendation model. Through flexible learning via the dual-attention mechanism, historical conversation representation, knowledge representation, and comment representation can be output. These representations can more accurately capture user preferences and the connections between entities.

[0085] S400: Perform a concatenation operation on the historical conversation representation, knowledge representation, and comment representation to generate a long-term user preference embedding; and extract the short-term user preference embedding from the user's current dialogue information.

[0086] It should be noted that this embodiment integrates historical conversation representations, knowledge representations, and comment representations through a join operation to generate a long-term user preference embedding. This join operation can be a simple concatenation, or it can be a weighted summation, multiplicative fusion, or other methods. The long-term preference embedding is used to capture the user's preferences in historical conversations, thereby providing a basis for current conversation recommendations. Simultaneously, this embodiment also extracts the user's short-term preference embedding from the user's current conversation information to reflect changes in the user's interests during the current conversation. Short-term preferences are represented by extracting key entities from the user's current conversation.

[0087] S500: The user's long-term preference embedding and short-term preference embedding are combined using a pooling layer to generate the final user representation, and suitable items are recommended to the user based on the final user representation;

[0088] It should be noted that the pooling layer mentioned in this embodiment is an operation that fuses the user's long-term preference embeddings and short-term preference embeddings. Its function is to comprehensively consider the user's long-term preferences and short-term interests to generate a more accurate user representation. The pooling layer can perform operations such as weighted summation and concatenation on the two embedding vectors to obtain the final user representation. Then, based on the final user representation, a user item recommendation list is generated, and items matching the user's preferences are recommended to the user based on the user item recommendation list.

[0089] S600: Encode the historical dialogue information and the current dialogue information using an encoder to generate the historical conversation embedding and the current conversation embedding;

[0090] It should be noted that this embodiment employs the Transformer architecture, a language generation model based on an encoder-decoder framework. In this embodiment, two independent transformer encoders are used to encode the historical and current conversations to generate corresponding historical and current conversation embeddings. During decoding, this embodiment fuses the historical dialogue, current dialogue, and item representations through an attention layer to improve the quality of dialogue generation.

[0091] The encoder mainly consists of a multi-self-attention mechanism and a feedforward neural network. The multi-self-attention mechanism can capture different attention weights in the input sequence, thereby better capturing the semantic information of the input sequence. The feedforward neural network is used to further process the output of the multi-self-attention mechanism to obtain a richer representation.

[0092] During the encoding phase, this embodiment inputs the historical and current conversations as input sequences into two independent transducer encoders. These two encoders generate historical conversation embeddings and current conversation embeddings, respectively. The historical conversation embedding contains information from past dialogues, while the current conversation embedding reflects the state of the current dialogue. These two embeddings play a crucial role in the decoding phase.

[0093] S700, use a decoder to decode the item embedding, the historical session embedding, and the current session embedding;

[0094] In the decoding phase, this embodiment employs an attention layer. The attention layer is a crucial part of the Transformer architecture, automatically adjusting attention weights based on the input sequence and the encoder's output. In this embodiment, historical dialogue, current dialogue, and item representations are input into the attention layer. The attention layer automatically adjusts the attention weights based on the similarity between historical dialogue embeddings, current dialogue embeddings, and item representations, enabling the decoder to better utilize past and present dialogue and item information. During decoding, this embodiment employs an attention-based decoder. This decoder generates the next word based on the attention weights generated by the attention layer, combined with historical dialogue embeddings, current dialogue embeddings, and item representations. This approach improves the quality of dialogue generation, making the generated dialogue more fluent and coherent.

[0095] This embodiment employs a Transformer architecture, generating historical and current session embeddings through two independent transformer encoders. During decoding, an attention layer fuses historical dialogues, current dialogues, and item representations. This approach achieves good results in dialogue generation tasks, producing dialogues with high quality and fluency.

[0096] S800. Establish a dialogue recommendation model, train and optimize the dialogue recommendation model, and output appropriate dialogue.

[0097] It should be noted that the dialogue recommendation model mentioned in this embodiment is based on deep learning technology, mainly including an encoder, decoder, and attention mechanism. During training and optimization, this embodiment employs the cross-entropy loss function and the Adam optimizer. The cross-entropy loss function measures the difference between the dialogue generated by the model and the actual dialogue, while the Adam optimizer adjusts the model parameters to make the generated dialogue more aligned with user preferences.

[0098] During training, this embodiment employs a progressively increasing difficulty approach. First, the model undergoes basic training to generate simple dialogues. Then, the training difficulty is gradually increased to enable it to generate more complex dialogues that align with user preferences. Furthermore, this embodiment utilizes data augmentation techniques, such as random replacement, insertion, and deletion, to increase the diversity of the training data, thereby improving the model's generalization ability.

[0099] In the optimization process, this embodiment mainly focuses on the following aspects: First, adjusting the structure of the encoder and decoder to improve the model's expressive power; second, adjusting the parameters of the attention mechanism to improve the model's ability to capture user preferences; third, adopting regularization techniques, such as Dropout and L2 regularization, to prevent the model from overfitting; and fourth, adjusting hyperparameters such as the learning rate to accelerate model convergence.

[0100] In summary, this embodiment proposes a dialogue recommendation method based on hypergraph neural networks, aiming to obtain user preferences through multi-turn natural language dialogue and recommend suitable items to users. This method actually includes five modules: hypergraph construction, knowledge graph encoder, hypergraph attention network, recommendation module, and dialogue generation module. Specifically, the hypergraph construction module constructs three hypergraphs based on different knowledge aspects to mine higher-order relationships between data; the hypergraph attention network utilizes a dual attention mechanism to flexibly learn node features to model the implicit preference representation of users; the recommendation module integrates the long-term preferences reflected by the user's multi-faceted knowledge and the short-term preferences reflected by the current dialogue, and recommends suitable items to the user; the dialogue generation module cleverly generates response utterances appropriate to the context, improving dialogue performance by utilizing historical and current dialogue.

[0101] As an optional embodiment of the present invention, optionally, the formula for encoding entities in the dialogue hypergraph, knowledge hypergraph, and comment hypergraph using a knowledge graph encoder to generate node representations is:

[0102]

[0103] in, This represents the representation of entity e at level l+1;

[0104] σ(·) represents a nonlinear activation function;

[0105] r represents a relation;

[0106] Represents a set of relations;

[0107] e' represents the adjacent node of entity e;

[0108] This represents the set of adjacent nodes of entity e under relation r;

[0109] Z e,r Indicates the normalization factor;

[0110] and W (l) It is a learnable matrix;

[0111] This represents the representation of entity e at level l.

[0112] It should be noted that this embodiment uses an entity-granular knowledge graph, namely DBpedia and CN-DBpedia, as external knowledge. They store factual knowledge triples, represented as <e1, r, e2>, where e1, e2 ∈ E are entities, and E represents the entity set. It refers to relationships. To obtain the corresponding entity embeddings, this embodiment employs the KG encoder R-GCN, which encodes relational semantics through a relational graph neural network. After aggregating information from the knowledge graph, this embodiment can obtain entity representations from the top layer of the R-GCN.

[0113] As an optional embodiment of the present invention, the method may further include, in the dual attention mechanism, equipping it with two aggregators;

[0114] Expressed using a formula:

[0115]

[0116]

[0117] in, This represents the representation of node i in the l-th layer;

[0118] It is a hyperedge aggregator with hyperedge attention, which can aggregate the features of hyperedges onto nodes;

[0119] This represents the representation of node i in the (l-1)th layer;

[0120] Indicates the superedge e in layer l j The representation of;

[0121] Indicates any;

[0122] ε i Indicates the connection node v i The superedge set;

[0123] It is a node aggregator with node-level attention, which can aggregate node features onto hyperedges;

[0124] Indicates the superedge e j The characteristics of the connected nodes in the previous layer;

[0125] v k Represents a node.

[0126] It should be noted that previous studies have utilized hypergraph convolution operations to obtain node representations in order to enhance node representations in hypergraphs. In this process, features of adjacent nodes are initially aggregated into shared hyperedges and then propagated to the nodes. However, a notable problem arises: these methods often treat nodes equally when describing hyperedges, ignoring the varying importance of hyperedges within the aggregated nodes. To overcome this limitation, this embodiment designs a hypergraph attention network equipped with two aggregators using a dual-attention mechanism, which considers the correlations between nodes defined by different hyperedges. The two aggregators in the dual-attention mechanism mentioned in this embodiment are designed to better capture the relationships and features between entities when processing dialogue hypergraphs, knowledge hypergraphs, and comment hypergraphs. Through the hyperedge aggregator and node aggregator, entity representations at different levels can be effectively fused, thereby improving the quality and accuracy of entity representations.

[0127] As an optional embodiment of the present invention, the step of repeatedly learning node features based on the node representation using a dual attention mechanism includes:

[0128] S301. Utilize the node-to-edge attention mechanism to focus on key nodes and aggregate the features of key nodes.

[0129] Expressed as a formula:

[0130]

[0131]

[0132]

[0133] in, Indicates the superedge e in layer l j The representation of;

[0134] σ(·) represents a nonlinear activation function;

[0135] v k Indicates node k;

[0136] e j Indicates the superedge j;

[0137] a jk Indicates the superedge e j Middle node v k Attention coefficient;

[0138] W1 represents the weight vector;

[0139] Indicates v k Features in layer l-1;

[0140] exp(·) denotes an exponential function with the natural constant e as its base;

[0141] This represents a trainable weight vector used to measure node importance;

[0142] u k Indicates v k Transformed node features;

[0143] v p Represents node p;

[0144] u p Indicates v p Transformed node features;

[0145] LeakyReLU(·) represents a nonlinear activation function;

[0146] It should be noted that in a hypergraph, each hyperedge consists of an arbitrary number of nodes, and the importance of nodes within a hyperedge may vary. To highlight this diversity, this embodiment proposes a node-to-edge attention mechanism to emphasize key nodes and aggregate their features, thereby improving the quality and accuracy of hyperedge representation. Specifically, the node-to-edge attention mechanism emphasizes the importance of key nodes within a hyperedge by assigning an attention coefficient to each node. The attention coefficient can be calculated based on the features of the node and the hyperedge, so that important nodes are given higher weight when aggregating node features.

[0147] S302. Utilize the attention mechanism of hyperedge pairs to pay attention to the importance of key hyperedge pairs and aggregate the features of key hyperedges.

[0148] Expressed as a formula:

[0149]

[0150]

[0151]

[0152] in, This represents the representation of node i in the l-th layer;

[0153] σ(·) represents a nonlinear activation function;

[0154] ε i Indicates connection v i The superedge set;

[0155] v i Represents node i;

[0156] β ijIndicates the superedge e j For node v i Attention coefficient;

[0157] W2 represents a weight parameter;

[0158] Indicates the superedge e in layer l j The representation of;

[0159] Represents another weight vector;

[0160] v j Represents node j;

[0161] e p Represents the superedge p;

[0162] ε j Represents node v j The superedge set;

[0163] v p Represents node p;

[0164] || indicates a join operation;

[0165] Indicates the superedge e p The characteristics of the connected nodes in the previous layer.

[0166] It should be noted that a node in a hypergraph can be associated with multiple hyperedges, but the importance of each hyperedge to that node may differ. Therefore, this embodiment designs a hyperedge-to-node attention mechanism to emphasize the contribution of important hyperedges to the node and aggregates their unique features to update node v. i The representation of This improves the quality and accuracy of node representations. Specifically, the hyperedge attention mechanism emphasizes the importance of key hyperedges in node representations by assigning an attention coefficient to each hyperedge. The attention coefficient can be calculated based on the features of the node and the hyperedge, so that important hyperedges are given higher weights when aggregating node features.

[0167] In summary, this embodiment combines the features of preceding nodes with features from hyperedges to derive new node representations. The two proposed aggregators utilize a dual attention mechanism, enabling the hypergraph attention network to not only capture higher-order relationships between data but also highlight key information at different granularities during the learning process.

[0168] As an optional embodiment of the present invention, the expression for combining the user's long-term preference embedding and the user's short-term preference embedding using the pooling layer is optionally:

[0169]

[0170]

[0171] in, This indicates the embedding of long-term user preferences;

[0172] [;;] and [;] represent join operations;

[0173] r s Indicates the history of the session;

[0174] r k Representing knowledge;

[0175] r c This indicates a comment;

[0176] p u This represents the final user representation;

[0177] Pooling(·) represents average pooling;

[0178] This indicates the embedding of short-term user preferences.

[0179] It should be noted that in this expression, this embodiment first performs a concatenation operation on the historical session representation, knowledge representation, and comment representation to generate the user's long-term preference embedding. Then, it performs a concatenation operation on the user's long-term preference embedding and the user's short-term preference embedding to fuse the information from both. Finally, it extracts key features through a max pooling operation to obtain the final user representation.

[0180] It should be emphasized that the two combinations described above are merely two embodiments of the present invention. In reality, depending on the specific application needs and scenarios, there are multiple ways to combine long-term user preference embedding and short-term user preference embedding. Furthermore, the present invention is not only applicable to movie recommendation systems but can also be applied to other recommendation systems, such as product recommendations and music recommendations.

[0181] As an optional embodiment of the present invention, the expression for recommending suitable items to the user based on the final user representation is optionally:

[0182]

[0183] Among them, P rec This represents the probability of recommending an item to user u.

[0184] Softmax(·) represents the normalization operation;

[0185] p u This represents the final user representation;

[0186] Represents a set of items The representation of item i in the table.

[0187] It should be noted that in the above expression, this implementation uses the final user representation example to calculate the probability of recommending items to the user and generates an item recommendation list. Based on this list, suitable items are then recommended to the user. The normalization operation here is to ensure that the probability values ​​fall within a normal range, avoiding values ​​that are too large or too small.

[0188] As an optional embodiment of the present invention, the expression formula for decoding the item embedding, the historical session embedding, and the current session embedding using the decoder is optionally as follows:

[0189]

[0190]

[0191]

[0192]

[0193]

[0194]

[0195] in, R represents n-1 The output after passing through the self-attention layer;

[0196] R n-1 This represents the output of the (n-1)th layer decoder;

[0197] MHA(,,) represents the multi-head attention mechanism;

[0198] The representation of an item is the one that has passed through the cross-attention layer;

[0199] N C Indicates the representation of items;

[0200] This represents the current dialogue after passing through the cross-attention layer;

[0201] X C Indicates the current session embedding;

[0202] This represents the historical dialogue representation after passing through the cross-attention layer.

[0203] X H Indicates embedding of historical sessions;

[0204] This represents the output after balancing the historical dialogue embedding and the current dialogue embedding.

[0205] β represents the balance factor;

[0206] R n This represents the output of the nth layer decoder;

[0207] FFN(·) represents a fully connected feedforward network;

[0208] It should be noted that this representation formula is primarily used to handle item embeddings, historical session embeddings, and current session embeddings in dialogue recommendation models. Decoding these three elements through a decoder allows for a better understanding of the user's needs in the current session, resulting in more accurate recommendations. Furthermore, this dialogue recommendation model possesses adaptive learning capabilities. By continuously analyzing user behavior data and feedback, the model can continuously optimize its recommendation algorithm, improving both accuracy and user satisfaction. Simultaneously, the model can flexibly respond to changes in user needs and scenarios by adjusting balance factors in real time.

[0209] The multi-head attention mechanism is represented as follows:

[0210] MHA(Q,K,V)=[h1;...;h h W o

[0211] h i =Attention(QW i q ,KW i k VW i v )

[0212] Where Q represents the query matrix;

[0213] K is the bond matrix;

[0214] V is a value matrix;

[0215] h h Indicates the number of attention mechanisms;

[0216] Attention(,,) represents the attention mechanism;

[0217] W i q W i k W i v and W 0 This represents the parameter matrix.

[0218] It's important to note that the role of multi-head attention mechanisms is to increase the model's focus on input information, thereby enhancing its expressive power. By multiplying the query matrix, key matrix, and value matrix by the number of attention mechanisms, and then summing the results, the weight of each item in the current session can be obtained. Such weights can better reflect the importance of items in the current session, thus helping the decoder to accurately interpret user needs.

[0219] As an optional embodiment of the present invention, the fully connected feedforward network may be expressed by the following formula:

[0220] FFN(x)=ReLU(xW1+b1)W2+b2

[0221] Where ReLU(·) represents the modified linear unit;

[0222] x represents the input feature;

[0223] W1 and W2 represent weight parameters;

[0224] b1 and b2 are two deviation terms.

[0225] It should be noted that the role of the fully connected feedforward network is to further optimize and adjust the item recommendation list to improve the accuracy and satisfaction of the recommendations. By modifying the linear units, the fully connected feedforward network can effectively capture the complex relationship between user features and item features, thereby improving the ranking effect of the recommendation list.

[0226] As an optional embodiment of the present invention, the method may further include enhancing the information content of the generated content by utilizing a copying mechanism based on the output of the decoder;

[0227] Expressed using a formula:

[0228] Pr(y i |y1,...,y i-1 )=Pr1(y i |R i )+Pr2(y i |u)+Pr3(y i |R i ,u)

[0229] Where Pr(·) represents the probability of the next word;

[0230] y i This represents the i-th word;

[0231] Pr1(·) is the probability function for generating the vocabulary;

[0232] R i This represents the output of the decoder;

[0233] Pr2(·) represents the final user representation p u The probability function of the generated word deviation;

[0234] Pr3(·) represents the probability function implemented through the replication mechanism, and u represents the user.

[0235] It should be noted that, in addition to generating similar responses, CRS also requires responses to related recommended items. Therefore, this embodiment uses a copying mechanism to enhance the information content of the generated content. Formally, given a representation denoted as {y i-1}=y1,y2,...,y i-1 The invention also employs a replication mechanism based on decoder output to enhance the information content of the generated content. This replication mechanism dynamically adjusts the probability distribution of the generated content based on user input and the current state of the recommendation list, thereby improving the quality and satisfaction of the recommendation list. In practical applications, this method can effectively increase user acceptance and satisfaction with the recommended content, thus enhancing user stickiness.

[0236] As an optional embodiment of the present invention, the optimization of the dialogue recommendation model may include:

[0237]

[0238]

[0239] in, Indicates the recommended loss for the item;

[0240] For small batch sizes;

[0241] Represents the probability of item i;

[0242] y ij Label the item;

[0243] log(·) represents the logarithmic function;

[0244] j represents the j-th batch;

[0245] i represents an item in item set I;

[0246] This indicates the loss in dialogue recommendation;

[0247] Indicates the length of the truncated statement;

[0248] y t-1This represents the (t-1)th word;

[0249] This represents the probability of generating a word.

[0250] It should be noted that in this embodiment, the goal of item recommendation is to recommend the most suitable items to the user based on their interests and behaviors. To achieve this goal, this embodiment employs the cross-entropy loss function. The cross-entropy loss function, derived from information theory, is used to measure the difference between two probability distributions. In item recommendation, this embodiment treats items as categories and uses user behavior data as input features, employing a dialogue recommendation model to predict the user's preference for items. In this process, the cross-entropy loss function helps measure the difference between the model's predicted probabilities and the true probabilities, thereby optimizing model parameters and improving the accuracy of item recommendations.

[0251] In dialogue recommendation, the goal of this embodiment is to recommend the most suitable dialogue response to the user based on their historical dialogue records. Similarly, this embodiment uses the cross-entropy loss function to achieve this goal. In dialogue recommendation, this embodiment treats the dialogue history as sequential data and trains a dialogue recommendation model to predict the next dialogue response. The cross-entropy loss function plays a crucial role in this process; it helps measure the difference between the probability distribution predicted by the model and the true probability distribution, thereby optimizing model parameters and improving the accuracy of dialogue recommendations. The optimization process of the cross-entropy loss function can be implemented using optimization algorithms such as gradient descent, enabling the model to converge quickly during training and improving recommendation performance.

[0252] To address the issue of mini-batch size, a dynamic adjustment strategy can be employed. The mini-batch size is adjusted in real-time based on the actual situation during training to balance training speed and model convergence. In practical applications, the mini-batch size can be adaptively adjusted according to factors such as hardware devices and network environment to improve training efficiency.

[0253] The dialogue recommendation model optimization method mentioned in this invention is not unique and can be adjusted and optimized according to actual needs and scenarios.

[0254] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.

Claims

1. A dialogue recommendation method based on a hypergraph neural network, characterized in that, include: S100: Obtain the user's historical dialogue information to construct a dialogue hypergraph; To construct a knowledge hypergraph, we need to acquire external knowledge graphs. Use item review information to construct a review hypergraph; S200. Encode the entities in the dialogue hypergraph, knowledge hypergraph, and comment hypergraph using a knowledge graph encoder to generate node representations; S300. Based on the node representation, a hypergraph neural network constructed using a dual attention mechanism is used to learn node features and generate historical session representation, knowledge representation, and comment representation; The dual attention mechanism is equipped with two aggregators; Expressed using a formula: in, Indicates the first Layer nodes The expression, Indicates a hyper-edge aggregator. Indicates the first Layer nodes The expression, Indicates in In-layer super edge The expression, Indicates any, Indicates the connection node hyperedge set, Represents a node aggregator. Indicates the superedge The characteristics of the connected nodes in the previous layer, Represents a node; S400: Perform a concatenation operation on the historical conversation representation, knowledge representation, and comment representation to generate a long-term user preference embedding; and extract the short-term user preference embedding from the user's current dialogue information. S500: The user's long-term preference embedding and short-term preference embedding are combined using a pooling layer to generate the final user representation, and suitable items are recommended to the user based on the final user representation; S600: Encode the historical dialogue information and the current dialogue information using an encoder to generate the historical conversation embedding and the current conversation embedding; S700, use a decoder to decode the item embedding, the historical session embedding, and the current session embedding; S800. Establish a dialogue recommendation model, train and optimize the dialogue recommendation model, and output appropriate dialogue.

2. The dialogue recommendation method based on a hypergraph neural network as described in claim 1, characterized in that, The formula for encoding entities in the dialogue hypergraph, knowledge hypergraph, and comment hypergraph using a knowledge graph encoder to generate node representations is as follows: in, Representing entities In the Layer representation, Represents a non-linear activation function. Indicates a relationship. Represents a set of relations. Representing entities The adjacent nodes, Representing entities In relationship The set of adjacent nodes below, Represents the normalization factor. and For learnable matrices, Representing entities In the Layer representation.

3. The dialogue recommendation method based on a hypergraph neural network as described in claim 1, characterized in that, The method of repeatedly learning node features based on the node representation using a dual attention mechanism includes: S301. Utilize the node-to-edge attention mechanism to focus on key nodes and aggregate the features of key nodes. Expressed as a formula: in, Indicates in In-layer super edge The expression, Represents a non-linear activation function. Represents a node , Indicates the superedge , Indicates the superedge Middle node Attention coefficient, Represents the weight vector. express In the Features in the layer This represents an exponential function with base e. This represents a trainable weight vector used to measure node importance. express Transformed node features Represents a node , express Transformed node features Represents a non-linear activation function; S302. Utilize the attention mechanism of hyperedge pairs to pay attention to the importance of key hyperedge pairs and aggregate the features of key hyperedges. Expressed as a formula: in, Indicates the first Layer nodes The expression, Represents a non-linear activation function. Indicates connection hyperedge set, Represents a node , Indicates the superedge For nodes Attention coefficient This represents a weight parameter. Indicates in In-layer super edge The expression, Represents another weight vector, Represents a node , Indicates the superedge , Represents a node hyperedge set, Represents a node , Indicates a connection operation. Indicates the superedge The characteristics of the connected nodes in the previous layer.

4. The dialogue recommendation method based on a hypergraph neural network as described in claim 1, characterized in that, The expression that combines the user's long-term preference embedding and the user's short-term preference embedding using the pooling layer is as follows: in, This indicates that users have a long-term preference for embedding. and Indicates a connection operation. This indicates the history of the session. Representing knowledge representation, The comments indicate that... This represents the final user's opinion. Indicates average pooling. This indicates the embedding of short-term user preferences.

5. The dialogue recommendation method based on a hypergraph neural network as described in claim 1, characterized in that, The expression for recommending suitable items to the user based on the final user representation is: in, Indicates to users The probability of recommending items. This indicates a normalization operation. This represents the final user's opinion. Represents a set of items Items in The expression .

6. The dialogue recommendation method based on a hypergraph neural network as described in claim 1, characterized in that, The formula for decoding the item embedding, the historical session embedding, and the current session embedding using the decoder is as follows: in, express The output after the self-attention layer Indicates the first The output of the layer decoder, This indicates a multi-head attention mechanism. The representation of an item is the representation after passing through the cross-attention layer. Indicates the item representation, This represents the current dialogue after passing through the cross-attention layer. Indicates the current session embedding, This represents the historical dialogue representation after passing through the cross-attention layer. Indicates historical session embedding, This indicates the output after balancing the embeddings of the historical dialogue and the current dialogue. Represents the balance factor. Indicates the first The output of the layer decoder, This represents a fully connected feedforward network; The multi-head attention mechanism is represented as follows: in, Represents the query matrix. The key matrix, For value matrices, Indicates the number of attention mechanisms. This indicates a splicing operation. This represents the attention mechanism. and This represents the parameter matrix.

7. The dialogue recommendation method based on a hypergraph neural network as described in claim 6, characterized in that, The fully connected feedforward network is expressed by the following formula: in, Indicates a corrected linear unit. Represents the features of the input. Represents the weight parameters. These are two deviation terms.

8. The dialogue recommendation method based on a hypergraph neural network as described in claim 6, characterized in that, The method also includes enhancing the information content of the generated content by using a copying mechanism based on the output of the decoder; Expressed using a formula: in, This represents the probability of the next word. Indicates the first One word, To generate the vocabulary probability function, This represents the output of the decoder. Indicates the final user representation The probability function of the generated word deviation. This represents the probability function implemented through the aforementioned replication mechanism. Indicates the user.

9. The dialogue recommendation method based on a hypergraph neural network as described in claim 1, characterized in that, Optimizing the dialogue recommendation model includes: in, Indicates the recommended loss of the item. For small batch sizes, Represents items The probability, For item labels, Represents the logarithmic function. Indicates the first One batch, Represents a set of items Items in the middle, Indicates the loss in dialogue recommendation. Indicates the length of the truncated statement. Indicates the first One word, This represents the probability of generating a word.

Citation Information

Patent Citations

  • Dialogue recommendation algorithm based on dual-channel hypergraph interest modeling

    CN115408505A