A method for capturing dynamic causal relationships in emotional support conversations

By introducing the causal network model into the emotional support dialogue system to capture the dynamic causal relationship in the dialogue history, it solves the problem in the existing technology that the causal relationship is ignored, resulting in poor reply effects, and realizes context-related emotional support reply generation. Improved the relevance and effectiveness of responses.

CN118446230BActive Publication Date: 2024-09-27ARTIFICIAL INTELLIGENCE RES INST OF HEFEI COMPREHENSIVE NAT SCI CENT (ANHUI ARTIFICIAL INTELLIGENCE LAB)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410875580.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-02
Publication Date
2024-09-27
Estimated Expiration
2044-07-02

AI Technical Summary

Technical Problem

Existing emotional support dialogue systems ignore dynamic causal relationships when extracting external knowledge from dialogue history, resulting in generated emotional support replies that are not highly relevant to the context and have poor reply effects.

Method used

Propose a method to capture the dynamic causal relationship in emotional support dialogue. By feeding the conversation history into the causal network model, we use the context encoder, the multi-cue causal tracking module, the three-source information fusion module and the context-aware generator to construct the causal relationship. graph and trained to generate emotionally supportive responses relevant to the current context.

Benefits of technology

By mining the cause-and-effect relationships in the conversation flow, we help supporters better understand what is happening to the seeker and its impact, thereby promoting the generation of contextually relevant emotional support responses and improving the relevance and effectiveness of the responses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118446230B
    Figure CN118446230B
Patent Text Reader

Abstract

The present invention discloses a method for capturing dynamic causal relationships in emotional support dialogues, which relates to the field of artificial intelligence technology. The method transmits dialogue history to a causal network model to generate emotional support replies related to the current context; the causal network model includes a context encoder, a multi-clue causal tracking module, a three-source information fusion module and a context-aware generator; the method for capturing dynamic causal relationships in emotional support dialogues explores the dialogue flow from the perspective of causal relationships, helps to dig out clues hidden in the context, and enables supporters to better understand what is happening to the help-seeker, why this thing is happening and what the impact of the event is, thereby promoting the generation of emotional support replies related to the context.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence control technology, and in particular to a method for capturing dynamic causal relationships in emotion support dialogues. Background Art

[0002] The paper "Liu S, Zheng C, Demasi O, et al. Emotionally Supportive Dialogue System / / Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing" proposed the emotionally supportive dialogue task and constructed a corresponding corpus, ESConv. In addition to generating emotionally supportive responses, the emotionally supportive dialogue task also provides eight support strategies, focusing on strategy selection to guide the generation of emotionally supportive responses.

[0003] "Tu Q, Li Y, Cui J, et al. MISC: A Hybrid Strategy Perception Model for Emotion-Supported Conversation Based on COMET / / Proceedings of the 60th Annual Conference of the Association for Computational Linguistics" uses a hybrid strategy to guide response generation. "Peng W, HuY, Xing L, et al. Global Control, Local Understanding: A Global-to-Local Hierarchical Graph Network for Emotion-Supported Conversation[J]" builds a graph to model the hierarchical relationship between global reasons and local intentions.

[0004] "Peng W, Qin Z, Hu Y, et al. Fado: Feedback-Aware Dual Control Network for Emotion-Supporting Dialogue. Based on Knowledge System" takes into account the feedback of the help-seeking party in dialogue systems and designs a feedback-aware loss function. "Deng Y, Zhang W, Yuan Y, et al. Knowledge-Enhanced Hybrid-Initiative Dialogue System for Emotion-Supporting Dialogue" retrieves knowledge from a pre-constructed mental health graph and evaluates the dialogue system from a hybrid-initiative perspective. "Zhao W, ZhaoY, Wang S, et al. TransESC: Smoothing Emotion-Supporting Pairs via Turn-Level State Transition" focuses on the transitional transformations of emotion transition, strategy transition, and semantic transition.

[0005] Many previous works have used external knowledge extracted from conversation histories to model the interlocutors' mental states. However, these approaches ignore the dynamic causal relationships within the conversation flow inherent in this external knowledge, resulting in poor contextual relevance and ineffective responses. Summary of the Invention

[0006] Based on the technical problems existing in the background technology, the present invention proposes a method for capturing dynamic causal relationships in emotional support conversations for generating context-related emotional support replies.

[0007] This paper proposes a method to capture the dynamic causal relationship in emotional support conversations, feeding the conversation history into a causal network model to generate emotional support replies relevant to the current context;

[0008] The causal network model includes a context encoder, a multi-threaded causal tracking module, a three-source information fusion module, and a context-aware generator. The training of the causal network model is as follows:

[0009] S1. Build a training set based on multiple sets of conversation histories and feed each set of conversation histories into the causal network model.

[0010] S2. Add a ] tag, connect all the utterances in the conversation history as the input of the context encoder to obtain contextual semantic information , and extract contextual semantic information All ] The corresponding output vector gets the representation of all the words in the conversation history ;

[0011] S3, construct a causal graph and identify causal absorption based on the multi-thread causal tracing module;

[0012] S31. Constructing a causal diagram , the words are expressed Input to the cause-effect diagram Update the strategy prediction probability and sentiment prediction probability , the strategy prediction probability and Strategy Matrix The product is the mixed strategy distribution vector , for the mixed strategy distribution vector and contextual semantic information Perform cross-attention operations to obtain strategy selection information ;

[0013] S32. Cause and effect diagram The update method is integrated into the Transformer structure to represent the discourse As the initialization representation of all nodes at layer 0, input into the causal graph In, get Updated utterance representations of all nodes after layer update , and will update the utterance representation Output final utterance representation based on Transformer , the final word is expressed and contextual semantic information Perform cross-attention operations to obtain causal-guided tracking information ;

[0014] S4. Fusion of strategy selection information through gate fusion mechanism , contextual semantic information , causal tracing information , get multi-source information ;

[0015] S5. Use Sentence-Bert to encode the situation descriptions in the training set to obtain word situation representations , representing the word context and word vectors Proportional Fusion to get word vector representation , based on the word before the word Word vector representation of and multi-source information , generating the words The conditional probability distribution of , the context is described as a summary of a conversation, which includes one or more utterances, and word vectors is the vector representation of a word in the discourse;

[0016] S6: Constructing loss function , to train and adjust the causal network model.

[0017] Furthermore, the causal diagram ,in, represents the point set, represents the edge set, represents a set of relations, Represents edge attribute set, point set Nodes in Represents discourse , Edge Represents discourse and discourse The causal connection between China-U.S. relations Represents discourse and discourse The causal relationship between Middle edge attributes Quantified discourse and discourse The causal relationship between Indicates the first A word, Indicates the first Discourse, Node Indicates the nodes.

[0018] Furthermore, set the relationship set There are four types of causal relationships, including causal relationship, self-influence relationship, mutual influence relationship and self-loop influence relationship;

[0019] Edge attribute set is generated as follows:

[0020] Obtain causal quantitative representation between discourses through the COMET model pre-trained on the ATOMIC dataset , the input format of the COMET model is <Causal relationship>, relation set The cause relationship, self-influence relationship, mutual influence relationship and self-loop influence relationship correspond to the xIntent, xWant, oWant and xEffect relationships in the ATOMIC dataset respectively. The output of the hidden state corresponding to the last layer <causal relationship> of the COMET model is recorded as the causal quantitative representation, which is used as the edge attribute set. .

[0021] Furthermore, in step S32, the causal diagram It is integrated into the Transformer structure, specifically replacing the self-attention module in the Transformer structure with the MHRGAT operation, which is a causal graph. The update method is as follows:

[0022] Discriminative causal absorption:

[0023]

[0024] in, It is words The vector representation of yes Through cause-effect diagram The updated vector representation is, It is words The vector representation of , σ is the activation function, In the relationship The transformation matrix under is a node and neighbor nodes In relationship The weight under Indicates the nodes, Representation node In relationship The set of neighbor nodes under ;

[0025] Weight The calculation formula is as follows:

[0026]

[0027] in, and Indicates that they come from nodes and In relationship The query and key value below, Indicates that in the relationship The transformation matrix under Representation node and In relationship The following edge attributes;

[0028] The weight Normalize to ensure =1;

[0029] Apply multiple attention heads in the attention mechanism, Expressed as:

[0030]

[0031] in, represents the vector concatenation operation under different attention heads, K is the total number of heads, ;

[0032] The above process is recorded as:

[0033]

[0034] in, express operate.

[0035] Furthermore, the strategy predicts the probability and sentiment prediction probability is generated as follows:

[0036]

[0037]

[0038] in, express Through cause-effect diagram The updated vector representation is, represents the activation function, and are the weights and biases in the fully connected layer used to learn the policy labels, and are the weights and biases in the fully connected layer used to learn the sentiment labels.

[0039] Furthermore, in step S6, the loss function Including generation losses , Strategy prediction loss and sentiment prediction loss , the generation loss The strategy predicts the loss by summing the conditional probability distribution of the first T words. By strategy tag and strategy prediction probability Calculate the cross entropy to get the sentiment prediction loss By emotion label and sentiment prediction probability Calculate the cross entropy to get

[0040] Furthermore, the loss function The build is as follows:

[0041]

[0042]

[0043]

[0044]

[0045] in, 、 、 Represent the scale factors respectively.

[0046] Furthermore, in step S4, the multi-source information The generation process is as follows:

[0047]

[0048]

[0049] in, represents the activation function, represents the product, is a learnable gating coefficient, a constant, given by 、 and The concatenated vector of is passed through a fully connected layer. and Represent the weights and biases in the fully connected layer respectively.

[0050] Furthermore, in step S5, the word vector representation is generated as follows:

[0051]

[0052]

[0053] in, is and The concatenated vector of is the trainable parameter obtained by learning the fully connected layer. represents the product, and Generate The weights and biases in the fully connected layers of .

[0054] The advantage of the method for capturing dynamic causal relationships in emotional support conversations provided by the present invention is that: the method for capturing dynamic causal relationships in emotional support conversations provided in the structure of the present invention, exploring the conversation flow from the perspective of causal relationships, helps to dig out hidden clues in the context, and enables supporters to better understand what is happening to the person seeking help, why this thing is happening and what the impact of the event is, thereby promoting the generation of emotional support responses relevant to the context. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 It is a schematic diagram of the process of the present invention;

[0056] Figure 2 This is a structural diagram of the causal network model. DETAILED DESCRIPTION

[0057] The technical solutions of the present invention are described in detail below through specific embodiments. Many specific details are set forth in the following description to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways than those described herein, and those skilled in the art may make similar modifications without departing from the scope of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0058] like Figure 1 and 2 As shown, the present invention proposes a method for capturing dynamic causal relationships in emotional support conversations, which feeds the conversation history into a causal network model to generate emotional support replies relevant to the current context;

[0059] The causal network model includes a context encoder, a multi-threaded causal tracking module, a three-source information fusion module, and a context-aware generator. The training of the causal network model is as follows:

[0060] S1. Build a training set based on multiple sets of conversation histories and feed each set of conversation histories into the causal network model.

[0061] S2. Each utterance in each set of dialogue history Add a ] tag, connect all the utterances in the conversation history as the input of the context encoder to obtain contextual semantic information , and extract contextual semantic information All ] The corresponding output vector gets the representation of all the words in the conversation history ;

[0062] Assume that history has A sentence is encoded by the context encoder to obtain the overall representation of the conversation history, which is recorded as contextual semantic information ;

[0063]

[0064] in, represents the context encoder, Indicates the A discourse.

[0065] S3, construct a causal graph and identify causal absorption based on the multi-thread causal tracing module;

[0066] S31. Constructing a causal diagram , the words are expressed Input to the cause-effect diagram Update the strategy prediction probability and sentiment prediction probability , the strategy prediction probability and Strategy Matrix The product is the mixed strategy distribution vector , for the mixed strategy distribution vector and contextual semantic information Perform cross-attention operations to obtain strategy selection information ;

[0067] The causal diagram is denoted as ,in, represents the point set, represents the edge set, represents a set of relations, Represents edge attribute set, point set Nodes in Represents discourse , Edge Represents discourse and discourse The causal connection between China-U.S. relations Represents discourse and discourse The causal relationship between Middle edge attributes Quantified discourse and discourse The causal relationship between Indicates the first A word, Indicates the first Discourse, Node Indicates the nodes;

[0068] In the causal diagram, set the relationship set There are four types of causal relationships in the context of causality: causal relationship, self-influence relationship, mutual influence relationship, and self-loop influence relationship. The detailed definitions of the four relationships are shown in Table 1:

[0069] Table 1 Causal relationship definition table

[0070]

[0071] For edge attribute sets , which is generated as follows:

[0072] Obtain causal quantitative representation between discourses through the COMET model pre-trained on the ATOMIC dataset , the input format of the COMET model is <Causality>, the COMET model corresponds to an existing common sense reasoning model COMET, which uses the common sense reasoning model COMET to extract the user's psychological state implicit in the conversation history, so as to better understand the meaning of the user's expression and the current situation. The causal relationship, self-influence relationship, mutual influence relationship, and self-loop influence relationship correspond to the xIntent, xWant, oWant, and xEffect relationships in the ATOMIC dataset, respectively. The ATOMIC dataset is a large-scale knowledge graph that contains commonsense knowledge about everyday events and behaviors. xIntent describes the intention or motivation of a character (x) to perform an action, xWant describes the expectation or desire of a character (x) after performing an action, oWant describes the expectation or desire of other people (o) in the event other than the protagonist (x) after the event, and xEffect describes the effect or impact of a character (x) after performing an action.

[0073] The output of the hidden state corresponding to the last layer of the COMET model <causality> is recorded as the causal quantization representation, which is used as the edge attribute set ;

[0074]

[0075] in, represents the cross-attention operation.

[0076] S32. Cause and effect diagram The update method is integrated into the Transformer structure to represent the discourse As the initialization representation of all nodes at layer 0, input into the causal graph In, get Updated utterance representations of all nodes after layer update , and will update the utterance representation Output final utterance representation based on Transformer , the final word is expressed and contextual semantic information Perform cross-attention operations to obtain causal-guided tracking information ;

[0077] In the cause-effect diagram It is integrated into the Transformer structure, specifically replacing the self-attention module in the Transformer structure with the MHRGAT operation, which is a causal graph. The updating method of step S31 is to represent the speech Input to the cause-effect diagram In step S32, the speech is updated and the speech is represented As the initialization representation of all nodes at layer 0, input into the causal graph In the cause-effect diagram The processing of output data is the same, specifically:

[0078] Discriminative causal absorption:

[0079]

[0080] in, It is words The vector representation of yes Through cause-effect diagram The updated vector representation is, It is words The vector representation of , σ is the activation function, In the relationship The transformation matrix under is a node and neighbor nodes In relationship The weight under Indicates the nodes, Representation node In relationship The set of neighbor nodes under ;

[0081] Weight The calculation formula is as follows:

[0082]

[0083] and The calculation method of is as follows, where and It is the query core and key-value core;

[0084]

[0085]

[0086] Indicates that in the relationship The transformation matrix under Representation node and In relationship The following edge attributes;

[0087] The weight Normalize to ensure =1; at this time the weight It is expressed as follows:

[0088]

[0089] in, Indicates that in the division relationship In addition, about the node Other causal relationships, Representation node In relationship The set of neighbor nodes under Representation node and neighbor nodes In relationship The weight below.

[0090] Apply multiple attention heads in the attention mechanism, Expressed as:

[0091]

[0092] Among them, represents the vector concatenation operation under different attention heads, K is the total number of heads, ;

[0093] The above process is recorded as:

[0094]

[0095] in, Indicates MHRGAT operation, is the initialization representation of all nodes in the graph at layer 0, go through After the layer is updated, the representation of all nodes in the graph is recorded as .

[0096] Based on the above causal diagram Update method, strategy prediction probability and sentiment prediction probability is generated as follows:

[0097]

[0098]

[0099] in, express Through cause-effect diagram The updated vector representation is, represents the activation function, and are the weights and biases in the fully connected layer used to learn the policy labels, and are the weights and biases in the fully connected layer used to learn the sentiment labels.

[0100] In the traditional graph update process, there is an over-smoothing problem, which leads to insufficient information extraction. This embodiment integrates the causal graph-based update method into the Transformer structure to enhance the extraction of discriminative information in the graph. Specifically, the self-attention module in the Transformer structure is replaced by the MHRGAT operation proposed above. The output is recorded as :

[0101]

[0102] in, Represents the Transformer structure.

[0103] Causal tracing information Generates the following:

[0104]

[0105] in, represents the cross-attention operation.

[0106] S4. Fusion of strategy selection information through gate fusion mechanism , contextual semantic information , causal tracing information , get multi-source information ;

[0107]

[0108]

[0109] in, represents the activation function, represents the product, is a learnable gating coefficient, given by 、 and The concatenated vector of is passed through a fully connected layer. and Represent the weights and biases in the fully connected layer respectively.

[0110] S5. Use Sentence-Bert to encode the situation descriptions in the training set to obtain word situation representations , representing the word context and word vectors Proportional Fusion to get word vector representation , based on the word before the word Word vector representation of and multi-source information , generating the words The conditional probability distribution of , the context is described as a summary of a conversation, which includes one or more utterances, and word vectors is the vector representation of a word in the discourse;

[0111] In order to encourage the model to generate context-related responses rather than safe responses, this example uses Sentence-Bert to encode the context descriptions in the dataset, denoted as , Sentence-BERT is a twin network based on the pre-trained BERT, which can obtain a semantically meaningful paragraph vector. and word vectors by Proportional fusion, where Depend on and The concatenation vector of is a trainable parameter learned through the fully connected layer;

[0112]

[0113]

[0114] in, represents the product, and Generate The weights and biases in the fully connected layers of .

[0115] Target response Depend on Words The conditional probability distribution of Expressed as:

[0116]

[0117] in, represents a generator, Specifically indicates The word before the word,

[0118] Specifically indicates words, , It is multi-source information.

[0119] S6: Constructing loss function , to train and adjust the causal network model, the loss function Including generation losses , Strategy prediction loss and sentiment prediction loss , the generation loss The strategy predicts the loss by summing the conditional probability distribution of the first T words. By strategy tag and strategy prediction probability Calculate the cross entropy to get the sentiment prediction loss By emotion label and sentiment prediction probability Calculate the cross entropy;

[0120] Loss Function The build is as follows:

[0121]

[0122]

[0123]

[0124]

[0125] in, 、 、 Represent the scale factors respectively.

[0126] The following uses both automatic evaluation indicators and manual evaluation indicators to evaluate the performance of the causal network model of this embodiment and other models.

[0127] Through steps S1 to S6, exploring the conversation flow from the perspective of causality helps to unearth hidden clues in the context and enables supporters to better understand what is happening to the help-seeker, why it is happening, and what the impact of the event is, thereby promoting the generation of emotional support responses that are relevant to the context.

[0128] (A1) The following indicators are set for automatic evaluation: (1) Perplexity Level (PPL): The PPL indicator evaluates the quality of the generated responses. The smaller the PPL value, the more natural and stable the generated responses are. (2) Evaluation indicators BLEU-n (B-1, B-2, B-3, B-4): This indicator measures the overlap between the generated responses and the true responses. The higher the BLEU value, the closer the generated responses are to the true responses. B-1, B-2, B-3, and B-4 are the specific evaluation indicators corresponding to n being 1, 2, 3, and 4 in the evaluation indicator BLEU-n, respectively. (3) Evaluation indicators Distinct-n (D-2, D-3): This indicator measures the diversity of the generated responses. D-2 and D-3 are the specific evaluation indicators obtained by n being 2 and 3 in the evaluation indicator Distinct-n, respectively.

[0129] Table 2 shows the automatic evaluation results of the causal network model of this embodiment on the dataset. Table 2 clearly demonstrates that the causal network model outperforms the baseline model in most metrics. The causal network model achieved the highest scores in all BLEU-n metrics, indicating that the responses generated by the causal network model are highly similar to the factual responses at all n-gram granularities. Furthermore, the D-3 metric in Distinct-n demonstrates the diversity of responses generated by the causal network model. Furthermore, the causal network model secured second place in the policy prediction accuracy (ACC).

[0130] Table 2 Manual evaluation results

[0131]

[0132] In Table 2, BlenderBot and KEMI are both existing models. KEMI (Knowledge-enhanced Mixed-initiative Dialogue System) is a dialogue model that integrates knowledge enhancement and mixed-initiative analysis. TransESC (TransESC: Smoothing Emotional Support Conversation via Turn-LevelState Transition) is a fine-grained emotional support dialogue framework that includes three types of fine-grained emotional support: semantic transformation, strategy transformation, and emotional transformation.

[0133] (A2) We remove three important components from the causal network model to explore their respective roles in the causal network model: edge attributes for quantifying causal relationships, an improved structure for promoting the absorption of discriminative causal relationships, and a three-source information fusion module for merging multi-source information. The results of the ablation experiment are shown in Table 3.

[0134] Table 3 Ablation experiment results

[0135]

[0136] It can be seen from Table 3 that the absence of each part leads to a certain degree of decline in the experimental results, which means that each module in the causal network model of this embodiment has contributed to the excellence of the experimental results and is inseparable.

[0137] (A3) The causal network model was validated using a test set. Table 4 shows an example of a conversation fragment from the test set. Given the conversation history, the person seeking help discovered that their former friend was talking to their current friend behind their back, and they became furious. In this case, the causal network model in this embodiment first drew on similar personal experiences to soothe the person seeking help's anger. Then, the phrase "someone took advantage of you" corresponds to the phrases "my former friend who spoke ill of me behind my back" and "I sued the other party in court" in the previous text, and is also very similar to the actual response, "two people disrespected you." This demonstrates that by mining the clues and hints provided by causal relationships in the conversation flow, the model can generate contextually relevant, emotionally supportive responses.

[0138] Table 4 Cases

[0139]

[0140] The above description is only a preferred specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with the technical field, within the technical scope disclosed by the present invention, who makes equivalent replacements or changes based on the technical solution and inventive concept of the present invention, should be covered by the scope of protection of the present invention.

Claims

1. A method for capturing dynamic causal relationships in emotional support conversations, characterized in that Feeding the conversation history into a causal network model to generate sentiment-supportive responses relevant to the current context; The causal network model includes a context encoder, a multi-clue causal tracking module, a three-source information fusion module and a context-aware generator. The training of the causal network model is as follows: S1. Build a training set based on multiple groups of dialogue histories and feed each group of dialogue histories into the causal network model. S2, add a before each utterance in each set of dialogue history ] tag, connect all the utterances in the conversation history as the input of the context encoder, and obtain the contextual semantic information , and extract contextual semantic information All ] The corresponding output vector obtains the representation of all the words in the group of dialogue history ; S3, constructing a causal graph, and determining causal relationship absorption based on a multi-thread causal tracking module, step S3 specifically includes steps S31 to S32; S31. Constructing a causal graph , the words are expressed Input to the cause-effect diagram Update it and get the strategy prediction probability Prediction probability with emotion , the strategy prediction probability and Strategy Matrix The product is the mixed strategy distribution vector , for the mixed strategy distribution vector With contextual semantic information Perform cross-attention operations to obtain strategy selection information ; S32. Cause and effect diagram The update method is integrated into the Transformer structure to represent the discourse As the initialization representation of all nodes at layer 0, it is input into the causal graph In, get Updated utterance representation of all nodes after layer update , and the utterance representation will be updated Output final utterance representation based on Transformer , the final words are expressed With contextual semantic information Perform cross-attention operations to obtain causal-oriented tracking information ; S4. Fusion of strategy selection information through gate fusion mechanism , contextual semantic information , causal-oriented tracking information , get multi-source information ; S5. Use Sentence-Bert to encode the situation descriptions in the training set to obtain word situation representations , representing the word context and word vectors By proportion Fusion to get word vector representation , based on word before word The word vector representation of and multi-source information , generating Words The conditional probability distribution of , the context is described as a summary of a conversation, which includes one or more utterances, and the word vector is the vector representation of a word in the discourse; S6: Constructing loss function , to train and adjust the causal network model.

2. The method for capturing dynamic causal relationships in emotional support dialogues according to claim 1, characterized in that: Cause and effect diagram ,in, represents the point set, represents the edge set, represents a set of relations, Represents edge attribute set, point set Nodes in Represents the discourse , The edge Represents the discourse and discourse The causal connection between China Relations Represents the discourse and discourse The causal relationship between Middle edge attributes Quantified discourse and discourse The causal relationship between Indicates the first A word, Indicates the first Discourse, Node Indicates nodes.

3. The method for capturing dynamic causal relationships in emotional support dialogues according to claim 2, characterized in that: Setting Relationship Sets There are four types of causal relationships, including causal relationships, self-influence relationships, mutual influence relationships, and self-loop influence relationships; Edge attribute set The generation is as follows: Obtain causal quantitative representation between discourses through the COMET model pre-trained on the ATOMIC dataset , the input format of the COMET model is <Causal Relationship>, Relationship Set The cause relationship, self-influence relationship, mutual influence relationship and self-loop influence relationship correspond to the xIntent, xWant, oWant and xEffect relationships in the ATOMIC dataset respectively. The output of the hidden state corresponding to the last layer <causality> of the COMET model is recorded as the causal quantitative representation, which is used as the edge attribute set. .

4. The method for capturing dynamic causal relationships in emotional support dialogues according to claim 2, characterized in that: In step S32, the cause-effect diagram It is integrated into the Transformer structure, specifically replacing the self-attention module in the Transformer structure with the MHRGAT operation, where the MHRGAT operation is a causal graph. The update method is as follows: Discriminative causal absorption: in, It is discourse The vector representation of yes Cause and effect diagram The updated vector representation is, It is discourse The vector representation of is the activation function, Is in relationship The transformation matrix under Is a node and neighbor nodes In relationship The weight under Indicates nodes, Representation Node In relationship The set of neighbor nodes under Weight The calculation formula is as follows: in, and Indicates that they come from nodes and In relationship The query and key value below, Indicates in relationship The transformation matrix under Representation Node and In relationship The following edge attributes; Weight Normalize to ensure =1; Apply multiple attention heads in the attention mechanism. It is expressed as: in, represents the vector concatenation operation under different attention heads, K is the total number of heads, ; The above process is recorded as: in, Indicates MHRGAT operation, Cause and Effect Diagram The initialization representation of all nodes in layer 0 is: for go through The updated utterance representations of all nodes after the layer is updated.

5. The method of capturing dynamic causal relationships in emotional support dialogues according to claim 4, characterized in that: Strategy prediction probability Prediction probability with emotion The generation is as follows: in, express Cause and effect diagram The updated vector representation is, represents the activation function, and are the weights and biases in the fully connected layer used to learn the policy labels, and are the weights and biases in the fully connected layer used to learn the sentiment labels.

6. The method of capturing dynamic causal relationships in emotional support dialogues according to claim 5, characterized in that: In step S6, the loss function Including generation loss , Strategy prediction loss and sentiment prediction loss , the generation loss The conditional probability distribution of the first T words is accumulated, and the strategy predicts the loss By strategy tag and strategy prediction probability Calculate the cross entropy to get the sentiment prediction loss By emotion tag and sentiment prediction probability Calculate the cross entropy.

7. The method of capturing dynamic causal relationships in emotional support dialogues according to claim 6, characterized in that: Loss Function The build is as follows: in, , , Represent the scale factors respectively.

8. The method of capturing dynamic causal relationships in emotional support dialogues according to claim 1, characterized in that: In step S4, the multi-source information The generation process is as follows: in, represents the activation function, represents the product, Is , and The concatenated vector of is passed through a fully connected layer to obtain the gating coefficient, and Respectively represent the generation The weights and biases in the fully connected layers of .

9. The method of capturing dynamic causal relationships in emotional support dialogues according to claim 1, characterized in that: In step S5, the word vector representation The generation is as follows: in, Is and The concatenated vector of is the trainable parameter obtained by learning the fully connected layer. represents the product, and Generate The weights and biases in the fully connected layers of .