Double-feature enhanced aspect emotion triple extraction method based on graph neural network
By employing a dual-feature enhancement method using graph neural networks, combined with graph convolution and Transformer modules, the problems of insufficient utilization of syntactic information and weak semantic modeling ability in aspect sentiment triple extraction are addressed. This results in more accurate and complete aspect sentiment triple extraction, improving the model's accuracy and robustness.
Patent Information
- Application Number
- CN202511567758.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-30
- Publication Date
- 2026-02-03
AI Technical Summary
Existing graph neural networks suffer from insufficient utilization of syntactic information and weak semantic modeling capabilities in aspect sentiment triple extraction. In particular, they are prone to oversmoothing during multi-layer propagation, making it difficult to correctly match aspect terms and opinion terms.
A dual-feature enhancement method based on graph neural networks is adopted, which combines syntactic structure and topological distance information through graph convolution and Transformer modules to enhance node features, and uses the span inference algorithm to decode and extract aspect sentiment triples.
It effectively overcomes the problems of insufficient utilization of syntactic information and weak semantic modeling ability, improves the extraction accuracy and robustness of the model under complex syntactic structures, significantly enhances the ability to extract aspect sentiment triples, and has high computational efficiency and low resource consumption.
Smart Images

Figure CN121456802A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of sentiment analysis, and more particularly to a method for extracting aspect sentiment triples based on graph neural networks with dual feature enhancement. Background Technology
[0002] Aspect-based sentiment analysis (ABSA) is an important research direction in natural language processing, belonging to fine-grained sentiment analysis tasks.
[0003] As a key subtask of ABSA, Aspect Sentiment Triplet Extraction (ASTE) not only identifies specific aspects and their sentiment tendencies but also mines opinion terms that support these sentiment judgments. This task aims to extract structured information from sentences, including aspect terms, opinion-expressing terms, and their corresponding sentiment tendencies. Through structured representation and fine-grained parsing, ASTE enables a more accurate understanding and analysis of textual sentiment. However, the biggest challenge of ASTE is the difficulty in correctly matching one-to-many or many-to-many relationships between aspect terms and opinion terms. Many studies have used graph neural networks to address this problem. These networks construct sentences into graph structures, effectively utilizing the sentence's syntactic structure. Graph neural network methods map each word in a sentence to a node in a graph, directly connecting aspect terms and opinion terms through syntactic dependency relations.
[0004] Existing GNN research can be divided into two categories: methods based on static graph structures and methods based on dynamic graph structures. Methods based on static graph structures parse the syntactic structure of sentences through external dependencies and construct a graph structure, using message passing mechanisms to capture information from neighboring nodes. This allows for explicit use of syntactic structure to enhance the grammatical association between aspect words and opinion words. However, they suffer from oversmoothing during training, meaning that node representations tend to become more consistent as the number of layers increases. The effectiveness of static graph structure methods largely depends on the parsing performance of the syntax, while the graph in dynamic graph structure methods is automatically learned by the model. However, dynamic graph structure-based methods generally lack linear modeling capabilities and struggle to preserve the contextual semantic information of sentences. Summary of the Invention
[0005] To overcome the above-mentioned shortcomings, the present invention aims to provide a method for extracting aspect sentiment triples based on graph neural networks with dual feature enhancement, thereby improving the semantic extraction capability through a dual feature enhancement mechanism.
[0006] This invention achieves the above objective through the following scheme: a dual-feature enhanced aspect sentiment triple extraction method based on graph neural networks, comprising the following steps:
[0007] (1) Input text Encode and concatenate the data, perform dimensionality transformation, and output the features;
[0008] (2) Convolve the feature input graph to the relevant module to enhance the graph structure features, and use the orthogonal constraint method to expand the features of the nodes;
[0009] (3) Integrate the syntactic structure and topological distance information of the graph into the Transformer module as a graph neighbor enhancement module to obtain enhanced term features;
[0010] (4) Construct the tag information of text words and use the span reasoning algorithm to decode term features to obtain the final aspect sentiment triplet.
[0011] Preferably, step (1) specifically includes:
[0012] (1.1) Use a pre-trained language model as an encoder to process the input text. Transform into a representation that includes contextual semantics. Use external dependency analysis tools to generate part-of-speech information for words. And use MLP for encoding:
[0013] ;
[0014] (1.2) The contextual semantic representation information and part-of-speech information are concatenated and put into the MLP for dimensionality transformation to output features. :
[0015] .
[0016] Preferably, step (2) specifically includes:
[0017] (2.1) Use syntactic parsing tools to obtain the syntactic graph structure for any word pair. The calculation formula is as follows:
[0018] ;
[0019] (2.2) A multi-layer graph convolutional network is used to enable each node to obtain information from the surrounding nodes, and the orthogonal constraint method is used to expand the features between nodes. The calculation formula is as follows:
[0020]
[0021] in Indicates the first The node feature matrix of the layer, initial input for , It is a non-linear activation function. It is the first The learnable linear transformation matrix of the layer, For adjustable orthogonal hyperparameters, It is the identity matrix. For the Frobenius norm, These are learnable weight coefficients. It is the feature decorrelation loss, which together with the main task loss constitutes the final total loss function;
[0022] (2.3) Features after convolution of the graph The input layer normalization and nonlinear activation modules, after passing through L layers, yield graph-enhanced feature representations. :
[0023] .
[0024] Preferably, the syntactic graph structure uses each word of the text as a node and syntactic relations as edges.
[0025] Preferably, step (3) specifically includes:
[0026] (3.1) Calculate the Q, K, and V matrices:
[0027]
[0028] in These are the learnable projection matrices;
[0029] (3.2) Calculate the syntactic edge encoding and topological distance coding :
[0030]
[0031] in It is a syntactic edge offset. It is a topological distance bias. For hyperparameters, and These represent the i-th and j-th nodes, respectively. The embedding function is the topological distance.
[0032] (3.3) Encode the syntactic edges and topological distance coding By incorporating the Transformer module into the self-attention computation as a graph neighbor enhancement, enhanced term features are obtained. :
[0033]
[0034] in Scaling factor This represents the dimension of the attention vector.
[0035] Preferably, step (4) specifically includes:
[0036] (4.1) Each node is labeled in two dimensions. The first dimension includes aspect terms, opinion terms, or terms that do not belong to the above categories. The second dimension includes sentiment tendencies and terms that do not belong to the above categories.
[0037] (4.2) Use the span reasoning algorithm to expand the span, expand adjacent identical tags to obtain all aspect terms and opinion terms, as well as the corresponding sentiment tendencies;
[0038] (4.3) Extract aspect terms, opinion terms, and sentiment tendencies into aspect sentiment triplets for the text.
[0039] Preferably, the emotional inclination includes positive, neutral, and negative.
[0040] Preferably, the use of the span reasoning algorithm for term features Decoding yields all aspect terms, viewpoint terms, and corresponding sentiments.
[0041] Preferably, step (4.3) specifically includes: pairing the aspect terms, opinion terms and corresponding sentiment tendencies obtained in step (4.2) with the two-dimensional markers in step (4.1) to obtain all aspect terms and opinion terms of the text, as well as the corresponding sentiment tendencies, and extracting the aspect terms, opinion terms and sentiment tendencies as aspect sentiment triplets of the text.
[0042] The beneficial effects of this invention are as follows: By introducing a dual-feature enhancement mechanism into the graph neural network framework, it effectively overcomes the balance problem between insufficient utilization of syntactic information and weak semantic modeling ability in traditional aspect sentiment triple extraction methods. It alleviates the oversmoothing problem in the multi-layer propagation process of graph neural networks. It achieves deep fusion of graph structural information and linear contextual semantics, effectively enhancing the model's ability to model long-distance dependencies. Through dual-feature fusion, this invention achieves superior accuracy and robustness compared to existing methods on multiple datasets, enabling more accurate and complete aspect sentiment triple extraction under complex syntactic structures, significantly enhancing the extraction ability of aspect terms and opinion terms. Furthermore, it boasts high computational efficiency and low resource consumption, possessing high practical application value and promising prospects for widespread adoption. Attached Figure Description
[0043] Figure 1 This is a flowchart illustrating the method of the present invention;
[0044] Figure 2 This is a flowchart illustrating step 1 of the present invention;
[0045] Figure 3 This is a flowchart illustrating the graph neighbor enhancement Transformer module;
[0046] Figure 4 This is a schematic diagram illustrating the effect of the emotion triplet extraction marker in this invention. Detailed Implementation
[0047] The present invention will be further described below with reference to specific implementation examples, but the scope of protection of the present invention is not limited thereto:
[0048] Example: Figure 1 As shown, the aspect sentiment triple extraction method based on graph neural networks with dual feature enhancement includes the following steps:
[0049] (1) Input text Encode and concatenate the text, perform dimensional transformation, and output the text. Sentence characteristics.
[0050] like Figure 2 As shown, the specific items include:
[0051] (1.1) Use a pre-trained language model as an encoder to process the input text. Transform into a representation that includes contextual semantics. Use external dependency analysis tools to generate part-of-speech information for words. And use MLP for encoding:
[0052] ;
[0053] (1.2) The contextual semantic representation information and part-of-speech information are concatenated and put into the MLP for dimensionality transformation to output features. :
[0054] .
[0055] (2) Convolve the feature input graph to the relevant module to enhance the graph structure features, and use the orthogonal constraint method to expand the features of the nodes.
[0056] This step performs graph structure feature enhancement on the output of step (1), specifically including:
[0057] (2.1) Obtain the syntactic graph structure using a syntactic parsing tool, where each word in the sentence is a node and syntactic relations are edges. For any word pair... The calculation formula is as follows:
[0058] ;
[0059] (2.2) A multi-layer graph convolutional network is used to enable each node to obtain information from the surrounding nodes. To alleviate the problem of oversmoothing, an orthogonal constraint method is designed to expand the features between nodes. The calculation formula is as follows:
[0060]
[0061] in Indicates the first The node feature matrix of the layer, initial input for , It is a non-linear activation function. It is the first The learnable linear transformation matrix of the layer, For adjustable orthogonal hyperparameters, It is the identity matrix. For the Frobenius norm, These are learnable weight coefficients. It is the feature decorrelation loss, which together with the main task loss constitutes the final total loss function;
[0062] (2.3) Features after convolution of the graph Input layer normalization and nonlinear activation modules improve the training stability of the model, and after L layers, a graph-enhanced feature representation is obtained. :
[0063]
[0064] (3) The syntactic structure and topological distance information of the graph are integrated into the Transformer module as a graph neighbor enhancement module to obtain enhanced term features.
[0065] like Figure 3 As shown, the specific items include:
[0066] (3.1) Calculate the Q, K, and V matrices for subsequent encoding calculations. The result after L layers of graph convolution in section 2.3:
[0067]
[0068] in These are the learnable projection matrices;
[0069] (3.2) Calculate the syntactic edge encoding and topological distance coding :
[0070]
[0071] in It is a syntactic edge offset. It is a topological distance bias. For hyperparameters, and These represent the i-th and j-th nodes, respectively. The embedding function is the topological distance.
[0072] (3.3) Encode the syntactic edges and topological distance coding By incorporating the Transformer module into the self-attention computation as a graph neighbor enhancement, enhanced term features are obtained. :
[0073]
[0074] in Scaling factor This represents the dimension of the attention vector.
[0075] (4) Construct the tag information of text words and use the span reasoning algorithm to decode term features to obtain the final aspect sentiment triplet.
[0076] Specifically, this includes:
[0077] (4.1) Each node is labeled in two dimensions. The first dimension includes aspect terms (A), opinion terms (O), or terms that do not belong to the above categories (N). The second dimension is sentiment and terms that do not belong to the above categories (N). The sentiment includes positive (POS), neutral (NEU), and negative (NEG).
[0078] (4.2) Use the span reasoning algorithm to analyze term features Decode the span by expanding adjacent identical tags to obtain all aspect terms and opinion terms, as well as the corresponding sentiment (if the second dimension of the tag is not N).
[0079] (4.3) Pair the aspect terms, opinion terms and corresponding sentiments obtained in step (4.2) with the two-dimensional markers in step (4.1) to obtain all aspect terms and opinion terms of the text, as well as the corresponding sentiments. Extract the aspect terms, opinion terms and sentiments as aspect sentiment triples of the text.
[0080] like Figure 4 As shown, the input text X={The,food,was,excellent} is enhanced by the dual features in steps (1)-(3). The term feature is decoded using the span reasoning algorithm. Two-dimensional label pairing is performed on {The,food,was,excellent}. The is labeled as NN, which is invalid content. Food is labeled as AN, which indicates that it is an aspect term. Was is labeled as NN, which is invalid content. Excellent is labeled as O-POS, which indicates that it is an opinion term and expresses a positive sentiment tendency. The aspect sentiment triplet of the sentence is extracted as (food, excellent, POS).
[0081] The above description describes specific embodiments of the present invention and the technical principles employed. Any changes made in accordance with the concept of the present invention that do not exceed the spirit of the specification and drawings should still fall within the protection scope of the present invention.
Claims
1. A method for extracting aspect sentiment triples based on dual-feature enhancement using graph neural networks, characterized in that... Includes the following steps: (1) Input text Encode and concatenate the data, perform dimensionality transformation, and output the features; (2) Convolve the feature input graph to the relevant module to enhance the graph structure features, and use the orthogonal constraint method to expand the features of the nodes; (3) Integrate the syntactic structure and topological distance information of the graph into the Transformer module as a graph neighbor enhancement module to obtain enhanced term features; (4) Construct the tag information of text words and use the span reasoning algorithm to decode term features to obtain the final aspect sentiment triplet.
2. The method for extracting aspect sentiment triples based on graph neural networks with dual feature enhancement according to claim 1, characterized in that, Step (1) specifically includes: (1.1) Use a pre-trained language model as an encoder to process the input text. Transform into a representation that includes contextual semantics. Use external dependency analysis tools to generate part-of-speech information for words. And use MLP for encoding: , ; (1.2) The contextual semantic representation information and part-of-speech information are concatenated and put into the MLP for dimensionality transformation to output features. : , 。 3. The aspect sentiment triple extraction method based on graph neural networks with dual feature enhancement according to claim 1, characterized in that, Step (2) specifically includes: (2.1) Use syntactic parsing tools to obtain the syntactic graph structure for any word pair. The calculation formula is as follows: ; (2.2) A multi-layer graph convolutional network is used to enable each node to obtain information from the surrounding nodes, and the orthogonal constraint method is used to expand the features between nodes. The calculation formula is as follows: ,in Indicates the first The node feature matrix of the layer, initial input for , It is a non-linear activation function. It is the first The learnable linear transformation matrix of the layer, For adjustable orthogonal hyperparameters, It is the identity matrix. For the Frobenius norm, These are learnable weight coefficients. It is the feature decorrelation loss, which together with the main task loss constitutes the final total loss function; (2.3) Features after convolution of the graph The input layer normalization and nonlinear activation modules, after passing through L layers, yield graph-enhanced feature representations. : 。 4. The method for extracting aspect sentiment triples based on graph neural networks with dual feature enhancement according to claim 3, characterized in that, The syntactic graph structure consists of each word in the text as a node and syntactic relations as edges.
5. The method for extracting aspect sentiment triples based on graph neural networks with dual feature enhancement according to claim 1, characterized in that, Step (3) specifically includes: (3.1) Calculate the Q, K, and V matrices: ,in These are the learnable projection matrices; (3.2) Calculate the syntactic edge encoding and topological distance coding : ,in It is a syntactic edge offset. It is a topological distance bias. For hyperparameters, and These represent the i-th and j-th nodes, respectively. The embedding function is the topological distance. (3.3) Encode the syntactic edges and topological distance coding By incorporating the Transformer module into the self-attention computation as a graph neighbor enhancement, enhanced term features are obtained. : ,in Scaling factor This represents the dimension of the attention vector.
6. The method for extracting aspect sentiment triples based on graph neural networks with dual feature enhancement according to claim 1, characterized in that, Step (4) specifically includes: (4.1) Each node is labeled in two dimensions. The first dimension includes aspect terms, opinion terms, or terms that do not belong to the above categories. The second dimension includes sentiment tendencies and terms that do not belong to the above categories. (4.2) Use the span reasoning algorithm to expand the span, expand adjacent identical tags to obtain all aspect terms and opinion terms, as well as the corresponding sentiment tendencies; (4.3) Extract aspect terms, opinion terms, and sentiment tendencies into aspect sentiment triplets for the text.
7. The method for extracting aspect sentiment triples based on graph neural networks with dual feature enhancement according to claim 6, characterized in that, The emotional inclinations mentioned include positive, neutral, and negative.
8. The method for extracting aspect sentiment triples based on graph neural networks with dual feature enhancement according to claim 6, characterized in that... The use of the span reasoning algorithm for term features Decoding yields all aspect terms, viewpoint terms, and corresponding sentiments.
9. The method for extracting aspect sentiment triples based on graph neural networks with dual feature enhancement according to claim 6, characterized in that, The specific steps (4.3) include: pairing the aspect terms, opinion terms and corresponding sentiment tendencies obtained in step (4.2) with the two-dimensional markers in step (4.1) to obtain all aspect terms and opinion terms of the text, as well as the corresponding sentiment tendencies, and extracting the aspect terms, opinion terms and sentiment tendencies as aspect sentiment triplets of the text.