A complex sentence sentiment analysis method based on a coarse-grained hierarchical structure tree

By constructing a coarse-grained hierarchical structure tree and combining it with a graph model, the problems of multiple sentiment co-occurrences and structural complexity in sentiment analysis of complex sentences are solved, achieving higher accuracy and interpretability, and making it suitable for sentiment analysis of complex sentences.

CN115730582BActive Publication Date: 2026-03-03XIAMEN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211556149.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-06
Publication Date
2026-03-03
Estimated Expiration
2042-12-06

AI Technical Summary

Technical Problem

Existing sentiment analysis methods for complex sentences are ineffective in handling multiple co-occurrences of sentiment and complex sentence structures, and lack interpretability, making it difficult to accurately extract the overall sentiment of complex sentences.

Method used

A coarse-grained hierarchical structure tree-based approach is adopted. By constructing a connection information lexicon, extracting sentiment modules, generating a coarse-grained hierarchical structure tree, and using a graph model for modeling, combined with sentiment expression, the challenge of sentiment analysis for complex sentences is solved.

Benefits of technology

It improves the accuracy and interpretability of sentiment analysis for complex sentences, with an accuracy increase of 3.6% and an F1 score increase of 4.78%, and has cross-linguistic capabilities and visual interpretability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115730582B_ABST
    Figure CN115730582B_ABST
Patent Text Reader

Abstract

The application discloses a complex sentence sentiment analysis method based on a coarse-grained hierarchical structure tree and relates to the field of natural language processing. The method solves the problems of multiple sentiment co-occurrence and conjunction hierarchical relationship in complex sentence sentiment analysis. The method comprises the following steps: 1) constructing a connection information word library; 2) extracting sentiment modules in a complex sentence; 3) constructing a coarse-grained hierarchical structure tree generation model; 4) modeling the hierarchical structure tree by using a graph model; and 5) combining the features of the complex sentence with the representation of the coarse-grained hierarchical structure tree to generate sentiment expression. The method can accurately find important sentiment parts in the complex sentence, makes up for the poor explainability of deep learning in complex sentence sentiment analysis, and has a good visual explanation of the results generated by the model. Experiments show that the method has obvious effects on a complex sentence data set, surpasses existing sentiment analysis methods, and has certain universality and cross-language ability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of natural language processing, and in particular to a method for sentiment analysis of complex sentences based on a coarse-grained hierarchical structure tree that alleviates the difficulty of sentiment analysis of complex long sentences by introducing a hierarchical structure tree and makes the classification results more interpretable. Background Technology

[0002] Since the early 2000s, sentiment analysis has become one of the most active research areas in Natural Language Processing (NLP). Sentence-level analysis has been a hot topic in sentiment analysis tasks because a large portion of online user reviews and opinions are at the sentence level, with complex sentences making up a significant portion. Unlike simple sentences, complex sentences often consist of two or more independent subject-predicate structures (or subject-predicate structures with some components omitted), expressing multiple interconnected and relatively complete meanings.

[0003] Sentiment analysis for complex sentences is specifically designed for analyzing the sentiment of complex sentence texts. Unlike sentiment analysis for simple sentences, the co-occurrence of multiple sentiments in complex sentences makes current methods ineffective. Furthermore, the sentiment relationships between clauses within a complex sentence mean that performing sentiment analysis on each clause alone can easily disrupt the sentence structure.

[0004] Many scholars have attempted to use syntactic structure information as additional features to aid model training. However, previous research methods in sentence-level sentiment analysis, especially in the field of deep learning, have rarely delved into the syntactic and semantic information of complex sentences, instead treating complex sentences and simple sentences as a whole. Complex sentences differ greatly from simple sentences in syntactic structure, and using the same syntactic analysis methods can easily lead to information loss.

[0005] Complex sentence sentiment analysis can be seen as a subtask of sentiment analysis, but it differs from other sentiment analysis tasks. The semantic and syntactic structures of complex sentences contain a wealth of sentiment information. If we only focus on the textual information of the sentence and ignore the structural information, it is difficult to obtain the overall sentiment of the complex sentence. Therefore, it is necessary to conduct in-depth analysis of the internal semantic and syntactic structures of complex sentences, eliminate sentiment noise in the sentence, and highlight the important sentiment polarities.

[0006] Sentiment analysis based on syntactic structure mainly faces the following challenges:

[0007] (1) Emotional co-occurrence. Complex sentences have complex syntactic structures, often consisting of multiple subject-predicate structures that express different emotions. In sentiment analysis, secondary emotions can become noise, interfering with the final prediction results.

[0008] (2) Sentiment hierarchy. When there are multiple conjunctions in a complex sentence, the sentiment usually exhibits a more complex hierarchy. Current sentiment analysis models tend to confuse the scope of conjunctions and struggle to extract information about the relationship between conjunctions and clauses, thus failing to accurately indicate the hierarchy of sentiments. Summary of the Invention

[0009] The purpose of this invention is to address the shortcomings of existing technologies in sentiment analysis of complex sentences with complex semantic relationships and multiple co-occurring emotions. It provides a coarse-grained hierarchical structure tree-based method for complex sentence sentiment analysis, which alleviates the difficulties by introducing a hierarchical structure tree and makes the classification results more interpretable. The first step of this invention is to construct a coarse-grained hierarchical structure tree based on sentence connection information, taking into account the hierarchical relationships of different connection information in the complex sentence. The second step is to perform sentiment analysis on the complex sentence based on the coarse-grained hierarchical structure tree, resulting in more accurate and interpretable classification results.

[0010] This invention includes the following steps:

[0011] 1) Construct a vocabulary of connection information;

[0012] 2) Extract the sentiment module from complex sentences;

[0013] 3) Construct a coarse-grained hierarchical structure tree generation model;

[0014] 4) Model the hierarchical structure tree using a graph model;

[0015] 5) Combine the features of complex sentences with the representation of coarse-grained structure trees to generate emotional expressions.

[0016] In step 1), the connection information in the connection information lexicon is information in complex sentences that only serves to connect sentences and phrases, and cannot independently constitute sentence components, including punctuation marks or conjunctions; LTP is used to segment approximately 150,000 collected Chinese microblogs, extract all conjunctions from the corpus and discard those that appear 5 times or less; most of the discarded conjunctions are synonyms of high-frequency words, such as 'generally speaking', 'in general', and 'in short', which have similar meanings; after filtering, 203 conjunctions are obtained; the conjunctions are manually screened and classified.

[0017] In step 2), the sentiment module refers to the clauses and connection information in a complex sentence. Each sentiment module typically contains a direct and singular sentiment expression. The specific steps for extracting sentiment modules from a complex sentence can be as follows:

[0018] (1) Using the connection information lexicon constructed in step 1), complex sentences are divided into combinations of sentiment modules S = {Module1, ..., Module2}. i,…,Module 2m+1}, where m represents the number of conjunctions;

[0019] (2) Encode each module in S using BERT to obtain the vector representation H = {H1, ..., H2} of each module. i ,…,H 2m+1 In this model, all modules share BERT parameters. To reduce computation and improve model performance, BERT pre-trained on Simple Sentences (SSD) is used for feature extraction. During training, the BERT parameters are not used.

[0020] (3) Use LSTM to extract the relationship information between sentiment modules in complex sentences and generate a hidden layer representation of sentiment modules with contextual information. We model all modules using attention mechanisms and extract important emotional modules.

[0021] In step 3), the specific steps for constructing the coarse-grained hierarchical structure tree generation model are as follows: The input complex sentence is set as x, and the output y is considered as the hierarchy of the connection information. Using Prompt-based learning, the hierarchy of the connection information is mapped to the correlation between the two clauses before and after the connection information, and scores are assigned accordingly. To quantify this hierarchical relationship, a mask is added before the connection information, and a pre-trained language model BERT is used for prediction. The coarse-grained hierarchical structure tree is constructed according to the hierarchical information from smallest to largest.

[0022] More specifically: The official BERT Chinese vocabulary contains 21,128 characters. Only the probabilities of commas and periods are normalized, with the probability of a period used as the hierarchical information for connection details. The specific calculation method is as follows:

[0023] logits [MASK] =BERT([MASK]|x)

[0024]

[0025] Where i and j represent the numbers corresponding to commas and periods in the vocabulary, and x represents the input text; a coarse-grained hierarchical structure tree is constructed in ascending order of hierarchical information.

[0026] In step 4), the hierarchical structure tree is a coarse-grained hierarchical structure tree generated in step 3); the graph model is a graph attention network model; GAT is used to extract information from the structure tree; the root node of each subtree in the structure tree is connection information, and the connection information is combined with the graph attention model to model the hierarchical structure of each clause in the complex sentence; the connection information is mainly composed of conjunctions, and conjunctions, as function words, cannot be used as sentence components independently. In order to weaken the connection information, the model does not add self-loops to non-leaf nodes to avoid the loss of information from other nodes.

[0027] In the graph attention model, each node in the tree structure calculates its relevance with all its neighboring nodes; the calculation process for the i-th node in the tree is as follows:

[0028]

[0029]

[0030] Here, neighbor(i) refers to the neighboring nodes of node i; neighbor(i) includes node i itself only when i is a leaf node;

[0031] For node i, GAT performs a weighted summation of the hidden states of all its neighboring nodes;

[0032]

[0033] Where l represents the number of layers in the graph attention model, equals H' i The GAT model in this invention has a total of L layers, and the above calculations are repeated in each layer.

[0034] In step 5), the specific steps for combining the features of complex sentences with the representation of a coarse-grained tree structure to generate emotional expression are as follows:

[0035] Using the hidden layer representations of important sentiment modules with contextual information extracted in step 2). The attention weight α is obtained through the attention mechanism. i The calculation process is as follows:

[0036] a i =W′ T tanh(W m H m +b m ), i∈[1, 2m+1]

[0037]

[0038] Among them, W m bm is the parameter of the linear layer, and W' is the parameter in the attention mechanism network; the hidden states of all modules are weighted and summed to obtain the representation F' of the complex sentence. The calculation process is as follows:

[0039]

[0040] Using the modeling of the coarse-grained hierarchical structure tree in step 4), the hidden vector of the root node of the hierarchical structure tree is obtained. This is represented as F”, a complex sentence based on a coarse-grained hierarchical structure tree. The two complex sentence representations are concatenated to obtain the feature representation F of the complex sentence, i.e.: F = Concat(F”; F');

[0041] A linear layer is used to map the complex sentence features F to a two-dimensional space, followed by a softmax operation, and then a binary sentiment classification task is performed. The probability of the output category y can be expressed as:

[0042] p(y|F)=softmax(W T F+b)

[0043] Where W and b are the linear layer weights; y is the model output, which is the predicted sentiment polarity.

[0044] Compared with the prior art, the present invention has the following advantages:

[0045] This invention employs a coarse-grained hierarchical structure tree (CGST) model, which further analyzes the hierarchical relationships of different connection information in complex sentences, proposing a coarse-grained hierarchical structure tree to analyze the sentiment polarity of complex sentences. This invention can accurately extract the main sentiment expression in complex sentences and solves the problem of poor sentiment model prediction performance caused by the co-occurrence of multiple emotions and complex sentence structures in complex sentences. When multiple emotions co-occur in a sentence, existing sequence models are easily influenced by secondary emotions, leading to incorrect sentiment prediction. This invention can accurately identify the important sentiment components in complex sentences. CGST considers that the hierarchical relationship of connection information affects the overall sentiment expression of a complex sentence, and innovatively utilizes a coarse-grained hierarchical structure tree and graph model to extract sentiment information from connection information. At the same time, CGST overcomes the problem of poor interpretability in deep learning for sentiment analysis of complex sentences, providing excellent visual explanations of the model's results. Experiments show that CGST significantly outperforms existing sentiment analysis methods on complex sentence datasets (accuracy improved by 3.6%, F1 score improved by 4.78%), and has certain versatility and cross-linguistic capabilities. Attached Figure Description

[0046] Figure 1 This is a diagram illustrating the overall model framework of the complex sentence sentiment analysis method (CGST) based on a coarse-grained hierarchical structure tree proposed in this invention.

[0047] Figure 2 This is an example diagram illustrating the construction process of a coarse-grained hierarchical structure tree.

[0048] Figure 3 The graph shows the model performance at different amounts of connection information.

[0049] Figure 4 This is a case analysis visualization diagram for an embodiment of the present invention. Detailed Implementation

[0050] To make the objectives, technical solutions, and advantages of this invention clearer, the following embodiments will be used in conjunction with the accompanying drawings to further illustrate the invention. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0051] like Figure 1 As shown, the embodiments of the present invention include the following steps:

[0052] 1) Constructing a conjunction information lexicon; the conjunction information in the conjunction information lexicon refers to information in complex sentences that only serves to connect sentences and phrases, and cannot independently constitute sentence components, including punctuation marks or conjunctions. This invention uses LTP to segment approximately 150,000 collected Chinese microblogs, extracting all conjunctions from the corpus and discarding those that appear 5 times or less. After filtering, the conjunctions are manually selected and classified.

[0053] 2) Extracting sentiment modules from complex sentences; the sentiment module refers to the clauses and connecting information in a complex sentence, and each sentiment module typically contains a direct and singular sentiment expression. The specific steps for extracting sentiment modules from complex sentences include:

[0054] (1) Using the connection information lexicon constructed in step 1), the complex sentence is divided into a combination of sentiment modules S = {Nodule1, ..., Nodule}. i ,…,Module 2m+1}, where m represents the number of conjunctions.

[0055] (2) Encode each module in S using BERT to obtain the vector representation H = {H1, ..., H2} of each module. i ,…,H 2m+1In this model, all modules share BERT parameters. To reduce computation and improve model performance, BERT pre-trained on simple sentences (SSD) is used for feature extraction, and the BERT parameters are not used during training.

[0056] (3) Use LSTM to extract the relationship information between sentiment modules in complex sentences and generate a hidden layer representation of sentiment modules with contextual information. Then, attention mechanisms were used to model all modules and extract important emotional modules.

[0057] 3) Constructing a coarse-grained hierarchical structure tree generation model: In the constructed coarse-grained hierarchical structure tree generation model, the input complex sentence is set as x, and the output y is regarded as the hierarchy of connection information. Using Prompt-based learning, the hierarchy of connection information is mapped to the correlation between the two clauses before and after the connection information, and these are scored accordingly. To quantify this hierarchical relationship, a mask [MASK] is added before the connection information, and the pre-trained language model BERT is used for prediction. The official BERT Chinese vocabulary contains 21,128 characters. Only the probabilities of commas and periods are normalized, and the probability of periods is used as the hierarchy information of connection information. The specific calculation method is as follows:

[0058] logits [MASK] =BERT([MASK]|x)

[0059]

[0060] Where i and j represent the numbers corresponding to commas and periods in the vocabulary, and x represents the input text. This invention constructs a coarse-grained hierarchical structure tree according to the hierarchical information in ascending order.

[0061] 4) The hierarchical structure tree is modeled using a graph model; the hierarchical structure tree refers to the coarse-grained hierarchical structure tree generated by the first model of this invention; the graph model refers to the graph attention network model. This invention uses GAT to extract information from the structure tree (e.g., Figure 1 (As shown). The root node of each subtree in the structure tree represents connection information. This connection information, combined with a graph attention model, is used to perform hierarchical modeling of each clause in a complex sentence. Because the connection information mainly consists of conjunctions, and conjunctions, as function words, cannot function as sentence components independently, the model avoids adding self-loops to non-leaf nodes to weaken the connection information. This approach also prevents the loss of information from other nodes.

[0062] In the graph attention model, each node in the tree structure calculates its relevance with all its neighboring nodes. The calculation process for the i-th node in the tree is as follows:

[0063]

[0064]

[0065] where neighbor(i) refers to the neighboring nodes of node i. Neighbour(i) includes node i itself only when i is a leaf node.

[0066] For node i, GAT performs a weighted summation of the hidden states of all its neighboring nodes.

[0067]

[0068] Where l represents the number of layers in the graph attention model. equals H' i The GAT model in this invention has a total of L layers, and the above calculations are repeated in each layer.

[0069] 5) Combine the features of complex sentences with the representation of a coarse-grained tree structure to generate emotional expression; the specific steps are as follows:

[0070] First, utilize the hidden layer representations of important sentiment modules with contextual information extracted in step 2). The attention weight α is obtained through the attention mechanism. i The calculation process is as follows:

[0071] a i =W' T tanh(W m H m +b m ), i∈[1, 2m+1]

[0072]

[0073] Among them, W m b m Here, W' represents the parameters of the linear layer and W' represents the parameters in the attention mechanism network. The hidden states of all modules are weighted and summed to obtain the representation F' of the complex sentence. The calculation process is as follows:

[0074]

[0075] Then, using the modeling of the coarse-grained hierarchical structure tree in step 3), the hidden vector of the root node of the hierarchical structure tree is obtained. This is represented as F”, a complex sentence based on a coarse-grained hierarchical structure tree. The two complex sentence representations are concatenated to obtain the feature representation F of the complex sentence, i.e.: F = Concat(F”; F').

[0076] Finally, a linear layer is used to map the complex sentence features F to a two-dimensional space, and a softmax operation is performed to conduct a binary sentiment classification task. The probability of the output category y can be expressed as:

[0077] p(y|F)=softmax(W T F+b)

[0078] Where W and b are the linear layer weights; y is the model output, which is the predicted sentiment polarity.

[0079] Figure 2 Provide an example of constructing a coarse-grained hierarchical structure tree. For example... Figure 2 As shown, by adding a mask [MASK] before the connection information, the example sentence in the diagram becomes "The delivery person's attitude... felt very entitled [MASK] Not only did they not apologize, but they also... us? [MASK] In short, I am very dissatisfied this time." Then, BERT is used to encode this complex sentence, mapping the hidden state of [MASK] to the vocabulary. Using the Prompt learning approach, the hierarchy of connection information is mapped to the correlation between the two clauses before and after the connection information, and these are scored accordingly. Finally, a coarse-grained hierarchical structure tree in the diagram is constructed according to the ascending order of the hierarchical information.

[0080] Figure 3 The relationship between the accuracy of coarse-grained hierarchical structure tree construction and the amount of connection information is presented. For example... Figure 3 As shown, the more complex the hierarchical relationships in the tree, the higher the error rate. Statistical analysis shows that the coarse-grained hierarchical structure tree construction method of this invention achieves an overall accuracy of 92.88% on 295 random samples, and an accuracy of 84.44% on data with more than one connection.

[0081] To present the construction results more intuitively, this invention analyzes some cases, as shown in Table 1.

[0082] Table 1

[0083]

[0084]

[0085] In Case 1, the first emotional module "not only" leads the two clauses before and after it, and the third emotional module "in short" has the highest level, connecting all the preceding modules and the last emotional module. In Case 2, the first emotional module "but" leads the two clauses before and after it, and the third emotional module "but" leads the first emotional module and the clauses after it. The fifth emotional module "in short" has the highest level, connecting all the preceding modules and the last emotional module. Ultimately, the method of this invention can correctly construct the coarse-grained hierarchical structure tree corresponding to these cases.

[0086] Experimental evaluation of a sentiment analysis method for complex sentences based on a coarse-grained hierarchical tree structure:

[0087] To verify the effectiveness of the complex sentence sentiment analysis method based on a coarse-grained hierarchical structure tree, we tested CGST and baseline models on a complex sentence sentiment dataset. The experimental results are shown in Table 2.

[0088] Bi-LSTM_ATT is based on Bi-LSTM and uses an attention mechanism to capture important parts of the input sequence.

[0089] LSTM_GAT uses LSTM and GAT to encode sentences separately, and finally uses pooling layers for feature fusion. In addition, to reduce noise in the data, LSTM_GAT weakens noun and verb nodes in the graph model.

[0090] BERT-base is Google's official pre-trained Chinese BERT-base model. It directly uses BERT to extract features of complex sentences and uses the output vector of the first flag [CLS] as the feature of the entire complex sentence. Its parameters will be fine-tuned on the training set.

[0091] BERT-base+ITPT is based on BERT-base, and uses the datasets of downstream tasks to pre-train and fine-tune the BERT model again.

[0092] -GAT: Ablation experiment, the GAT model in the model was removed, so that complex sentences are not modeled using a coarse-grained hierarchical structure tree, but feature extraction is directly performed using the attention mechanism between clauses.

[0093] Table 2: Experimental Results of CGST and Baseline Model

[0094] method accuracy F1 value Bi-LSTM_ATT 80.71 69.64 LSTM_GAT 89.14 90.80 BERT-base 91.07 87.37 BERT-base+ITPT 90.47 86.03 -GAT 92.89 90.02 CGST 94.67 92.15

[0095] Compared with all baseline models, CGST achieved the best results in both accuracy and F1 score. This result may be due to several factors: (1) CGST focuses more on the connections between sentiment modules, reducing noise generated during syntactic analysis. (2) By dividing sentiment modules, CGST captures key sentiment information more easily than BERT-base. (3) CGST uses a coarse-grained hierarchical structure tree to hierarchically encode the connection modules in complex sentences, with each connection information modeling only its related clauses, effectively mitigating information loss during sentiment analysis of complex sentences.

[0096] Through overall analysis of the experiment, the following conclusions were drawn: (1) CGST is effective in extracting sentiment from complex sentences using connection information in the hierarchical structure tree. (2) The introduction of hierarchical information can further improve model performance.

[0097] Experimental analysis of the number of connection information:

[0098] Figure 3 This section compares the performance of CGST and BERT models across different numbers of connections. Figure 3 As shown, the CGST proposed in this invention provides improvements on virtually all types of data, and the gains are more significant with a greater number of connection pieces. This is because the more connection pieces exist in a complex sentence, the easier it is for them to form hierarchical relationships.

[0099] BERT is unable to extract the hierarchical relationships between connection information, while CGST uses a coarse-grained hierarchical structure tree to hierarchically model several connection information in complex sentences, and finally uses a graph model to extract these hierarchical relationships, which helps to make up for the loss caused by BERT when facing multiple connection information.

[0100] Case Study:

[0101] Table 3: Case Analysis

[0102]

[0103] Table 3 records representative cases. All three cases involved multiple sentiment co-occurrences, and BERT made incorrect predictions in all of them. In the first two cases, only one conjunction with contrasting information existed, which both the current method and the CGST model predicted correctly. In the third case, multiple conjunctions appeared, and there was a clear hierarchical relationship between them. Only CGST predicted correctly among the three models, which to some extent demonstrates that the hierarchical relationship introduced by CGST to connect information is helpful for sentiment analysis of complex sentences.

[0104] Figure 4 This is a visual analysis of the cases in Table 3. For example... Figure 4 As shown, this invention labels the attention score assigned to each node in the last layer of the graph model onto the corresponding edge. From the perspective of the root node, CGST can assign more weights to clauses expressing important information in complex sentences, which proves the effectiveness of CGST based on a coarse-grained hierarchical structure tree.

[0105] The above experiments and results demonstrate that the present invention has the following advantages and effects compared to existing technologies:

[0106] (1) The case analysis shows that the hierarchical relationship of the connection information extracted by CGST can affect the emotional expression of the entire complex sentence and help to capture the emotional information of the complex sentence.

[0107] (2) As can be seen from the case visualization analysis, CGST makes up for the poor interpretability of deep learning in complex sentence sentiment analysis, and provides a good visual explanation of the results produced by the model.

[0108] (3) Experiments in this invention show that CGST is effective in extracting sentiment from complex sentences using connection information in a hierarchical structure tree. CGST significantly outperforms existing sentiment analysis methods on complex sentence datasets (accuracy improved by 3.6%, F1 score improved by 4.78%), and has certain versatility and cross-linguistic capabilities.

Claims

1. A method for sentiment analysis of complex sentences based on coarse-grained hierarchical tree structure, characterized in that The method comprises the following steps: 1) constructing a connection information word library; 2) extracting the sentiment module in the complex sentence; 3) constructing a coarse-grained hierarchical structure tree generation model, the specific steps are: taking the input complex sentence as x, and taking the output y as the level of connection information, using Prompt-based learning to map the level of connection information to the relevance of the two clauses before and after the connection information, and scoring them accordingly; in order to quantify this hierarchical relationship, a mask [MASK] is added before the connection information, and a pre-trained language model BERT is used for prediction; a coarse-grained hierarchical structure tree is constructed according to the order of hierarchical information from small to large; the official Chinese vocabulary of BERT has a total of 21128 characters, only the probabilities of comma and period are normalized, and the probability of period is taken as the hierarchical information of connection information; the calculation method is as follows: wherein, , representing the number corresponding to the comma and period in the word table, representing the input text; constructing a coarse-grained hierarchical structure tree in order from small to large according to hierarchical information; 4) modeling the hierarchical structure tree using a graph model; The hierarchical structure tree is a coarse-grained hierarchical structure tree generated in step 3); the graph model is a graph attention network model; the information in the structure tree is extracted using GAT; the root node of each subtree in the structure tree is connection information, and each clause level in the complex sentence is modeled by combining connection information and the graph attention model; connection information is mainly composed of conjunctions, and conjunctions, as a kind of virtual word, cannot be used as a sentence component independently; in order to weaken the connection information, the model does not add a self-loop to the non-leaf node to avoid the loss of information of other nodes; In the graph attention model, each node in the structure tree will calculate the relevance with all adjacent nodes; the calculation process of the i-th node in the tree is as follows: Wherein, neighbour(i) refers to the neighbor nodes of node i; only when i is a leaf node, neighbour(i) contains the i node itself; For node i, GAT will weight and sum the hidden states of all neighbor nodes of node i; wherein, representing the number of layers of the graph attention model, is equal to The GAT model has L layers in total, and the above calculation is repeated at each layer. 5) combine the features of the complex sentence with the representation of the coarse-grained structure tree to generate the sentiment expression.

2. The method of claim 1, wherein the method of sentiment analysis of complex sentences based on coarse-grained hierarchical tree structure is characterized by In step 1), the specific steps of constructing the connection information word library are: using LTP to perform word segmentation on the collected Chinese microblog, extracting all conjunctions in the corpus, and discarding those conjunctions with a frequency of 5 times or less; After filtering, 203 conjunctions are obtained; manually screening and classifying conjunctions.

3. The method of claim 1, wherein the method of sentiment analysis of complex sentences based on coarse-grained hierarchical tree structure is characterized by In step 2), the sentiment module refers to the clauses and connection information in the complex sentence, and each sentiment module contains direct and single sentiment expression; the specific steps of extracting the sentiment module in the complex sentence are: (1) using the connection information word bank constructed in step 1) to divide the complex sentence into combinations of sentiment modules wherein represents the number of conjunctions; (2) using BERT to encode each module in , finally obtaining the vector representation of each module , wherein all modules share BERT parameters; in order to reduce the amount of calculation and improve the performance of the model, BERT pre-trained on simple sentences (SSD) is used for feature extraction, and the parameters of BERT are not involved in the training process; (3) Use LSTM to extract the relationship information between the sentiment modules in complex sentences, and generate hidden layer representations of sentiment modules with context information , use attention mechanism to model all modules and extract important sentiment modules.

4. The method of claim 1, wherein the method of sentiment analysis of complex sentences based on coarse-grained hierarchical tree structure is characterized by In step 5), the specific steps of combining the features of the complex sentence with the representation of the coarse-grained structure tree to generate the sentiment expression are: (1) using the hidden layer representation of the important sentiment module with context information extracted in step 2) obtaining attention weights through an attention mechanism The calculation process is as follows: wherein, , is a linear layer parameter, is a parameter in the attention mechanism network; the hidden states of all modules are weighted and summed to obtain the representation of the complex sentence , the calculation process is as follows: (2) using the modeling of the coarse-grained hierarchical structure tree in step 4) to obtain a hidden vector of a root node of the hierarchical structure tree , as the complex sentence based on the coarse-grained hierarchical structure tree , that is: ; the obtained two-part complex sentence representations are spliced to obtain a feature representation of the complex sentence , that is: ; (3) map the complex sentence features F to a two-dimensional space using a linear layer, perform a softmax operation, and sequentially perform a binary sentiment classification task; the probability of output category y is represented as: Wherein, W, b are the weights of the linear layer; y is the output of the model, which is the predicted sentiment polarity.