A dynamic graph aggregation-based dialogue recommendation method

By combining dynamic graph aggregation and language model encoder, the problems of excessive irrelevant information and semantic gaps in knowledge graphs in dialogue recommendation systems are solved, resulting in more accurate recommendations and higher-quality natural language responses.

CN119670895BActive Publication Date: 2025-11-25YUNNAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411851551.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-11-25
Estimated Expiration
2044-12-16

AI Technical Summary

Technical Problem

Existing dialogue recommendation systems suffer from problems such as excessive irrelevant information, incomplete feature learning, and semantic gaps between language generation models and the encoding of external knowledge graphs when utilizing knowledge graphs. These issues lead to inaccurate recommendation results and low quality of natural language responses.

Method used

We employ GCN to encode project-level knowledge graphs, dynamically aggregate word-level knowledge graphs to construct dynamic subgraphs, and utilize language model encoders to bridge semantic gaps. By combining attention and self-attention mechanisms, we enhance the recommendation and dialogue modules of the knowledge graph.

Benefits of technology

This improves the recommendation accuracy and natural language response quality of the dialogue recommendation system, generating higher-quality user representations and recommendation results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119670895B_ABST
    Figure CN119670895B_ABST
Patent Text Reader

Abstract

The application provides a dialogue recommendation method based on dynamic graph aggregation, which improves the performance of the dialogue recommendation system by integrating knowledge graph information. The method first encodes the knowledge graph at the item level using GCN, then encodes the knowledge graph at the word level through dynamic graph aggregation, selects relevant triples according to the dialogue context to build a dynamic subgraph, and forms a global graph representation. A language model encoder is introduced in the process to bridge the semantic gap between the knowledge graph and the language model, and an attention mechanism is used to enhance the learned graph features. In addition, the method enhances the recommendation module and the dialogue module, respectively calculates the recommendation probability and the next token generation probability using the Softmax function, and optimizes the recommendation result and the quality of the natural language reply. Experimental results show that the application is superior to existing methods in terms of recommendation accuracy and dialogue fluency.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of recommendation systems, and particularly relates to a dialog recommendation method based on dynamic graph aggregation. BACKGROUND

[0002] A conversational recommender system (CRS) is a hot research topic in the field of recommendation systems. Unlike traditional static recommendation system models, CRS interacts with users through natural language and dynamically provides higher quality recommendations according to user feedback during the conversation, which has great practical value in e-commerce, online customer service, tourism and catering, etc. Generally, CRS mainly consists of two parts: a dialog module and a recommendation module. The dialog module is responsible for understanding the user's current intent and generating a corresponding natural language reply, and the recommendation module needs to capture the user's preferences and provide high-quality recommended items. CRS combines the two parts through a conversion mechanism to generate the final reply containing recommended items.

[0003] However, since CRS itself does not contain any relevant knowledge information, it cannot understand the user's entire intent through only a few short conversations. To solve this problem, some studies have introduced external knowledge graphs (KG) to enrich the context information, such as the movie-related knowledge graph DBpedia and the word-related knowledge graph ConceptNet. Graph neural networks are mainly used to aggregate the information of the knowledge graph in order to integrate it into the CRS framework, such as graph convolutional neural network GCN and relation graph convolutional neural network RGCN. In terms of dialog generation, CRS usually uses a sequence-to-sequence model as a language model to generate reply text, such as Transformer, which is usually an encoder-decoder structure. The encoder takes the context conversation as input and encodes it into a high-level representation, and the decoder generates a response based on this encoded representation.

[0004] Although many studies have shown that this approach can indeed improve the performance of CRS, there are still two problems to be solved. First, when using knowledge graph-based auxiliary information, directly using graph neural networks to encode the entire knowledge graph and selecting relevant content on a separate subgraph after encoding can lead to excessive irrelevant information and biased and incomplete feature learning. Second, the current CRS framework is still hindered by the representation gap between the hidden space of the language generation model and the GNN that encodes external knowledge graphs. Although graph neural networks can encode the information of the knowledge graph well, CRS cannot truly understand the semantics of the nodes in the knowledge graph, which poses a major challenge to the subsequent text decoding and the use of graph knowledge in the recommendation process. SUMMARY

[0005] The application aims to provide a dialogue recommendation method based on dynamic graph aggregation, which can obtain more accurate recommendation results and generate higher quality natural language replies.

[0006] The technical scheme adopted by the application is a dialogue recommendation method based on dynamic graph aggregation, characterized by comprising the following steps:

[0007] Step S1: GCN encodes the knowledge graph at the item level;

[0008] Step S2: dynamically aggregate the knowledge graph at the word level, select existing triples of the knowledge graph through the dialogue context, further construct a dynamic subgraph, and finally obtain a global graph, wherein step 2 specifically comprises:

[0009] Step S21: dynamic graph construction;

[0010] Step S22: dynamic graph aggregation;

[0011] Step S3: enhance the recommendation module of the knowledge graph;

[0012] Step S4: enhance the dialogue module of the knowledge graph.

[0013] Further, in step S1, a new dynamic knowledge graph is constructed according to the dialogue content to utilize the knowledge graph information, and the encoder of the language model is fused to bridge the semantic gap between the knowledge graph and the language model:

[0014]

[0015] wherein R represents a set of relations, represents a set of adjacent nodes of node e under the relationship r between nodes, W (l) represents a trainable parameter matrix, represents a weight matrix related to the neighbor node e', W (l) represents a weight matrix related to itself, Z e,r represents a normalization factor, represents the representation of node e at the next layer, and sigma represents a nonlinear activation function, represents the representation of node e at the current layer, represents the representation of the neighbor node e' of node e at the current layer.

[0016] Further, in step S21,

[0017] Step S21a, retrieve the reply of the current dialogue by word matching and rule filtering, select all the words appearing in the reply and other words connected therewith, and then select all the triples related to the current reply to form several subgraphs, each of which contains several triples; then flatten each triple and send it into the language model encoder in the dialogue module to obtain basic pseudo nodes Each pseudo node represents a triple:

[0018]

[0019] wherein F(t j ) represents a flattening operation on the triple t j , which expands the triple into a text sequence (for example: (play, MannerOf, sound) is flattened into "play manner of milk"), Encoder represents the language model encoder in the dialogue module, represent the head node, the node relationship, and the tail node of the triple t j respectively; is the obtained basic pseudo node;

[0020] Step S21b, introduce the language model encoder to learn the semantics of the words mentioned in the current text, and fill the semantic gap between the knowledge graph and the language generation model, after obtaining the basic pseudo node, connect the basic pseudo node with the hierarchical pseudo node according to the grouping to form a new subgraph composed of new triples:

[0021]

[0022] g' i = {t'1, t'2, …, t' j} (5)

[0023] wherein t' j represents a new triple, g' i represents a new subgraph, represents the obtained basic pseudo node, r a is the relationship in the new triple, represents a hierarchical pseudo node, t'1, t'2, …, t' j represent the respective new triples;

[0024] Step S21c, connect the subgraphs through the root pseudo node V to finally form a new global pseudo graph composed of pseudo triples;

[0025]

[0026] G' = {T1, T2, …, Tj} (7)

[0027] where T j denotes pseudo-triplet, G' denotes global pseudo-graph denotes hierarchical pseudo-node, V denotes root pseudo-node, T1,T2,…,T j denotes hierarchical pseudo-node and root pseudo-node V connected to form a pseudo-triplet, r a denotes the relationship between them.

[0028] Further, the step S22, based on the reconstructed pseudo-graph obtained in step S21, selects the attention mechanism to dynamically aggregate information between pseudo-nodes to learn the whole graph, directly calculates the average value of all basic pseudo-nodes to aggregate the features of the nodes, and obtains the global representation ε; the words appearing in the context are sent to the language model encoder to obtain the context semantic encoding; finally, ε and TE are concatenated and sent to a fully connected network to obtain the query vector q, which is used for subsequent attention mechanism;

[0029]

[0030] TE=Encoder(context_words) (9)

[0031] q=FC(ε;TE) (10)

[0032] where ε denotes the overall semantics of all triplets, TE denotes the context semantic encoding, and q denotes the query vector, denotes basic pseudo-node, |G'| denotes the number of nodes of the newly generated global pseudo-graph, Encoder denotes the language model encoder, context_words denotes the words appearing in the context, and FC denotes the fully connected neural network.

[0033] Further, after the step S22 obtains the query vector q, the formal graph aggregation process begins, and the information of the basic pseudo-node is aggregated to learn the hierarchical pseudo-node

[0034]

[0035] where, denotes attention scoring, denotes attention distribution, is a parameter matrix, q denotes the query vector, denotes the basic pseudo-node; the attention update function, i.e., according to the attention distribution aggregate the information of T denotes the transpose of the matrix, |g i | denotes the number of nodes in the subgraph g i | denotes the number of nodes in the subgraph g

[0036] Finally, the information of the aggregation hierarchical pseudo nodes is learned to the root pseudo node V, and after the aggregation, the global feature dynamically aggregated by ConceptNet according to the dialogue context content, i.e. the word-level embedding matrix U, is obtained;

[0037]

[0038] wherein, denotes the basic pseudo node, q denotes the query vector, |G'| denotes the number of nodes of the newly generated global pseudo graph, and G' denotes the global pseudo graph, denotes the hierarchical pseudo node, denotes the attention score, W G' denotes the parameter matrix, denotes the attention distribution, j denotes the current serial number of traversing the subgraph, and T is the transpose of the matrix; Update(V) is an attention update function, i.e. according to the attention distribution aggregation of the information of the hierarchical pseudo node to V.

[0039] Further, in the step S3, all items appearing in the dialogue context are collected, and a lookup operation is performed on the item embedding obtained by the R-GCN to obtain the context-related item embedding matrix I. The item embedding matrix I and the context-related word embedding matrix U obtained by dynamic graph aggregation are encoded by a self-attention mechanism, and finally the user preference representation p is obtained by combining the two through a gate mechanism u ,

[0040] p u = β·v + (1-β)·i (17)

[0041] β = σ(W gate [v;i]) (18)

[0042] wherein, β denotes the weight calculated by the gate mechanism, W gate denotes the gate mechanism training parameter, σ is an activation function, v denotes the word embedding encoded by the attention mechanism, and i denotes the item embedding matrix encoded by the attention mechanism.

[0043] Further, based on the user preference p u obtained in the step S3, the similarity between the user preference representation and the item embedding is calculated by using a Softmax function to obtain a series of scores, and then a ranking is generated to obtain a set of recommended items. Here, a cross-entropy loss function is set to learn the parameters:

[0044]

[0045] where P rec (k) denotes the recommendation probability of item k, the transpose matrix of user preference representation, L rec denotes the training loss of the recommendation module, y kn denotes the actual recommendation result in the data set, i k denotes item k, N represents the total number of dialogue rounds in the data set, M represents the size of the item set; n is the current dialogue round number of the data set in one training, denotes the recommendation probability of item k in the nth dialogue round.

[0046] Further, in the step S4, the Transformer is used as the language model of the dialogue module,

[0047] R n = LM decoder (R n-1 ,X,U,I) (21)

[0048] where X denotes the embedding matrix of the encoder output, U and I denote the word-level and item-level embedding matrices obtained through the knowledge graph, and R n denotes the output of the decoder, LM decoder denotes the language model decoder, R n-1 denotes the output of the previous layer decoder.

[0049] The Softmax function is used to calculate the probability of the next token to be generated, given the predicted subsequence y1,…,y i-1 , the probability of y i as the next token is:

[0050] P gen (y i |y1,…,y i-1 )=Softmax(y i |R i ) (22)

[0051] where R i denotes the output of the language model decoder.

[0052] Further, in the step S4, a cross-entropy loss function is set to learn the parameters:

[0053]

[0054] where L genLoss represents the loss of the dialogue module, t represents the tth sentence, Z represents the number of training set sentences, s t represents the tth sentence to be generated, s1,..., s t-1 represents the dialogue sequence.

[0055] Advantages of the present application:

[0056] 1、The dialogue recommendation model of the present application can pay more attention to more valuable graph nodes in the knowledge graph, and generate higher-quality user representations by using the obtained knowledge graph representation, and further obtain more accurate recommendation results.

[0057] 2、The language model is integrated in the process of constructing sub-graphs and aggregating node information to make up for the semantic gap between the knowledge graph and the language model, so that the CRS can better understand the knowledge graph information to generate higher-quality natural language replies. BRIEF DESCRIPTION OF DRAWINGS

[0058] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0059] Fig. 1 is a flow chart of the dialogue recommendation method based on dynamic graph aggregation of the present application.

[0060] Fig. 2 is a principle schematic diagram of the dialogue recommendation method based on dynamic graph aggregation of the present application. DETAILED DESCRIPTION

[0061] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0062] Embodiment 1

[0063] The embodiments of the present application propose a dialogue recommendation method based on dynamic graph aggregation, as shown in Figs. 1-2 , including the following steps:

[0064] Step S1, GCN (Graph Convolutional Network) encodes the knowledge graph at the item level:

[0065] According to the dialogue content, a new dynamic knowledge graph is constructed to utilize the knowledge graph information, and the encoder of the language model is fused to make up for the semantic gap between the knowledge graph and the language model:

[0066]

[0067] wherein R represents a relationship set, represents a set of adjacent nodes of node e under the inter-node relationship r, W (l) represents a trainable parameter matrix, represents a weight matrix related to the neighbor node e', W (l) represents a weight matrix related to itself, Z e,r represents a normalization factor, represents the representation of node e in the next layer, and sigma represents a nonlinear activation function, represents the representation of node e in the current layer, represents the representation of the neighbor node e' of node e in the current layer.

[0068] Step S2, word-level knowledge graph aggregation encoding:

[0069] By selecting existing triples of the knowledge graph through the dialogue context, a dynamic subgraph is further constructed, and finally a global graph is obtained.

[0070] Step S21, dynamic graph construction:

[0071] Step S21a, the reply to the current dialogue is retrieved by word matching and rule filtering, all the words appearing in the reply and other words connected thereto are selected, and thus all the triples related to the current reply are selected to form several subgraphs, each of which contains several triples. Then, each triple is flattened and sent to the language model encoder in the dialogue module to obtain a basic pseudo node Each pseudo node represents a triple:

[0072]

[0073] wherein F(t j ) represents a flattening operation on the triple t j , which expands the triple into a text sequence (for example: (play, MannerOf, sound) is flattened into "play manner of milk"), and Encoder represents the language model encoder in the dialogue module. respectively represent the head node, the inter-node relationship, and the tail node of the triple t j ; is the obtained basic pseudo node.

[0074] Step S21b, the operation of introducing the language model encoder can learn the semantics of the words mentioned in the current text, and can also fill the semantic gap between the knowledge graph and the language generation model. After obtaining the basic pseudo node, the basic pseudo node is connected according to the grouping by the hierarchical pseudo node to form a new subgraph composed of new triples:

[0075]

[0076] g' i ={t'1,t'2,…,t' j} (5)

[0077] Where t' j represents a new triple, g' i represents a new subgraph, represents the obtained basic pseudo node, r a is the relationship in the new triple, represents a hierarchical pseudo node, t'1, t'2, …, t' j represents each new triple.

[0078] Step S21c, these subgraphs are connected by a root pseudo node V to finally form a new global pseudo graph composed of pseudo triples.

[0079]

[0080] G'={T1,T2,…,T j} (7)

[0081] Where T j represents a pseudo triple, G' represents a global pseudo graph represents a hierarchical pseudo node, V represents a root pseudo node, T1, T2, …, T j represents a hierarchical pseudo node and the pseudo triple formed by the root pseudo node V, r a represents the relationship between them.

[0082] Step S22, dynamic graph aggregation:

[0083] After obtaining the reconstructed pseudo graph, the present application does not use the traditional message passing method between graph nodes to learn the graph features, but selects the attention mechanism to dynamically aggregate information between pseudo nodes to learn the whole graph.

[0084] The average of all basic pseudo nodes is directly calculated to aggregate the features of the nodes to obtain a global representation ε; then the words appearing in the context are sent to the language model encoder to obtain the context semantic encoding; finally, ε and TE are concatenated and sent to a fully connected network to obtain the query vector q, which is used for subsequent attention mechanism.

[0085]

[0086] TE = Encoder(context_words) (9)

[0087] q = FC(ε; TE) (10)

[0088] wherein ε represents the overall semantics of all triples, TE represents the context semantic encoding, and q represents the query vector, represents a basic pseudo node, |G'| represents the number of nodes of the newly generated global pseudo graph, Encoder represents a language model encoder, context_words represents words appearing in the context, and FC represents a fully connected neural network.

[0089] After obtaining the query vector q, the graph aggregation process is formally started, and the information of the basic pseudo node is aggregated to learn the hierarchical pseudo node

[0090]

[0091] wherein represents attention scoring, represents attention distribution, is a parameter matrix, q represents a query vector, represents a basic pseudo node; the attention update function, i.e., the process of aggregating the information of to ; T represents the transpose of a matrix, |g' i | represents the number of nodes in the subgraph g' i , and j represents the current sequence number of traversing the subgraph.

[0092] Finally, the information of the hierarchical pseudo node is aggregated to learn the root pseudo node V, and after the aggregation is completed, the global feature dynamically aggregated by ConceptNet according to the dialogue context content, i.e., the word-level embedding matrix U, is obtained.

[0093]

[0094] wherein denotes a basic pseudo node, q denotes a query vector, |G'| denotes the number of nodes of the newly generated global pseudo graph, G' denotes the global pseudo graph, denotes a hierarchical pseudo node, denotes attention scoring, W G' denotes a parameter matrix, denotes an attention distribution, j denotes a current sequence number for traversing the subgraph, T is a transpose of the matrix; Update(V) is an attention update function, that is, an attention distribution aggregation of information to V.

[0095] Step S3, the recommendation module of the enhanced knowledge graph:

[0096] Collect all items appearing in the dialogue context, and perform a lookup operation on the item embedding obtained by the R-GCN to obtain a context-related item embedding matrix I. Encode the item embedding matrix I and the context-related word embedding matrix U obtained by dynamic graph aggregation using a self-attention mechanism, and finally combine the two to obtain a user preference representation p u ,

[0097] p u = β·v + (1-β)·i (17)

[0098] β = σ(W gate [v;i]) (18)

[0099] where β denotes a weight calculated by a gate mechanism, W gate denotes a gate mechanism training parameter, σ is an activation function, v denotes a word embedding encoded by an attention mechanism, and i denotes an item embedding matrix encoded by an attention mechanism.

[0100] The similarity between the user preference representation and the item embedding is calculated using a Softmax function to obtain a series of scores, and then a ranking is generated to obtain a set of recommended items. Here, a cross-entropy loss function is set to learn the parameters:

[0101]

[0102] where P rec (k) denotes the recommendation probability of item k, the transpose matrix of the user preference representation, L rec denotes the training loss of the recommendation module, y kn denotes the actual recommendation result in the data set, i k denotes item k, N represents the total number of dialogue rounds of the data set, M represents the size of the item set; n is the current dialogue round number of the data set in one training, P (y | y1, …, yk) represents the recommendation probability of item k in the nth round of dialogue.

[0103] Step S4, enhance the dialogue module of the knowledge graph:

[0104] Use the Transformer as the language model of the dialogue module,

[0105] R n = LM decoder (R n-1 ,X,U,I) (21)

[0106] wherein X represents the embedding matrix of the encoder output, U, I represent the word-level and item-level embedding matrices obtained through the knowledge graph, R n represents the output of the decoder, LM decoder represents the language model decoder, R n-1 represents the output of the previous layer decoder.

[0107] The probability of the next token to be generated is calculated using the Softmax function, given the predicted subsequence y1, …, yk. i-1 , generate y i as the next token probability:

[0108] P gen (y i |y1,…,y i-1 )=Softmax(y i |R i ) (22)

[0109] wherein R i represents the output of the language model decoder.

[0110] Set a cross-entropy loss function to learn the parameters:

[0111]

[0112] wherein L gen represents the loss of the dialogue module, t represents the tth sentence, Z represents the number of training set sentences, s t represents the tth sentence to be generated, s1, …, s t-1 represent the dialogue sequence.

[0113] Experimental verification

[0114] To verify the effectiveness of the present application, tests are performed on the Redial dataset. HIT@k, MRR@k and NDCG@k (k = 10, 50) are used to evaluate the recommendation performance of the present application, and Bleu@k (k = 2, 3, 4) and Dist@k (k = 2, 3) are used to evaluate the dialogue performance of the present application. Among them, HIT@k, MRR@k, NDCG@k represent the accuracy and effectiveness of the recommendation. Bleu@k is used to evaluate the accuracy and quality of the generated text, and Dist@k represents the diversity of the generated text.

[0115] Table 1 Comparison results of recommendation aspects

[0116] Evaluation index HIT@10 HIT@50 MRR@10 MRR@50 NDCG@10 NDCG@50 SASRec 0.070 0.164 0.026 0.030 0.036 0.056 KBRD 0.173 0.339 0.069 0.076 0.093 0.130 KGSF 0.177 0.371 0.069 0.078 0.094 0.137 C2-CRS 0.207 0.409 0.086 0.094 0.114 0.161 TREA 0.186 0.379 0.079 0.088 0.110 0.162 The present invention 0.211 0.423 0.086 0.096 0.115 0.162

[0117] Table 2 Comparison results of dialogue aspects

[0118] Evaluation index Bleu-2 Bleu-3 Bleu-4 Dist-2 Dist-3 Transformer 0.0215 0.0114 0.0072 0.0334 0.0892 KBRD 0.0319 0.0131 0.0074 0.077 0.3053 KGSF 0.0330 0.0165 0.0104 0.1064 0.6372 C2-CRS 0.0251 0.0091 0.0040 0.0239 0.0445 TREA 0.0214 0.0094 0.0052 0.0637 0.1306 The present invention 0.0359 0.0187 0.0127 0.1519 0.8688

[0119] Table 1 is the comparison results of the recommendation aspects of the method of the present application and other advanced dialogue recommendation methods, and Table 2 is the comparison results of the dialogue aspects of the method of the present application and other advanced dialogue recommendation methods.

[0120] From Table 1, it can be seen that the method of the present application is superior to other methods in all recommendation indicators, and from Table 2, it can be seen that the method of the present application also performs best in the dialogue task compared with other methods. Therefore, using the method of aggregating knowledge graphs with dynamic graph aggregation can obtain a higher quality representation, and further generate a higher quality user preference representation, and also can generate more fluent, accurate and diversified replies.

[0121] Although the above describes the specific embodiments of the present application illustratively, so as to facilitate the understanding of the present application by those skilled in the art, it should be clear that the present application is not limited to the scope of the specific embodiments, and for those skilled in the art, it is obvious that various changes are within the spirit and scope of the present application defined and determined by the appended claims, and all the inventions utilizing the concept of the present application are within the scope of protection.

[0122] Each embodiment in the specification is described in a related manner, and the same and similar parts between each embodiment can be referred to each other, and each embodiment mainly explains the difference from other embodiments. Especially, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the related parts can be referred to the part of the method embodiment.

[0123] The above merely provides the preferred embodiments of the application, and not intended to limit the protection scope of the application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the application shall fall within the protection scope of the application.

Claims

1. A dialogue recommendation method based on dynamic graph aggregation, characterized in that, Includes the following steps: Step S1: GCN encodes a project-level knowledge graph; Step S2 involves dynamically aggregating and encoding a word-level knowledge graph. Existing triples in the knowledge graph are selected based on the dialogue context to further construct dynamic subgraphs, ultimately obtaining a global graph. Step S2 specifically includes: Step S21, dynamic graph construction; Step S22, dynamic graph aggregation; Step S3: Enhance the recommendation module of the knowledge graph; Step S4: Enhance the dialogue module of the knowledge graph; In step S1, a new dynamic knowledge graph is constructed based on the dialogue content to utilize the knowledge graph information, and the encoder of the language model is integrated to bridge the semantic gap between the knowledge graph and the language model: in, Represents a set of relations. Represents a node Relationships between nodes The set of adjacent nodes below, Represents the trainable parameter matrix. Indicates the relationship with neighboring nodes The relevant weight matrix, This represents the weight matrix related to itself. Represents the normalization factor. Represents a node In the next layer of representation, Represents a non-linear activation function. Represents a node In the representation of the current layer, Represents a node neighboring nodes Representation at the current layer.

2. The dialogue recommendation method based on dynamic graph aggregation according to claim 1, characterized in that, In step S21 Step S21a involves retrieving responses to the current dialogue through word matching and rule filtering, selecting all words appearing in the responses and other words connected to them, and then selecting all triples related to the current response to form several subgraphs, each containing several triples; then, each triple is flattened and fed into the language model encoder in the dialogue module to obtain basic pseudo-nodes. Each pseudo-node represents a triple: in, Indicates the triplet Perform a flattening operation to transform the triples into a text sequence. This represents the language model encoder in the dialogue module. They represent triples respectively. The head node, the relationships between nodes, and the tail node; These are the basic pseudo-nodes obtained; Step S21b introduces a language model encoder to learn the semantics of words mentioned in the current text. Simultaneously, it bridges the semantic gap between the knowledge graph and the language generation model, obtaining basic pseudo-nodes. These basic pseudo-nodes are then connected using hierarchical pseudo-nodes according to grouping, forming a new subgraph composed of new triples. in, Indicates the new triplet, Represents a new subgraph. This represents the obtained basic pseudo-node. It's a relation within the new triplet. Represents a hierarchical pseudo-node. Represent each new triplet; Step S21c, through the root pseudo-node By connecting the subgraphs, a completely new global pseudograph composed of pseudo triples is formed. in, Indicates a pseudo triplet. Represents a global pseudograph. Represents a hierarchical pseudo-node. Indicates the root pseudo-node. Represents hierarchical pseudo-nodes and root pseudo-node The pseudo triples formed by the connection, This indicates the relationship between them.

3. The dialogue recommendation method based on dynamic graph aggregation according to claim 2, characterized in that, In step S22, based on the global pseudo-graph obtained in step S21, an attention mechanism is selected to dynamically aggregate information among pseudo-nodes to learn the entire graph. The average value of all basic pseudo-nodes is directly calculated to aggregate the node features, thus obtaining the global representation. The words that appear in the context are fed into the language model encoder to obtain the contextual semantic encoding; finally, the... and The concatenated data is fed into a fully connected network to obtain the query vector. This is used for subsequent attention mechanisms; in, This represents the overall semantics of all triples. Represents context semantic encoding, Represents the query vector. Represents the basic pseudo-node, This indicates the number of nodes in the newly generated global pseudograph. Represents the language model encoder, Indicates words that have appeared in the context. This represents a fully connected neural network.

4. The dialogue recommendation method based on dynamic graph aggregation according to claim 1, characterized in that, In step S3, all items appearing in the dialogue context are collected and compared with those obtained through... Perform a lookup operation on the obtained item embeddings to obtain a context-dependent item embedding matrix. Using a self-attention mechanism to encode the item embedding matrix and the context-related word embedding matrix obtained through dynamic graph aggregation Finally, the two are combined through a gate mechanism to obtain a user preference representation. , in, This represents the weights calculated by the gate mechanism. Indicates the training parameters of the gate mechanism. This represents the activation function. This represents the word embeddings encoded by the attention mechanism. This represents the item embedding matrix after the attention mechanism is encoded.

5. The dialogue recommendation method based on dynamic graph aggregation according to claim 1, characterized in that, In step S4, a cross-entropy loss function learning parameter is set: in, This indicates the loss of the dialogue module. Indicates the first In short, Indicates the number of training sessions. Indicates the number to be generated One sentence. This indicates a dialogue sequence.

Citation Information

Patent Citations

  • Text question and answer model based on knowledge enhancement graph neural network

    CN114969278A

  • Characteristic enhancement-based graph contrast learning session recommendation method

    CN116796073A