Continuous dialogue sentiment analysis method based on dynamic graph neural network
Through the dynamic graph neural network, the graph structure is updated, combined with timing and semantic relationships, the traditional dialogue sentiment analysis method has solved the problems of low accuracy and insufficient real-time performance in long dialogue scenarios, and achieved high-precision sentiment analysis and key statement positioning.
Patent Information
- Application Number
- CN202510782110.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-12
- Publication Date
- 2025-08-26
AI Technical Summary
Traditional dialogue emotion analysis methods cannot effectively capture the emotional evolution process in continuous dialogue, especially in long dialogue scenarios, which are low in analysis accuracy, and it is difficult to process new statements and identify emotional turning points in real time.
A method based on dynamic graph neural network is adopted, by obtaining the statement sequence within the target time period, dynamically updating the graph structure, combining timing and semantic connection relationships, the target graph neural network is used for sentiment analysis, and emotional change trends and key statements are output.
Real-time emotion analysis of conversations of any length is realized, the accuracy of emotional turning point detection is improved, and a fine-grained emotional intensity timing curve is generated to accurately locate key turning statements.
Smart Images

Figure CN120541220A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of language processing technology, and in particular relates to a continuous dialogue sentiment analysis method based on dynamic graph neural network. Background Art
[0002] Traditional conversational sentiment analysis methods primarily rely on sentiment classification of individual sentences, failing to effectively capture the evolving emotional landscape of continuous conversations. Existing technologies suffer from three key limitations: First, they employ a static modeling approach, making it difficult to handle the dynamic changes of newly added sentences during a conversation; second, they consider only a single dimension of sentence relationships (such as temporal or semantic), neglecting the synergistic effects of temporal dependencies and semantic associations; and third, batch-based analysis methods lack real-time performance, making them incapable of meeting the demands of online interactions. Especially for long conversations, the analysis accuracy of existing methods decreases significantly with increasing conversation length, and they struggle to accurately identify key sentences that signal emotional transitions. These limitations severely restrict the application of conversational sentiment analysis technology in real-time interactions. Summary of the Invention
[0003] To address the above technical issues, the present invention provides a method for continuous conversation sentiment analysis based on a dynamic graph neural network, comprising:
[0004] Obtain a target sentence sequence of the target user within a target time period in the current conversation, where the target time period is a time interval with a target length from the current moment, and the target sentence sequence includes multiple target user sentences arranged in chronological order;
[0005] The target graph structure is obtained by updating the initial graph structure using the target sentence sequence, wherein the initial graph structure is constructed based on multiple historical user sentences of the target user before the target time period, the initial graph structure includes a historical sentence node corresponding to each historical user sentence, the target graph structure includes a target sentence node corresponding to each target user sentence in the target sentence sequence, and the target graph structure is used to describe the target connection relationship between each target sentence node and other sentence nodes, and the target connection relationship includes a temporal connection relationship and a semantic connection relationship. The temporal connection relationship is used to indicate that there is a temporal sequence between two sentence nodes with a connection relationship, and the semantic connection relationship is used to indicate that the semantic similarity between two sentence nodes with a connection relationship is greater than or equal to a similarity threshold;
[0006] The target graph structure is input into the target graph neural network to obtain the sentiment analysis results output by the target graph neural network. The target graph neural network is a deep learning model built based on the dynamic graph neural network. The sentiment analysis results include the target user's sentiment change trend within the target time period and the key user sentences used to characterize the target user's emotional transition.
[0007] Furthermore, the target sentence sequence is used to update the initial graph structure to obtain the target graph structure, including:
[0008] Obtaining an initial graph structure, wherein the initial graph structure is used to describe the temporal connection relationship and semantic connection relationship between each historical statement node and other statement nodes;
[0009] Constructing an initial statement node with a corresponding relationship for each target user statement in the initial graph structure to obtain an updated graph structure, wherein the updated graph structure includes a plurality of historical statement nodes with a connection relationship and discrete initial statement nodes;
[0010] Matching the first statement node to be connected to the initial statement node with the corresponding initial statement node according to the arrangement order of each target user sentence in the target statement sequence, thereby obtaining the first statement node to be connected to each initial statement node, wherein the first statement node is the statement node that precedes the initial statement node in time sequence;
[0011] Matching a second statement node to be connected to each initial statement node according to the semantic similarity between each initial statement node and other statement nodes in the updated graph structure, obtaining the second statement node to be connected to each initial statement node, wherein the second statement node is a statement node in the updated graph structure having a semantic similarity with the initial statement node greater than or equal to a similarity threshold;
[0012] Connecting each initial statement node to a first statement node to be connected to the initial statement node through a target timing edge, and connecting each initial statement node to a second statement node to be connected to the initial statement node through a target semantic edge, wherein the target timing edge is a directed edge pointing from the initial statement node to the first statement node, and the target timing edge is used to indicate that the time sequence of the initial statement node is after the connected first statement node, and the target semantic edge is an undirected edge connecting the initial statement node and the second statement node;
[0013] The initial statement node that completes the connection between the first statement node and the second statement node is determined as the target statement node, until a target graph structure including only the target statement node and the historical statement nodes is obtained.
[0014] Furthermore, according to the arrangement order of each target user sentence in the target sentence sequence, the first sentence node to be connected to the initial sentence node is matched with the initial sentence node having a corresponding relationship, and the first sentence node to be connected to each initial sentence node is obtained, including:
[0015] Traverse each target user sentence in the target sentence sequence, determine the currently traversed target user sentence as the reference user sentence, determine the initial sentence node corresponding to the reference user sentence as the reference sentence node, and perform the following steps to detect the first sentence node to be connected to the reference sentence node, until the target sentence sequence is traversed and the first sentence node to be connected to each initial sentence node is obtained:
[0016] Detect whether the reference user statement is the first user statement in the target statement sequence;
[0017] When the reference user sentence is the first user sentence in the target sentence sequence, detecting the last historical sentence node in the time sequence in the initial graph structure and determining the last historical sentence node as the first sentence node to be connected to the reference sentence node;
[0018] In the case where the reference user statement is not the first user statement in the target statement sequence, the previous target user statement of the reference user statement is extracted from the target statement sequence; and the initial statement node corresponding to the previous target user statement is determined as the first statement node to be connected to the reference user statement.
[0019] Furthermore, each initial statement node is matched with a second statement node to be connected to the initial statement node according to the semantic similarity between each initial statement node and other statement nodes in the updated graph structure, thereby obtaining the second statement node to be connected to each initial statement node, including:
[0020] Traverse each initial statement node in the update graph structure, determine the currently traversed initial statement node as a candidate statement node, and perform the following steps to detect the semantic similarity between the candidate statement node and other statement nodes in the update graph structure until each initial statement node is traversed and the second statement node to be connected to each initial statement node is obtained:
[0021] Traverse each initial statement node and historical statement node in the update graph structure except the candidate statement node, determine the currently traversed initial statement node or historical statement node as a similar statement node, and perform the following steps to detect the semantic similarity between the similar statement node and the candidate statement node, until the traversal is completed to obtain the second statement node to be connected to the candidate statement node through each initial statement node and historical statement node in the update graph structure except the candidate statement node:
[0022] Encoding similar sentence nodes into a first sentence vector, and encoding candidate sentence nodes into a second sentence vector;
[0023] By formula Calculate the cosine similarity of two sentence vectors, where u is the first sentence vector and v is the second sentence vector;
[0024] Determine the cosine similarity as the semantic similarity between the similar sentence node and the candidate sentence node, and compare the semantic similarity with a similarity threshold;
[0025] When the semantic similarity is greater than or equal to the similarity threshold, the similar sentence node is determined as the second sentence node to be connected to the candidate sentence node.
[0026] Furthermore, the target graph neural network includes an input layer, an encoding layer, a fusion layer, a fully connected layer and an output layer, wherein the input layer is used to receive the target graph structure and transmit the target graph structure to the encoding layer;
[0027] The encoding layer is used to encode each sentence node in the target graph structure, extract the feature vector of each sentence node, and transmit the feature vector of each sentence node to the fusion layer;
[0028] The fusion layer is used to fuse the feature vectors of the sentence nodes with connection relationships in the target graph structure to obtain the fused node feature representation, and transmit the fused node feature representation to the fully connected layer;
[0029] The fully connected layer is used to extract emotion-related information from the fused node feature representation and transmit the emotion-related information to the output layer;
[0030] The output layer is used to generate sentiment change trends and key user sentences based on the sentiment-related information transmitted by the fully connected layer, and output the sentiment change trends and key user sentences as sentiment analysis results.
[0031] Furthermore, the output layer includes a sentiment detection module and an output module. The sentiment detection module includes a sentiment classification head, a sentiment trend regression head, and a key node detection head in parallel. The sentiment classification head is used to detect the probability distribution of the sentiment category of each sentence node through a softmax function.
[0032] The sentiment trend regression head is used to output a sentiment intensity time series curve through LSTM. The sentiment intensity time series curve is used to indicate the temporal changes in the target user's sentiment intensity in the complete current conversation;
[0033] Key node detection head, used to locate sentiment transition sentences as key user sentences based on the information entropy of node features;
[0034] The output module is used to convert the probability distribution of emotion categories and the temporal changes in emotion intensity into graphic and text expressions as emotion change trends, and output emotion change trends and key user sentences.
[0035] Compared with the existing technology, the present invention has the following advantages: (1) Improved dynamic modeling capabilities: adopting an incremental graph structure update mechanism to integrate newly generated dialogue sentences in real time, automatically maintain the connection relationship between historical and new sentence nodes, support analysis of dialogues of any length, and improve analysis accuracy compared with static graph methods; (2) Advantages of multi-dimensional relationship fusion: synchronously modeling temporal connections (reflecting the path of emotional evolution) and semantic connections (capturing cross-time period associations), the dual relationships synergistically improve the accuracy of emotional turning point detection; (3) Fine-grained analysis capabilities: outputting the probability distribution of emotional categories (such as happiness, anger, etc.) to generate a visual emotional intensity temporal curve to accurately locate key turning sentences. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 This is a flow chart of a continuous conversation sentiment analysis method based on dynamic graph neural network in the present invention. DETAILED DESCRIPTION
[0037] Example: Figure 1 As shown in FIG, a continuous conversation sentiment analysis method based on a dynamic graph neural network includes:
[0038] Step S101: Obtain a target sentence sequence of a target user within a target time period in a current conversation, wherein the target time period is a time interval with a target length from the current moment, and the target sentence sequence includes multiple sentences of the target user arranged in chronological order;
[0039] Step S102: Using the target sentence sequence to update the initial graph structure to obtain a target graph structure, wherein the initial graph structure is constructed based on multiple historical user sentences of the target user before the target time period, the initial graph structure includes a historical sentence node corresponding to each historical user sentence, the target graph structure includes a target sentence node corresponding to each target user sentence in the target sentence sequence, and the target graph structure is used to describe the target connection relationship between each target sentence node and other sentence nodes. The target connection relationship includes a temporal connection relationship and a semantic connection relationship. The temporal connection relationship is used to indicate that there is a temporal sequence between two sentence nodes with a connection relationship, and the semantic connection relationship is used to indicate that the semantic similarity between two sentence nodes with a connection relationship is greater than or equal to a similarity threshold.
[0040] Step S103: Input the target graph structure into the target graph neural network to obtain the sentiment analysis result output by the target graph neural network, wherein the target graph neural network is a deep learning model constructed based on the dynamic graph neural network, and the sentiment analysis result includes the target user's sentiment change trend within the target time period and the key user sentences used to characterize the target user's emotional transition.
[0041] Optionally, the target length can be determined by, but is not limited to, the following methods: Initial default value: Set the basic time window T1 to 5 minutes; Calculate statement density in real time: density = len(current_dialogue) / time_elapsed #The ratio of the number of statements to minutes; Dynamic adjustment rules: When density > 5 items / minute: Shorten the window to T2 = T1 × (1-0.1 × (density-5)); When density < 2 items / minute: Expand the window to T3 = T1 × (1+0.2 × (2-density)).
[0042] Optionally, for each target statement node, the other statement nodes include each target statement node in the target graph structure except the current target statement node. For example, when the target graph structure includes historical statement node 1, historical statement node 2, target statement node 1, target statement node 2 and target statement node 3, for target statement node 2, the other statement nodes include historical statement node 1, historical statement node 2, target statement node 1 and target statement node 3.
[0043] Furthermore, taking the example where the initial graph structure includes history sentence node 1 and history sentence node 2, the temporal connection relationship is history sentence node 2 → history sentence node 1, and history sentence node 1 and history sentence node 2 have a semantic connection relationship, and the target sentence sequence includes target user sentence 1, target user sentence 2, and target user sentence 3, the process of using the target sentence sequence to update the initial graph structure to obtain the target graph structure includes:
[0044] In the initial graph structure, a target sentence node 1 corresponding to the target user sentence 1, a target sentence node 2 corresponding to the target user sentence 2, and a target sentence node 3 corresponding to the target user sentence 3 are constructed, and a temporal connection relationship is constructed in chronological order, including: target sentence node 1 → historical sentence node 2, target sentence node 2 → target sentence node 1, target sentence node 3 → target sentence node 2 to obtain target sentence node 3 → target sentence node 2 → target sentence node 1 → historical sentence node 2 → historical sentence node 1;
[0045] Detect the semantic similarity between the target sentence node 1 and the historical sentence node 1, historical sentence node 2, target sentence node 2, and target sentence node 3. When the semantic similarity is greater than or equal to the similarity threshold, construct a semantic connection relationship, and repeat the above semantic connection relationship construction process until the semantic connection relationship of the target sentence node 1, target sentence node 2, and target sentence node 3 is completed to obtain the target graph structure.
[0046] Optionally, the similarity threshold can be determined based on, but not limited to, the scenario in which the current conversation occurs. For example, in an e-commerce customer service scenario, the similarity threshold can be set to 0.65 (needing to handle a large number of similar complaints); in a psychological counseling scenario, the similarity threshold can be set to 0.55 (encouraging the association of potential emotional clues); in a legal consultation scenario, the similarity threshold can be set to 0.75 (strictly matching key legal terms), etc.
[0047] Optionally, take a target length of 10 minutes and extract six consecutive sentences sent by users within that time period to form a target sentence sequence: 1. "How do I use this product?"; 2. "I don't understand the instructions"; 3. "It's so complicated to operate"; 4. "They even need extra accessories?"; 5. "Is customer service here? I need help!"; 6. "This is so disappointing!" For example, output the sentiment analysis results through the following process:
[0048] Load the pre-built initial graph structure (containing the previous 20 minutes of historical conversations), create a node for each new statement, and add it to the graph structure to establish a dual connection relationship: temporal connection, connecting according to the conversation order through directed edges (such as node 5 → node 6); semantic connection, calculate cosine similarity, and establish undirected edges for nodes with similarity > 0.7 (such as establishing an anger emotion association between node 3 and node 6).
[0049] Use a pre-trained DGNN model (including a 3-layer graph attention network) to perform multi-task learning: sentiment classification: output 6-category sentiment probabilities (softmax); intensity regression: generate sentiment value curves (LSTM); turning point detection: calculate the change in node feature entropy value.
[0050] Visualization of sentiment change trends: Timeline: [Sentences 1-6]; Sentiment values: [0.2, 0.3, -0.5, -0.7, -0.8, -0.9] (negative values indicate increasing negative sentiment).
[0051] Key turning point annotation: Key sentence: "It's so complicated to operate" (Node 3); Detection basis: Entropy value mutation + emotion intensity change rate > threshold.
[0052] In this embodiment, the target graph structure is obtained by updating the initial graph structure using the target statement sequence, including: obtaining the initial graph structure, wherein the initial graph structure is used to describe the temporal connection relationship and semantic connection relationship between each historical statement node and other statement nodes; constructing an initial statement node with a corresponding relationship for each target user statement in the initial graph structure to obtain an updated graph structure, wherein the updated graph structure includes multiple historical statement nodes and discrete initial statement nodes with a connection relationship; matching the initial statement node with a corresponding relationship according to the arrangement order of each target user statement in the target statement sequence to the first statement node to be connected to, thereby obtaining the first statement node to be connected to each initial statement node, wherein the first statement node is the previous statement node in the time sequence of the initial statement node; matching each initial statement node for each initial statement node according to the semantic similarity between each initial statement node and other statement nodes in the updated graph structure. A second statement node to be connected to the initial statement node is obtained, wherein the second statement node to be connected to each initial statement node is obtained, wherein the second statement node is a statement node in the updated graph structure whose semantic similarity with the initial statement node is greater than or equal to the similarity threshold; each initial statement node is connected to the first statement node to be connected to the initial statement node through a target timing edge, and each initial statement node is connected to the second statement node to be connected to the initial statement node through a target semantic edge, wherein the target timing edge is a directed edge from the initial statement node to the first statement node, the target timing edge is used to indicate that the time sequence of the initial statement node is after the connected first statement node, and the target semantic edge is an undirected edge connecting the initial statement node and the second statement node; the initial statement node that completes the connection between the first statement node and the second statement node is determined as the target statement node, until a target graph structure including only target statement nodes and historical statement nodes is obtained.
[0053] In this embodiment, the first statement node to be connected to the initial statement node is matched with the initial statement node having a corresponding relationship according to the arrangement order of each target user statement in the target statement sequence to obtain the first statement node to be connected to each initial statement node, including: traversing each target user statement in the target statement sequence, determining the currently traversed target user statement as the reference user statement, determining the initial statement node corresponding to the reference user statement as the reference statement node, and performing the following steps to detect the first statement node to be connected to the reference statement node until the target statement sequence is traversed to obtain the first statement node to be connected to each initial statement node: detecting whether the reference user statement is the first user statement in the target statement sequence; if the reference user statement is the first user statement in the target statement sequence, detecting the historical statement node that is the last in the time sequence in the initial graph structure and determining the last historical statement node as the first statement node to be connected to the reference statement node; if the reference user statement is not the first user statement in the target statement sequence, extracting the previous target user statement of the reference user statement from the target statement sequence; and determining the initial statement node corresponding to the previous target user statement as the first statement node to be connected to the reference user statement.
[0054] In this embodiment, a second statement node to be connected to the initial statement node is matched for each initial statement node according to the semantic similarity between each initial statement node and other statement nodes in the update graph structure, and the second statement node to be connected to each initial statement node is obtained, including: traversing each initial statement node in the update graph structure, determining the currently traversed initial statement node as a candidate statement node, executing the following steps to detect the semantic similarity between the candidate statement node and other statement nodes in the update graph structure until each initial statement node is traversed to obtain the second statement node to be connected to each initial statement node: traversing each initial statement node and historical statement node except the candidate statement node in the update graph structure, determining the currently traversed initial statement node or historical statement node as a similar statement node, executing the following steps to detect the semantic similarity between the similar statement node and the candidate statement node until each initial statement node and historical statement node except the candidate statement node in the update graph structure is traversed to obtain the second statement node to be connected to the candidate statement node: encoding the similar statement node into a first statement vector, and encoding the candidate statement node into a second statement vector; through the formula Calculate the cosine similarity of two sentence vectors, where u is the first sentence vector and v is the second sentence vector; determine the cosine similarity as the semantic similarity between the similar sentence node and the candidate sentence node, and compare the semantic similarity with the similarity threshold; when the semantic similarity is greater than or equal to the similarity threshold, determine the similar sentence node as the second sentence node to be connected to the candidate sentence node.
[0055] In this embodiment, the target graph neural network includes an input layer, an encoding layer, a fusion layer, a fully connected layer and an output layer, wherein the input layer is used to receive the target graph structure and transmit the target graph structure to the encoding layer; the encoding layer is used to encode each sentence node in the target graph structure, extract the feature vector of each sentence node, and transmit the feature vector of each sentence node to the fusion layer; the fusion layer is used to fuse the feature vectors of sentence nodes with connection relationships in the target graph structure to obtain the fused node feature representation, and transmit the fused node feature representation to the fully connected layer; the fully connected layer is used to extract emotion-related information from the fused node feature representation, and transmit the emotion-related information to the output layer; the output layer is used to generate emotion change trends and key user sentences based on the emotion-related information transmitted by the fully connected layer, and output the emotion change trends and key user sentences as emotion analysis results.
[0056] In this embodiment, the output layer includes an emotion detection module and an output module. The emotion detection module includes a parallel emotion classification head, an emotion trend regression head and a key node detection head, wherein the emotion classification head is used to detect the emotion category probability distribution of each sentence node through the softmax function; the emotion trend regression head is used to output the emotion intensity time series curve through LSTM, and the emotion intensity time series curve is used to indicate the target user's emotion intensity time series changes in the complete current conversation; the key node detection head is used to locate the emotion transition sentence as the key user sentence based on the information entropy of the node features; the output module is used to convert the emotion category probability distribution and the emotion intensity time series changes into graphic expressions as emotion change trends, and output the emotion change trends and key user sentences.
[0057] Optionally, the target graph neural network proposed in this application uses a dynamic graph attention network (DGAT) as its underlying architecture. This network features a multi-layer graph attention mechanism that dynamically adjusts the connection weights between nodes. Compared to traditional GATs, DGAT is particularly well-suited for processing time-varying semantic relationships in conversational scenarios. By integrating a temporal graph network (TGN) component in the encoding layer, it specifically models the time interval characteristics between conversational sentences. The encoding layer converts the time difference into a vector representation and integrates it with the semantic features. It is important to note that a multi-task output design is incorporated into the output layer of the target graph neural network. This includes the sentiment classification head, which uses a deep neural network structure to output the probability distribution of six basic emotions (such as happiness, anger, and sadness), using a focus loss function to address class imbalance. The sentiment intensity regression head combines LSTM and linear layers to generate a continuous sentiment intensity curve, reflecting the gradual evolution of sentiment. The turning point detection head, based on a graph contrastive learning framework, locates sentiment mutation points by calculating the information entropy changes of node features.
[0058] Optionally, the target graph neural network can be trained through, but is not limited to, the following process:
[0059] 1. Data Preparation Phase: Conversation Graph Construction Rules: Each sentence is treated as an independent node, containing a BERT-encoded semantic vector and a timestamp. Time edges establish directed connections based on the order of the conversation. Semantic edges are dynamically created based on cosine similarity (with a dynamically adjusted threshold). Data Augmentation Strategies: Conversation Slice Reorganization: Local reorganization that maintains temporal relationships; Semantic Preserving Perturbation: Transformations such as synonym replacement that do not affect emotional expression.
[0060] 2. Two-stage training strategy: Stage 1: Pre-training (unsupervised) Objective: Learn a common dialogue structure representation using a contrastive learning framework; Construct positive and negative sample pairs: Positive samples: related sentence pairs in the same dialogue; Negative samples: random combinations of sentences from different dialogues; Use the InfoNCE loss function with a temperature coefficient of 0.07; Train in large batches (256 dialogue graphs / batch).
[0061] Phase 2: Fine-tuning (supervised), multi-task joint training: Task weight distribution: sentiment classification (50%), intensity regression (30%), turning point detection (20%), dynamic adjustment of the contribution of each task loss function; Optimization strategy: Adopt AdamW optimizer, initial learning rate 5e-5, dynamic gradient clipping (maximum norm 0.5) implementation; Curriculum learning: Gradually transition from simple samples to complex dialogues.
[0062] 3. Model optimization techniques: Mixed-precision training: Use FP16 to accelerate calculations while maintaining FP32 precision for key parts; Memory replay: Preserve historical key node features to prevent catastrophic forgetting; Early stopping mechanism: Based on comprehensive indicators on the validation set (taking into account the performance of each task).
[0063] In the technical solution proposed in the present invention, by obtaining the target user's sentence sequence within the target time period, the initial graph structure is updated to the target graph structure, and the target graph structure is input into the target graph neural network, and finally the target user's emotional change trend and key user sentences within the target time period are output. Furthermore, by dynamically updating the graph structure, the present invention can capture the sentence timing and semantic relationship in the conversation in real time, and at the same time, combine emotion classification, emotion intensity timing curve and key sentence positioning to achieve multi-dimensional, high-precision emotion analysis. This method of combining semantics and timing not only improves the accuracy of emotion analysis, but also more comprehensively reflects the dynamic changes of emotions in the conversation, providing a deeper and more accurate solution for continuous conversation emotion analysis.
[0064] In this specification, reference to terms such as "one embodiment," "example," or "specific example" means that a specific feature, structure, material, or characteristic described in conjunction with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example.
Claims
1. A method for continuous conversation sentiment analysis based on dynamic graph neural network, characterized in that: The method comprises: Obtain a target sentence sequence of the target user within a target time period in the current conversation, wherein the target time period is a time interval with a target length from the current moment, and the target sentence sequence includes multiple target user sentences arranged in chronological order; Using the target sentence sequence to update the initial graph structure to obtain a target graph structure, wherein the initial graph structure is constructed based on multiple historical user sentences of the target user before the target time period, the initial graph structure includes a historical sentence node corresponding to each of the historical user sentences, the target graph structure includes a target sentence node corresponding to each of the target user sentences in the target sentence sequence, and the target graph structure is used to describe the target connection relationship between each target sentence node and other sentence nodes, the target connection relationship includes a temporal connection relationship and a semantic connection relationship, the temporal connection relationship is used to indicate that there is a temporal sequence between two sentence nodes with a connection relationship, and the semantic connection relationship is used to indicate that the semantic similarity between two sentence nodes with a connection relationship is greater than or equal to a similarity threshold; The target graph structure is input into the target graph neural network to obtain the sentiment analysis result output by the target graph neural network, wherein the target graph neural network is a deep learning model constructed based on the dynamic graph neural network, and the sentiment analysis result includes the sentiment change trend of the target user within the target time period and the key user sentences used to characterize the emotional transition of the target user.
2. The method for analyzing sentiment of continuous conversations based on dynamic graph neural networks according to claim 1, characterized in that: The updating of the initial graph structure using the target sentence sequence to obtain the target graph structure includes: Acquire the initial graph structure, wherein the initial graph structure is used to describe the temporal connection relationship and the semantic connection relationship between each of the historical sentence nodes and other sentence nodes; Constructing an initial statement node with a corresponding relationship for each target user statement in the initial graph structure to obtain an updated graph structure, wherein the updated graph structure includes a plurality of the historical statement nodes with a connection relationship and the discrete initial statement nodes; Matching the initial sentence nodes with the corresponding relationship according to the arrangement order of each target user sentence in the target sentence sequence to the first sentence node to be connected with the initial sentence node, thereby obtaining the first sentence node to be connected with each initial sentence node, wherein the first sentence node is the sentence node that precedes the initial sentence node in time order; Matching a second statement node to be connected to each initial statement node according to the semantic similarity between each initial statement node and other statement nodes in the updated graph structure, to obtain the second statement node to be connected to each initial statement node, wherein the second statement node is a statement node in the updated graph structure whose semantic similarity with the initial statement node is greater than or equal to the similarity threshold; Connecting each of the initial statement nodes to the first statement node to be connected to the initial statement node through a target timing edge, and connecting each of the initial statement nodes to the second statement node to be connected to the initial statement node through a target semantic edge, wherein the target timing edge is a directed edge pointing from the initial statement node to the first statement node, the target timing edge is used to indicate that the time sequence of the initial statement node is after the connected first statement node, and the target semantic edge is an undirected edge connecting the initial statement node and the second statement node; The initial statement node that completes the connection between the first statement node and the second statement node is determined as the target statement node, until the target graph structure including only the target statement node and the historical statement nodes is obtained.
3. The method for continuous conversation sentiment analysis based on dynamic graph neural network according to claim 2 is characterized in that: The step of matching the initial statement nodes having a corresponding relationship according to the arrangement order of each target user sentence in the target sentence sequence with the first statement node to be connected with the initial statement node to obtain the first statement node to be connected with each initial statement node includes: Traversing each target user sentence in the target sentence sequence, determining the currently traversed target user sentence as a reference user sentence, determining the initial sentence node corresponding to the reference user sentence as a reference sentence node, and performing the following steps to detect the first sentence node to be connected to the reference sentence node, until the target sentence sequence is traversed and the first sentence node to be connected to each initial sentence node is obtained: Detecting whether the reference user statement is the first user statement in the target statement sequence; In a case where the reference user sentence is the first user sentence in the target sentence sequence, detecting the last historical sentence node in the time sequence in the initial graph structure and determining the last historical sentence node as the first sentence node to be connected to the reference sentence node; In the case that the reference user statement is not the first user statement in the target statement sequence, the previous target user statement of the reference user statement is extracted from the target statement sequence; and the initial statement node corresponding to the previous target user statement is determined as the first statement node to be connected to the reference user statement.
4. The method for analyzing sentiment of continuous conversations based on dynamic graph neural networks according to claim 2, characterized in that: The matching of each initial statement node with a second statement node to be connected to the initial statement node according to the semantic similarity between each initial statement node and other statement nodes in the updated graph structure, to obtain the second statement node to be connected to each initial statement node, includes: Traversing each of the initial statement nodes in the update graph structure, determining the currently traversed initial statement node as a candidate statement node, and performing the following steps to detect the semantic similarity between the candidate statement node and other statement nodes in the update graph structure until each of the initial statement nodes is traversed to obtain the second statement node to be connected to each of the initial statement nodes: Traversing each of the initial statement nodes and the historical statement nodes except the candidate statement node in the update graph structure, determining the currently traversed initial statement node or the historical statement node as a similar statement node, and performing the following steps to detect the semantic similarity between the similar statement node and the candidate statement node, until traversing each of the initial statement nodes and the historical statement nodes except the candidate statement node in the update graph structure is completed to obtain the second statement node to be connected to the candidate statement node: Encoding the similar sentence nodes into a first sentence vector, and encoding the candidate sentence nodes into a second sentence vector; By formula Calculate the cosine similarity of two sentence vectors, where u is the first sentence vector and v is the second sentence vector; Determining the cosine similarity as the semantic similarity between the similar sentence node and the candidate sentence node, and comparing the semantic similarity with the similarity threshold; When the semantic similarity is greater than or equal to the similarity threshold, the similar sentence node is determined as the second sentence node to be connected to the candidate sentence node.
5. The method for analyzing sentiment of continuous conversations based on dynamic graph neural networks according to claim 1, characterized in that: The target graph neural network includes an input layer, an encoding layer, a fusion layer, a fully connected layer and an output layer, wherein the input layer is used to receive the target graph structure and transmit the target graph structure to the encoding layer; The encoding layer is used to encode each sentence node in the target graph structure, extract the feature vector of each sentence node, and transmit the feature vector of each sentence node to the fusion layer; The fusion layer is used to fuse the feature vectors of the statement nodes with connection relationships in the target graph structure to obtain a fused node feature representation, and transmit the fused node feature representation to the fully connected layer; The fully connected layer is used to extract emotion-related information from the fused node feature representation and transmit the emotion-related information to the output layer; The output layer is used to generate the emotion change trend and the key user sentences according to the emotion-related information transmitted by the fully connected layer, and output the emotion change trend and the key user sentences as the emotion analysis results.
6. The method for continuous conversation sentiment analysis based on dynamic graph neural network according to claim 5, characterized in that: The output layer includes an emotion detection module and an output module. The emotion detection module includes a parallel emotion classification head, an emotion trend regression head, and a key node detection head. The emotion classification head is used to detect the emotion category probability distribution of each sentence node through a softmax function. The emotion trend regression head is used to output an emotion intensity time series curve through LSTM, where the emotion intensity time series curve is used to indicate the time series changes of the emotion intensity of the target user in the complete current conversation; The key node detection head is used to locate the emotional transition sentence as the key user sentence based on the information entropy of the node features; The output module is used to convert the emotion category probability distribution and the emotion intensity time series change into graphic and text expressions as the emotion change trend, and output the emotion change trend and the key user sentences.