Dialogue sentiment-reason pair extraction method based on dual-channel graph encoder network
By collaboratively modeling the long-term temporal dependencies and local implicit cues of dialogue using a dual-channel graph encoder network, the problem of insufficient accuracy in extracting sentiment-cause pairs in existing technologies is solved, achieving more accurate and stable sentiment-cause pair recognition.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING TECH & BUSINESS UNIV
- Filing Date
- 2026-03-06
- Publication Date
- 2026-06-09
AI Technical Summary
Existing methods struggle to simultaneously and effectively capture the complex global temporal logic and local implicit causal cues in dialogues, resulting in limited accuracy in extracting dialogue sentiment-cause pairs.
A dual-channel graph encoder network is adopted to collaboratively model the long-term temporal dependence and local implicit cues of dialogue through global structure learning channels and local feature extraction channels. The feature weighting fusion is performed through an adaptive gating fusion module, and finally, the sentiment-cause pair matching score is performed based on the fused features.
It improves the accuracy and robustness of extracting sentiment-cause pairs in dialogues, and achieves efficient recognition of sentiment-cause pairs in complex dialogues.
Smart Images

Figure CN122174991A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of dialogue sentiment computing and natural language processing technology, and specifically discloses a method for extracting dialogue sentiment-cause pairs based on a dual-channel graph encoder network. Background Technology
[0002] In the task of analyzing the causes of emotions in dialogue, it is necessary to identify the utterances expressing emotions and their corresponding causal utterances from the dialogue text, forming emotion-cause pairs. Existing methods are mostly based on sequence or simple graph structures for modeling, which makes it difficult to effectively capture both the complex global temporal logic and local implicit causal clues in dialogue. Specifically, the emotional-cause relationships in dialogue often span multiple utterances and have long-term dependencies; at the same time, the generation of emotions often depends on subtle, indirect local contextual interactions in the dialogue. Existing single-structure models are insufficient in taking into account these two characteristics, resulting in limited accuracy in extracting emotion-cause pairs in complex dialogues. Summary of the Invention
[0003] The purpose of this invention is to provide a dialogue sentiment-cause pair extraction method based on a dual-channel graph encoder network to solve the technical problem that existing technologies are unable to effectively model long-term temporal dependencies across multiple utterances in a dialogue and capture local implicit emotional causal cues, thereby achieving more accurate and robust sentiment-cause pair extraction.
[0004] This invention provides a method for extracting dialogue sentiment-cause pairs based on a dual-channel graph encoder network, comprising the following steps:
[0005] The input dialogue is preprocessed, transforming each utterance into a utterance-level feature vector. A directed utterance graph and its adjacency matrix are constructed based on the utterance order and speaker identity, and the edge types in the directed utterance graph are identified. The utterance-level feature vectors and adjacency matrices are input in parallel to the global structure learning channel and the local feature extraction channel. The global structure learning channel, based on a directed acyclic graph and graph autoencoder structure, models the long-term temporal dependencies of the dialogue to output global structural features. The local feature extraction channel, based on a variational autoencoder framework, infers latent variables based on the aggregated features of different edge types and dynamically modulates the aggregated weights of different edge types through the inferred latent variables to capture local implicit cues and output local latent features. The global structural features and local latent features are input into an adaptive gating fusion module, which performs weighted fusion through learnable gating weights and adjustable balance parameters corresponding to different channels to obtain the final fused feature representation. Based on the fused feature representation, the matching scores of all candidate sentiment utterances and cause utterances in the dialogue are calculated through a fully connected layer. The final sentiment cause pairs are then selected and output based on the matching scores.
[0006] The beneficial technical effects of the present invention are as follows:
[0007] By using parallel global structure learning channels and local feature extraction channels, it is possible to collaboratively model the long-term temporal dependencies and local implicit cues of dialogue; through an adaptive gating fusion module, effective complementarity and weighted integration of dual-channel features are achieved; finally, pairing scoring is performed based on the fused features, which improves the accuracy and robustness of extracting sentiment-cause pairs from complex dialogues. Attached Figure Description
[0008] Figure 1 A dialogue sentiment-cause pair extraction method based on a dual-channel graph encoder network is described. Detailed Implementation
[0009] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0010] like Figure 1 As shown, the dialogue sentiment-cause pair extraction method based on a dual-channel graph encoder network of this invention proceeds as follows:
[0011] Step 1: In the preprocessing stage, each utterance in the dialogue is first marked with a special tag (e.g., <s> and< / s> The tokens are then wrapped and concatenated into a long sequence. The RoBERTa-base model's tokenizer is used for word segmentation, and the start position of each utterance is recorded. Intelligent truncation (prioritizing densely packed segments) and padding are performed based on the sequence length to generate a TokenID sequence and an attention mask. The processed sequence is then input into the RoBERTa-base model to obtain the context vector for each token. Based on the recorded utterance start positions, the vector at each utterance start position is used as a representative of that utterance to form a utterance-level feature matrix. Each utterance is treated as a node. Directed edges are established from the predecessor node to the current node based on the order in which the utterances appear in the dialogue. Speaker constraints are also introduced, such as limiting the size of the predecessor utterance window for the same speaker. Finally, the corresponding adjacency matrix is generated. .
[0012] Step 2: In the dual-channel graph encoding learning stage, the utterance features and the graph's adjacency matrix are input in parallel into two independent graph learning channels:
[0013] Step 2.1: The global structure learning channel employs a graph autoencoder based on a directed acyclic graph (DAG). Its core task is to model long-term dependencies across multiple rounds and the global information flow following temporal logic in the dialogue. and The input global structure learning channel uses a graph autoencoder containing a 3-layer gated recurrent unit (BiGRU) and a graph attention network (GAT). The global structure encoding channel propagates information along the natural flow of the dialogue, modeling long-range dependencies and global structure. Each dialogue segment is represented as a directed acyclic graph G = (V, E), where nodes... ∈V is a discourse, a directed edge Encoding time The relationship between the speaker and the content of the causal constraint:
[0014] (1)
[0015] Each represents a speech The time sequence number that appears in the dialogue.
[0016] X and A are input into the Global Structure Learning (DAG-AE) channel, which uses a graph autoencoder containing a 3-layer gated recurrent unit (BiGRU) and a graph attention network (GAT). At each encoding layer... First, a graph attention network (GAT) is used to calculate the set of predecessor nodes of the target node j based on the adjacency matrix A. Attention weights for each node i Subsequently, the features of the predecessor nodes are weighted and summed according to these weights, and the aggregated features are then compared with the current features of the target node itself. The data is then fed into a Bidirectional Gated Loop Unit (BiGRU) for updating.
[0017] (2)
[0018] express The feature vector of node i in the layer.
[0019] Finally, the outputs of all coding layers of the model are concatenated to obtain... The concatenated representation is processed through an attention pooling layer and a multilayer perceptron to obtain the final global structural features. :
[0020] (3)
[0021] (4)
[0022] Where E represents the pooled feature representation, MLP represents a multilayer perceptron, and AttnPool represents the attention pooling operation. This represents the decoding function or the corresponding processing layer. H is the concatenation matrix of the output features of all coding layers.
[0023] Step 2.2: In the Variational Modulation-Based Local Feature Extraction (EA-VAE) channel, the edges defined by the adjacency matrix are first divided into several predefined types (e.g., intra-utterance edges, inter-utterance edges, speaker-external edges, etc.) based on utterance attributes and speaker identity. This channel extracts utterance features... And these edge types as input. Specifically, for each edge type The model calculates the attention weights between the target node and its neighboring nodes through an attention mechanism. The features of neighboring nodes are aggregated based on the weight to obtain the preliminary aggregated features of this edge type.
[0024] Subsequently, based on the preliminary aggregated features of all edge types, the channel infers the latent variables. The posterior probability distribution parameters, including the mean and variance The reparameterization technique is used to sample from this posterior distribution. Specific values:
[0025] (5)
[0026] in, Let I be a random noise vector sampled from a standard normal distribution, and let I be the identity matrix. This represents an exponential function with the natural constant e as its base. It represents the Hadamardi (or Hadama) stack.
[0027] Next, based on latent variables The value of is dynamically calculated for each edge type using a preset transformation function (including matrix inversion). :
[0028] (6)
[0029] in, It is the identity matrix. This is a preset mask matrix.
[0030] Then use Features of nodes in the previous layer Perform the transformation and update to obtain the node features under this edge type. Next, the updated features for all edge types are summed and then passed through the ELU activation function to obtain the output of the current coding layer. :
[0031] (7)
[0032] These represent the node features of the l-th layer under the speaker-outer edge, utterance-inner edge, and utterance-inter-edge types, respectively. This is a learnable bias term.
[0033] To improve training stability, a gated residual connection mechanism is introduced between adjacent coding layers, which adaptively fuses the output of the current layer using learnable gate vectors. Input from the previous layer :
[0034] (8)
[0035] Finally, the output features of the last encoder layer are... The input is fed into a multilayer perceptron (MLP), and the output is the final local latent features. . For learnable gated vectors; This is the Sigmoid activation function.
[0036] Step 3: The feature fusion stage employs an adaptive gating fusion mechanism to integrate global structural features. and local potential features The complementary advantages of this mechanism are first achieved through the Sigmoid activation function. Calculate their respective gating weights Then, weighted fusion is performed. This is achieved through Hadama accumulation. Perform feature scaling and introduce adjustable parameters. To balance the contributions of global and local features, the final fused feature representation is obtained. :
[0037] (9)
[0038] in, , This is an adjustable parameter. , These are the gating weight vectors for the global and local channels, respectively.
[0039] This dual-channel design is more effective than the single-channel model because it can capture both long-range context and potential local cues simultaneously.
[0040] Step 4: Pairing and Extraction Stage for All Perform relative position-aware matching on each candidate pair. Extract its fusion features And calculate the relative position embedding Furthermore, to accommodate situations where dialogue scenarios may involve non-adjacent or non-simultaneous occurrences, a Gaussian kernel-based approach is introduced. The soft-position prior. The final paired feature representation. It is constructed by splicing and fusing features and positional embedding. This feature is then processed through a two-layer... Calculate matching score This is used to assess the probability that the candidate pair constitutes a valid sentiment-causal relationship:
[0041] (10)
[0042] in, and For a trainable weight matrix, and As a bias term, and using As an activation function.
[0043] Step 5: Model training employs a multi-objective optimization strategy, using... The optimizer controls the training process using early stopping. The model's total loss function... It consists of three weighted factors: predicted loss Potential alignment loss And sorting loss .in, KL divergence is employed to regularize latent variables in the Local Latent Feature Learning Channel (EA-VAE). Its core function is to enhance the model's ability to capture ambiguous and implicit causal cues through semantic alignment and structural regularization, thereby providing statistical robustness for complex sentiment-cause pair extraction. Prediction loss is supervised by binary cross-entropy (BCE) loss for the identification of sentiment and causal discourse. Ranking loss is achieved using marginal ranking loss, ensuring that correct sentiment-cause pairs score significantly higher than incorrect negative sample pairs.
[0044] The total loss function integrates all objectives:
[0045] (11)
[0046] In the above formula, the left side is the multi-objective loss function, and the terms on the right side are: binary cross-entropy loss; KL divergence loss, used to regularize latent variables; and marginal ranking loss.
[0047] During the inference phase, the model calculates the matching score of all candidate emotion-cause pairs and selects candidate pairs with scores exceeding a predetermined threshold or ranking high in the global ranking as the final emotion-cause pair prediction result output.
[0048] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for extracting dialogue sentiment-cause pairs based on a dual-channel graph encoder network, characterized in that, Includes the following steps: The input dialogue is preprocessed by converting each utterance into a utterance-level feature vector, constructing a directed utterance graph and its adjacency matrix based on the utterance order and speaker identity, and identifying the edge types in the directed utterance graph; the utterance-level feature vectors and adjacency matrix are then input in parallel into the global structure learning channel and the local feature extraction channel. The global structure learning channel is based on a directed acyclic graph and graph autoencoder structure to model the long-term temporal dependencies of dialogue in order to output global structure features. The local feature extraction channel is based on the variational autoencoder framework. It infers latent variables based on the aggregated features of different edge types and dynamically modulates the aggregated weights of different edge types through the inferred latent variables to capture local implicit cues and output local latent features. The global structural features and local latent features are input into the adaptive gating fusion module, and the learningable gating weights are used to perform weighted fusion with the adjustable balance parameters of the corresponding different channels to obtain the final fused feature representation. Based on fusion feature representation, the matching score of all candidate sentiment utterances and cause utterances in the dialogue is calculated through a fully connected layer. The final sentiment cause pair is then selected and output based on the matching score.
2. The dialogue sentiment-cause pair extraction method based on a dual-channel graph encoder network according to claim 1, characterized in that, During training, the local feature extraction channel is regularized by minimizing the KL divergence loss between the posterior and prior distributions of the latent variables.
3. The dialogue sentiment-cause pair extraction method based on a dual-channel graph encoder network according to claim 1, characterized in that, In the pairing extraction step, a relative position embedding is generated for each candidate emotional utterance and causal utterance pair, and combined with a soft position prior based on a Gaussian kernel function, to jointly constitute the position-aware features of the pairing.
4. The dialogue sentiment-cause pair extraction method based on a dual-channel graph encoder network according to claim 1, characterized in that, Each encoding layer of the graph autoencoder in the global structure learning channel performs the following operations in sequence: aggregate the predecessor node features of the target node based on the graph attention mechanism, and then input the aggregated features and the target node's own features into the gated recurrent unit for updating; finally, the output features of all encoding layers are concatenated and pooled to obtain the global structure features.
5. The dialogue sentiment-cause pair extraction method based on a dual-channel graph encoder network according to claim 1, characterized in that, The adaptive gating fusion module generates independent gating weight vectors for global structural features and local latent features respectively using the Sigmoid function. After multiplying these weights by the corresponding adjustable balance parameters, the original features are scaled. Finally, the scaled features are added together.
6. The dialogue sentiment-cause pair extraction method based on a dual-channel graph encoder network according to claim 1, characterized in that, During the model training phase, the total loss function for model training is composed of a weighted sum of prediction loss, KL divergence loss, and marginal ranking loss.
7. A dual-channel graph encoder for implementing the dialogue sentiment-cause pair extraction method based on a dual-channel graph encoder network as described in claim 1, characterized in that, include: The preprocessing module is used to convert the input dialogue into a utterance-level feature matrix and construct the adjacency matrix of the directed utterance graph. The global structure learning channel, connected to the preprocessing module, contains a graph autoencoder based on a directed acyclic graph, which receives the utterance-level feature matrix and the adjacency matrix and outputs the global structure features. The local feature extraction channel is connected to the preprocessing module and adopts a variational autoencoder structure, which includes an edge type partitioning unit, a variational inference unit, and a dynamic weight modulation unit. It is used to receive the utterance-level feature matrix and the adjacency matrix and output local latent features. The adaptive gating fusion module is connected to the global structure learning channel and the local feature extraction channel respectively, and is used to fuse global structural features and local latent features and output fused feature representation. The pair extraction module, connected to the adaptive gating fusion module, is used to calculate the matching score of candidate pairs based on the fusion feature representation and output sentiment reason pairs.
8. The dual-channel graph encoder according to claim 7, characterized in that, The variational autoencoder structure in the local feature extraction channel specifically includes: an edge type partitioning unit, used to partition the edges in the adjacency matrix into multiple predefined types according to utterance attributes and speaker identity; a variational inference unit, used to infer the posterior distribution parameters of latent variables based on the preliminary aggregated features of each edge type, and obtain the specific values of latent variables through sampling; and a dynamic weight modulation unit, connected to the variational inference unit, used to dynamically calculate and modulate the weight matrices corresponding to various edge types according to the latent variables obtained by sampling, through a transformation function based on inverse transformation and a preset mask matrix, thereby updating the node features.
9. The dual-channel graph encoder according to claim 7, characterized in that, The graph neural network encoder in the variational autoencoder structure has a gated residual connection mechanism between adjacent coding layers. This mechanism adaptively fuses the output of the current layer with the input of the previous layer through a learnable gate vector.
10. The dual-channel graph encoder according to claim 7, characterized in that, The preprocessing module uses the RoBERTa-base model as a context encoder to obtain the discourse-level feature matrix.