Aspect triple extraction method based on multi-channel enhanced multi-head graph convolutional network

By using a multi-channel enhanced multi-head graph convolutional network for aspect triple extraction, the problem of insufficient utilization of language feature information in existing technologies is solved, achieving more accurate and stable emotion polarity recognition and improving the semantic representation level and triple extraction performance of the model.

CN120929956APending Publication Date: 2025-11-11XINJIANG NORMAL UNIVERSITY
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511039264.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-28
Publication Date
2025-11-11

AI Technical Summary

Technical Problem

Existing technologies do not fully utilize linguistic and self-attention semantic features, resulting in low accuracy in emotion polarity recognition. Furthermore, traditional GCNs do not adequately learn linguistic features.

Method used

An aspect sentiment triplet extraction method based on a multi-channel enhanced multi-head graph convolutional network is adopted. The contextual representation of the input text is obtained through a pre-trained model, a multilingual feature map is constructed, semantic enhancement features are calculated using a dual affine attention mechanism and a multi-head self-attention mechanism, and feature aggregation is performed by combining a multi-head graph convolutional network to construct a global semantic feature representation. The aspect sentiment triplet is then analyzed through a triangular matrix structure.

Benefits of technology

It improves the model's ability to capture semantic associations in text, enhances the performance of aspect triple extraction, improves the accuracy and stability of emotion polarity recognition, reduces computational overhead, and increases recall.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120929956A_ABST
    Figure CN120929956A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence, in particular to an aspect triple extraction method based on a multi-channel enhanced multi-head graph convolutional network, which comprises the following steps of: encoding an input text by using a pre-training model to obtain context representation; analyzing the text to extract language features, and constructing a multi-language feature map; probability distribution between context representations is obtained through a double-affine attention mechanism, and context semantic enhancement features are calculated through a multi-head self-attention mechanism; then, features are aggregated by using a multi-head graph convolutional network, and global semantic feature representation is obtained; combining the global semantic features with the multi-language feature map, judging word pair matching and calculating emotion polarity probability distribution; and finally, analyzing the aspect emotion triad by adopting a triangular matrix structure, and performing association verification through emotion polarity probability distribution to finally obtain the aspect emotion triad. According to the method, multi-source features and an attention mechanism are effectively fused, and the accuracy and efficiency of aspect emotion triple extraction are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method for extracting aspect triples based on a multi-channel enhanced multi-head graph convolutional network. Background Technology

[0002] With the development of deep learning technology, methods based on pre-trained language models (such as BERT and GPT) have made significant progress in the ASTE task. Pre-trained language models can capture rich contextual information, but some challenges remain, such as:

[0003] In multilingual or cross-lingual scenarios, effectively integrating features from different languages ​​is a challenge. Traditional multilingual models typically achieve this through parameter sharing or translation alignment, but these methods may fail to fully leverage the subtle differences between languages.

[0004] In long texts, long-range dependencies may exist between aspects, attributes, and sentiment polarities. Traditional attention mechanisms and graph neural networks may perform poorly when handling long-range dependencies.

[0005] In practical applications, a distribution shift may occur between training and test data, leading to a decline in model performance. How to mitigate this distribution shift problem is an important research direction.

[0006] This reveals the following problems: existing technologies do not fully utilize linguistic and self-attention semantic features, and traditional GCNs fail to adequately learn linguistic features, resulting in low efficiency in accurately identifying emotion polarity. Summary of the Invention

[0007] To address this, the present invention provides an aspect triple extraction method based on a multi-channel enhanced multi-head graph convolutional network, which overcomes the problems in the prior art that it does not fully utilize language feature information and self-attention semantic feature information, and that traditional GCNs fail to fully learn language feature information, resulting in low efficiency in accurately identifying emotion polarity.

[0008] To achieve the above objectives, this invention provides a method for extracting aspect triples based on a multi-channel enhanced multi-head graph convolutional network, comprising:

[0009] Step S1: Obtain input text containing aspect sentiment information, and encode the input text using a pre-trained model to obtain context representation and hidden context representation;

[0010] Step S2: Parse the input text according to the hidden context representation to extract several language features and construct a multilingual feature map;

[0011] Step S3: Obtain the probability distribution between context representations based on the multilingual feature map using a dual affine attention mechanism;

[0012] Step S4: Calculate the contextual semantic enhancement features of the text using a multi-head self-attention mechanism based on the contextual representation;

[0013] Step S5: Based on the multilingual feature map, the probability distribution, and the contextual semantic enhancement features, a multi-head graph convolutional network is used to perform feature aggregation on the multilingual feature map to obtain a global semantic feature representation;

[0014] Step S6: Combine the global semantic feature representation and the multilingual feature map to determine the word pair matching to obtain a judgment result, and calculate the sentiment polarity probability distribution of the word pair matching based on the judgment result;

[0015] Step S7: Use a triangular matrix structure to perform aspect sentiment triplet analysis to obtain the analysis results, and perform correlation verification based on the said sentiment polarity probability distribution to obtain aspect sentiment triplet.

[0016] Furthermore, the process of step S2 includes:

[0017] The input text is subjected to feature extraction based on language components, dependency types, tree-based distance, and syntactic relative distance to obtain the language features;

[0018] Each word in the input text is considered as a node in a graph, and the various linguistic feature relationships between words are considered as edges, in order to construct an undirected heterogeneous graph;

[0019] The language features are initialized using the hidden context representation based on the undirected heterogeneous graph, and different trainable embedding lookup tables are maintained to obtain the multilingual feature map.

[0020] Furthermore, the process of extracting features from the input text based on language components, dependency types, tree-based distances, and syntactic relative distances to obtain the language features includes:

[0021] The dependency relationships of the input text are parsed to determine the dependency type between each word, and a self-looping edge is added to each node according to the dependency type to represent the dependency type feature of the node;

[0022] The part-of-speech of each word in the input text is analyzed, and the relationships between words with the same part of speech are used as features of language components.

[0023] Construct a grammatical dependency tree, and calculate the distance from each word to its neighboring nodes in the tree to construct tree-based distance-based linguistic feature information;

[0024] Determine the relative distances between nodes in the grammatical dependency tree, and use these relative distances as edges to construct linguistic feature information about grammatical relative distances.

[0025] Furthermore, the process of step S3 includes:

[0026] The word pair relationship features are obtained by concatenating the relationship between each word in the context representation and its corresponding multilingual feature map.

[0027] Based on the word pair relation features, a biaffine function is used to calculate the score vector of the word pair on different relation types;

[0028] Perform exponential calculations on the score vectors of all relation types to obtain the relation score exponential vector;

[0029] The probability distribution is obtained by constructing an adjacency matrix tensor based on the relation score index vector.

[0030] Furthermore, the process of step S4 includes:

[0031] A linear transformation is performed on the context representation to obtain the query vector and the key vector;

[0032] Calculate the product between the query vector and the transpose of the key vector and scale it to obtain a dot product matrix;

[0033] The dot product matrix is ​​normalized to obtain the attention score matrix;

[0034] The attention score matrix is ​​transformed to obtain the attention score for each head;

[0035] All head attention scores are concatenated to obtain the contextual semantic enhancement features.

[0036] Furthermore, the process of step S5 includes:

[0037] Multiple feature subspaces are obtained by multi-channel partitioning based on multilingual feature maps;

[0038] The feature subspace is subjected to topological feature extraction using graph convolution kernels to obtain subspace graph convolution features;

[0039] The convolutional features of all subspace graphs are concatenated to obtain the global semantic feature representation.

[0040] Furthermore, a multi-feature adjacency tensor is constructed based on the multilingual feature map, the probability distribution, and the contextual semantic enhancement features. Positive rule terms are embedded between the multi-feature adjacency tensors to constrain the distribution offset and obtain the word pair relation loss value.

[0041] Furthermore, step S6 includes the following process:

[0042] The word pair representation of the label prediction is obtained by connecting the global semantic representation with the relationship edge representation of the global semantic representation.

[0043] The matching result is obtained by determining the degree of matching between each global semantic feature representation based on the word pair representation;

[0044] The matching results are subjected to linear transformation and normalization to obtain the emotional polarity probability distribution.

[0045] Furthermore, the process of performing linear transformation and normalization on the matching results to obtain the emotion polarity probability distribution includes:

[0046] p ij =softmax(W p s ij +b p )

[0047] Among them, s ij W represents the score indicating the degree of matching between word pairs. p and b p These are trainable weight parameters and bias terms.

[0048] Furthermore, the process of step S7 includes:

[0049] The words in the input text are combined to obtain an upper triangular matrix;

[0050] Candidate aspect terms and candidate opinion terms are selected from the upper triangular matrix based on the probability distribution of the emotion model.

[0051] The candidate aspect terms and the candidate opinion terms are combined to obtain a combined result;

[0052] Based on the combined results, word pairs including the candidate aspect terms and the candidate opinion terms in the upper triangular matrix are retrieved to obtain the association prediction results;

[0053] Determine whether the association prediction result is valid to obtain the aspect sentiment triplet.

[0054] Compared with existing technologies, the advantages of this invention lie in its ability to capture the syntactic and semantic information of text from multiple dimensions by comprehensively extracting features from the input text, including linguistic components, dependency types, tree-based distances, and syntactic relative distances. Constructing an undirected heterogeneous graph with words as nodes and various linguistic feature relationships as edges allows for intuitive and systematic modeling of multiple relationships between words, fully utilizing the information between words and avoiding the potential problem of insufficient modeling of word relationships in traditional methods. This improves the model's ability to capture semantic associations in text and enhances the performance of aspect triple extraction. Initializing linguistic features using hidden context representations and maintaining different trainable embedding lookup tables to represent the edge features of various word pair relationship graphs further refines and enhances the understanding and representation of various linguistic feature relationships in text through training, thereby improving the overall semantic representation level of the model and laying a solid foundation for accurate aspect triple extraction.

[0055] In particular, by concatenating the contextual representation with the relational features in the multilingual feature map, the semantic information of words and the relationships between multiple linguistic features can be comprehensively considered, making the word pair relational features richer and more comprehensive. Utilizing a biaffine function to calculate the score vectors of word pairs on different relation types can effectively capture the complex relationships between word pairs and improve the accuracy of word pair relation prediction. Performing exponential calculation on the score vectors and constructing an adjacency matrix tensor can transform the score of word pair relations into a probability distribution form, more intuitively reflecting the relative probability of word pairs belonging to different relation types.

[0056] In particular, by using multiple attention heads, semantic information in the context can be captured from different angles and levels. Each head can focus on different semantic features or different relationships between words, thus gaining a more comprehensive understanding of the semantic structure of the text. The multi-head self-attention mechanism provides the model with richer expressive power, enabling it to better model complex linguistic phenomena. For example, when dealing with tasks such as long-distance dependency, disambiguation, and semantic role labeling, the multi-head self-attention mechanism can provide more accurate semantic representations.

[0057] In particular, features in different subspaces represent different levels of semantic information, ranging from local word pair relationships to global semantic structures. This hierarchical feature representation helps the model better understand and model complex semantic relationships in text, improving its ability to comprehend the overall semantics of the text.

[0058] In particular, embedding regularization terms to constrain distribution shifts makes the distribution of the fused feature relation tensor more stable. During training, regularization terms prevent the model from over-relying on or ignoring certain features, avoiding excessive fluctuations in feature distribution and thus improving model stability and generalization ability. The multi-feature adjacency tensor, which integrates multiple features, can more comprehensively characterize the relationships between word pairs. In the prediction phase, based on this more accurate feature representation, the model can more accurately determine the matching and sentiment polarity of word pairs, thereby improving the accuracy of triple extraction.

[0059] In particular, by concatenating the global semantic feature representation with the relation edge representation, a richer word pair representation is constructed. This representation not only includes the semantic information of individual words but also the features relating them, enabling the model to more comprehensively understand the semantic information in the text and thus improve the accuracy of word pair relationship judgment. Processing the word pair representation with a matching model allows for accurate determination of the matching degree between each global semantic feature representation. The matching model can learn complex matching patterns between word pairs based on the rich feature information in the word pair representation, thereby improving the accuracy of the matching results.

[0060] In particular, by using the sentiment polarity probability distribution to filter candidate aspect terms and opinion terms from the upper triangular matrix, the model can quickly focus on word pairs with potential sentimental connections, improving model efficiency and reducing unnecessary computational overhead. By combining candidate aspect terms and opinion terms, the model can generate a variety of possible aspect-opinion pairs. This flexible combination strategy helps discover potential sentimental relationships in the text, improving the model's recall. Attached Figure Description

[0061] Figure 1 This is a flowchart illustrating the aspect triple extraction method based on a multi-channel enhanced multi-head graph convolutional network provided by the present invention.

[0062] Figure 2 This is a flowchart illustrating step S2 in the aspect triple extraction method based on a multi-channel enhanced multi-head graph convolutional network provided by the present invention.

[0063] Figure 3 This is a flowchart illustrating step S3 in the aspect triple extraction method based on a multi-channel enhanced multi-head graph convolutional network provided by the present invention.

[0064] Figure 4 This is a flowchart illustrating step S4 of the aspect triplet extraction method based on a multi-channel enhanced multi-head graph convolutional network provided by the present invention. Detailed Implementation

[0065] To make the objectives and advantages of the present invention clearer, the present invention will be further described below with reference to embodiments; it should be understood that the specific embodiments described herein are merely for explaining the present invention and are not intended to limit the present invention.

[0066] Preferred embodiments of the present invention will now be described with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are merely illustrative of the technical principles of the present invention and are not intended to limit the scope of protection of the present invention.

[0067] It should be noted that in the description of this invention, the terms "upper", "lower", "left", "right", "inner", "outer", etc., which indicate directions or positional relationships, are based on the directions or positional relationships shown in the accompanying drawings. This is only for the convenience of description and is not intended to indicate or imply that the device or element must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation of this invention.

[0068] Furthermore, it should be noted that, in the description of this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0069] Please see Figure 1 As shown, this invention provides a method for extracting aspect triples based on a multi-channel enhanced multi-head graph convolutional network, comprising:

[0070] Step S1: Obtain input text containing aspect sentiment information, and encode the input text using a pre-trained model to obtain context representation and hidden context representation;

[0071] Step S2: Parse the input text according to the hidden context representation to extract several language features and construct a multilingual feature map;

[0072] Step S3: Obtain the probability distribution between context representations based on the multilingual feature map using a dual affine attention mechanism;

[0073] Step S4: Calculate the contextual semantic enhancement features of the text using a multi-head self-attention mechanism based on the contextual representation;

[0074] Step S5: Based on the multilingual feature map, the probability distribution, and the contextual semantic enhancement features, a multi-head graph convolutional network is used to perform feature aggregation on the multilingual feature map to obtain a global semantic feature representation;

[0075] Step S6: Combine the global semantic feature representation and the multilingual feature map to determine the word pair matching to obtain a judgment result, and calculate the sentiment polarity probability distribution of the word pair matching based on the judgment result;

[0076] Step S7: Use a triangular matrix structure to perform aspect sentiment triplet analysis to obtain the analysis results, and perform correlation verification based on the said sentiment polarity probability distribution to obtain aspect sentiment triplet.

[0077] Specifically, the process involves acquiring raw text (sentences or paragraphs) containing latent sentiment information. A pre-trained BERT model is then used to process the input text. BERT generates a context-sensitive vector representation for each word (token) in the text. The output of the last layer of the BERT model is used as the context representation for each word (i.e., the hidden context representation H = {h1, h2, ..., hn}). These representations contain rich information about the word itself and its surrounding context. In detail, the BERT model generates a fixed-dimensional vector representation for each word based on the contextual relationships between words in the text, capturing the semantic information of the word in a specific context.

[0078] Specifically, by explicitly constructing multiple linguistic features into a graph structure and modeling it using a graph convolutional network, this approach captures the complex grammatical and semantic relationships between words more deeply and comprehensively than traditional methods, overcoming the shortcomings of simply relying on sequence labeling or implicit feature extraction. Combining dual affine attention and multi-head self-attention mechanisms, it not only focuses on the explicit relationships between words but also captures the implicit importance of words in the sentence context and their interactions, generating richer and more discriminative global semantic feature representations. The aspect-opinion implicit matching mechanism directly utilizes the potential semantic connections between aspect terms and opinion terms, enabling the model to focus more on word pairs that truly express emotional polarity, improving matching accuracy. Through these multi-layered enhanced features and precise matching, the model can more effectively identify the emotional polarity implied in word combinations, significantly improving the accuracy of emotion polarity identification.

[0079] Specifically, such as Figure 2 As shown, the process of step S2 includes:

[0080] Step S21: Extract language features from the input text by considering language components, dependency types, tree-based distance, and syntactic relative distance;

[0081] Specifically, the process of extracting language features from the input text by considering language components, dependency types, tree-based distances, and syntactic relative distances to obtain the language features includes:

[0082] The dependency relationships of the input text are parsed to determine the dependency type between each word, and a self-looping edge is added to each node according to the dependency type to represent the dependency type feature of the node;

[0083] The part-of-speech of each word in the input text is analyzed, and the relationships between words with the same part of speech are used as features of language components.

[0084] Construct a grammatical dependency tree, and calculate the distance from each word to its neighboring nodes in the tree to construct tree-based distance-based linguistic feature information;

[0085] Determine the relative distances between nodes in the grammatical dependency tree, and use these relative distances as edges to construct linguistic feature information about grammatical relative distances.

[0086] Specifically, natural language processing tools (such as Stanford CoreNLP) are used to perform dependency parsing on the input text. Dependency parsing identifies the grammatical structure in the sentence, determines the dependency relationships between words, and thus obtains the dependency type between each word. For example, in the sentence "The quick brown fox jumps over the lazy dog," dependency parsing can determine that there is a subject-verb relationship (nsubj) between "fox" and "jumps," and an attributive relationship (amod) between "dog" and "lazy." When constructing the graph structure, a self-loop edge is added to each node, and this self-loop edge is labeled with the dependency type to represent the dependency type feature of the node. Each word in the input text is tagged with part-of-speech, and the relationships between words with the same part of speech are used as linguistic component features. For example, all nouns are considered as one type of linguistic component relationship, and all verbs are considered as another type of linguistic component relationship. In this way, the combination and collocation of words with different parts of speech in the sentence can be reflected. A grammatical dependency tree is constructed, with words in the sentence as nodes and dependency relationships as edges to build a tree structure. In a grammatical dependency tree, the distance from each word to its neighboring nodes is calculated, which represents the minimum number of edges required to travel from one word to another along the tree's edges. For example, in a grammatical dependency tree, a word might be 1 distance from its parent node and 2 distances from its sibling node. Using these distances as tree-based linguistic features reflects the hierarchical position of words within the grammatical structure and their proximity to each other. The relative distances between nodes in the grammatical dependency tree are then determined, representing the relative positional relationship between two words. For example, the depth difference between two words in the tree, or the depth of their nearest common ancestor node, can all serve as metrics for relative distance. Constructing grammatical relative distance linguistic features using these relative distances as edges further enriches the semantic connotation of the relationships between words.

[0087] Step S22: Treat each word in the input text as a node in a graph, and treat the various linguistic feature relationships between words as edges, in order to construct an undirected heterogeneous graph;

[0088] Specifically, in the graph, nodes represent words, and edges represent specific linguistic feature relationships between words. For example, for dependency type features, one graph is constructed where edges represent dependency type relationships between words; for linguistic component features, another graph is constructed where edges represent part-of-speech relationships between words, and so on. Each graph has its own set of nodes and edge set. The set of nodes is the set of all words in the input text, and the set of edges is determined according to the corresponding linguistic feature relationships.

[0089] Step S23: Initialize the language features using the hidden context representation based on the undirected heterogeneous graph and maintain different trainable embedding lookup tables to obtain the multilingual feature map.

[0090] Specifically, hidden context representations are used to initialize the linguistic features of each node. These hidden context representations contain the semantic information of each word within its context, serving as the initial feature vector for the node and providing a rich semantic foundation for subsequent feature learning. Simultaneously, different trainable embedding lookup tables are maintained for each type of linguistic feature relationship (edge). Each lookup table corresponds to a linguistic feature relationship, and the edge type can be mapped to a trainable embedding vector through the lookup table, thus obtaining the edge's feature representation. In this way, node features and edge features together constitute a multilingual feature map, where node features represent the semantic information of words, and edge features represent the various linguistic feature relationships between words.

[0091] Specifically, by comprehensively extracting features from the input text, including linguistic components, dependency types, tree-based distances, and grammatical relative distances, the model can capture syntactic and semantic information from multiple dimensions. Constructing an undirected heterogeneous graph with words as nodes and various linguistic feature relationships as edges allows for an intuitive and systematic modeling of multiple relationships between words, fully utilizing the information between words and avoiding the potential problem of insufficient modeling of word relationships in traditional methods. This improves the model's ability to capture semantic associations in text and enhances the performance of aspect triple extraction. Hidden context representations are used to initialize linguistic features, and different trainable embedding lookup tables are maintained to represent the edge features of various word pair relationship graphs. Through training, the understanding and representation of various linguistic feature relationships in text are further refined and enhanced, thereby improving the overall semantic representation level of the model and laying a solid foundation for accurate aspect triple extraction.

[0092] Specifically, such as Figure 3 As shown, the process of step S3 includes:

[0093] Step S31: Concatenate the relationship between each word in the context representation and its corresponding multilingual feature map to obtain word pair relationship features;

[0094] Step S32: Based on the word pair relation features, use a biaffine function to calculate the score vector of the word pair on different relation types;

[0095] Step S33: Perform exponential calculation on the score vectors of all relation types to obtain the relation score exponential vector;

[0096] Step S34: Construct an adjacency matrix tensor based on the relation score index vector to obtain the probability distribution.

[0097] Specifically, a dual affine attention mechanism is used to obtain the probability distribution among all context word pairs of the input text. The implementation process of the dual affine attention mechanism is shown in formulas (1)-(5):

[0098]

[0099] R ba =Biaffine(MLP) a (h i MLP o (h j (5)

[0100] MLP stands for Multilayer Perceptron, h i and h j The context representation and score vector obtained through BERT encoding. It represents w i and w j The relationship between them, where m represents the type of relationship, and r... i,j,k Represents word pairs (w i ,w j The relation score index vector of the k-th relation type, and the adjacency matrix tensor. The relationships between words were modeled. U1, U2, and b represent the trainable weights and biases, respectively. Representing the connection, the implementation process of formula (5) consists of formulas (1)-(4). The main content of Biaffine(·) consists of formulas (3) and (4), the purpose of which is to obtain h. i and h j The probability distribution of the dependencies between them.

[0101] Specifically, by concatenating contextual representations with relational features in multilingual feature maps, the semantic information of words and the relationships between multiple linguistic features can be comprehensively considered, making word pair relational features richer and more comprehensive. Utilizing biaffine functions to calculate score vectors for word pairs across different relation types effectively captures the complex relationships between word pairs, improving the accuracy of word pair relation prediction. Performing exponential calculations on the score vectors and constructing an adjacency matrix tensor transforms the word pair relation scores into a probability distribution, more intuitively reflecting the relative likelihood of word pairs belonging to different relation types.

[0102] Specifically, such as Figure 4 As shown, the process of step S4 includes:

[0103] Step S41: Perform a linear transformation on the context representation to obtain the query vector and the key vector;

[0104] Step S42: Calculate the product between the query vector and the transpose of the key vector and scale it to obtain a dot product matrix;

[0105] Step S43: Normalize the dot product matrix to obtain the attention score matrix;

[0106] Step S44: Transform the attention score matrix to obtain the attention score for each head;

[0107] Step S45: Concatenate all head attention scores to obtain the contextual semantic enhancement feature. Specifically, a multi-head self-attention mechanism is used to obtain the score matrix of the context sentence and regard it as a contextual semantic enhancement feature. The specific process can be formalized as shown in formulas (6)-(8).

[0108]

[0109] head i =weight(HW) q HW k )

[0110] R sem =contact(head1,head2,...,head i ) 8

[0111] Where Q and K represent the query and key of the multi-head self-attention mechanism, respectively, d K The dimension representing K is weight(Q, K), and weight(Q, K) represents the self-attention score obtained. i Let H represent the i-th head attention score, where H represents the context representation output of the last layer of the pre-trained BERT model, and W represents the context representation. q and W kR represents the transformation matrices for the query and the key, respectively. sem This represents the attention score for all heads, where the number of heads equals the number of categories. `contact(·)` represents the connection function.

[0112] Specifically, by using multiple attention heads, semantic information in the context can be captured from different angles and levels. Each head can focus on different semantic features or different relationships between words, thus gaining a more comprehensive understanding of the semantic structure of the text. The multi-head self-attention mechanism provides the model with richer expressive power, enabling it to better model complex linguistic phenomena. For example, when dealing with tasks such as long-distance dependency, disambiguation, and semantic role labeling, the multi-head self-attention mechanism can provide more accurate semantic representations.

[0113] Specifically, step S5 includes the following process:

[0114] Multiple feature subspaces are obtained by multi-channel partitioning based on multilingual feature maps;

[0115] The feature subspace is subjected to topological feature extraction using graph convolution kernels to obtain subspace graph convolution features;

[0116] The convolutional features of all subspace graphs are concatenated to obtain the global semantic feature representation.

[0117] Specifically, the input features are partitioned into orthogonal subspaces, i.e., feature subspaces, using multi-channel partitioning. Each subspace extracts local topological features through graph convolution kernels with independent weights. Finally, the information from all convolutional subgraphs is concatenated and aggregated into all feature information using fully connected layers. The specific structure is as follows: Figure 4 As shown in the figure, the implementation process is as shown in formula (9).

[0118]

[0119] Where σ represents the ReLU activation function, k represents the number of heads in the multi-head graph convolutional network, R represents the graph structure matrix of the corresponding feature information, H represents the context representation encoded by BERT, and W... k and b k This represents the trainable weights and biases.

[0120] Specifically, in order to model the relationships between words in the input text, the adjacency matrix obtained by the multilingual feature map, the probability distribution, and the contextual semantic enhancement features is extended. Each channel represents the modeling of various inter-word relationships in Table 1. Finally, information is aggregated along the corresponding channels of each word node. The specific process is as shown in formulas (10)-(12).

[0121]

[0122] Where f(·) represents the average pooling function, which performs feature compression on the node representation through average pooling operation, and simultaneously fuses the global information of the edges through concatenation operation. and Let R represent the node representation and edge representation of a word pair, respectively. ba R represents the probability distribution between context representations. psc ,R dep ,R tbd ,R snd The language features are represented as language composition features, grammatical dependency features, tree-based distance features, and grammatical relative distance features.

[0123] Table 1. Meaning of the Ten Relationships

[0124]

[0125] Specifically, features in different subspaces represent different levels of semantic information, ranging from local word pair relationships to global semantic structure. This hierarchical feature representation helps the model better understand and model complex semantic relationships in text, improving its ability to comprehend the overall semantics of the text.

[0126] Specifically, a multi-feature adjacency tensor is constructed based on the multilingual feature map, the probability distribution, and the contextual semantic enhancement features. Positive rule terms are embedded between the multi-feature adjacency tensors to constrain the distribution offset and obtain the word pair relation loss value.

[0127] Specifically, to accurately capture the relationships between words, the multilingual feature map, the probability distribution, and the contextual semantic enhancement features are used to construct a multi-feature adjacency tensor. Regularization terms are then embedded between these hybrid representation adjacency tensors to constrain the distribution shift, resulting in a word pair relationship loss value. as well as Specifically, as shown in formula (13).

[0128]

[0129] in Represents the index function, y i,j It is a word pair (w i ,w j The actual value of ), where c represents a pre-defined set of relation tags. ijk This represents the representation of the relation edge.

[0130] Specifically, embedding regularization terms to constrain distribution shifts makes the distribution of the fused feature relation tensor more stable. During training, regularization terms prevent the model from over-relying on or ignoring certain features, avoiding excessive fluctuations in feature distribution and thus improving model stability and generalization ability. The multi-feature adjacency tensor, which integrates multiple features, can more comprehensively characterize the relationships between word pairs. In the prediction phase, based on this more accurate feature representation, the model can more accurately determine the matching and sentiment polarity of word pairs, thereby improving the accuracy of triple extraction.

[0131] Specifically, step S6 includes the following process:

[0132] The word pair representation of the label prediction is obtained by connecting the global semantic representation with the relationship edge representation of the global semantic representation.

[0133] The matching result is obtained by determining the degree of matching between each global semantic feature representation based on the word pair representation;

[0134] The matching results are subjected to linear transformation and normalization to obtain the emotional polarity probability distribution.

[0135] Specifically, the process of performing linear transformation and normalization on the matching results to obtain the emotion polarity probability distribution includes:

[0136] p ij =softmax(W p s ij +b p )

[0137] Among them, s ij W represents the score indicating the degree of matching between word pairs. p and b p These are trainable weight parameters and bias terms.

[0138] Specifically, the feature vector of each word in the global semantic feature representation is concatenated with the feature vector of the corresponding relation edge in the multilingual feature map to obtain the word pair representation for label prediction. Specifically, for each word i in the global semantic feature representation, the feature vector ri of its corresponding relation edge in the multilingual feature map is concatenated with the word's global semantic feature vector gi to form the word pair representation ci = [gi; ri]. In this way, the word pair representation contains both the global semantic information of the word and the relationship features between that word and other words. All word pair representations are input into a matching model to determine the degree of matching between each global semantic feature representation, obtaining the matching result. The matching model can be a simple linear classifier or a complex neural network model such as a multilayer perceptron. The model's output represents the score or degree of matching of the word pair on different relation types, i.e., the matching result. For example, a dual affine attention mechanism can be used to calculate the degree of matching between word pairs, as shown in the following formula:

[0139] s ij =W·MLP(c i ,c j +b)

[0140] Where W is the trainable weight matrix, b is the bias term, MLP stands for Multilayer Perceptron, used for nonlinear transformation of word pair representations, and s ij The score represents the degree of matching between word pairs i and j.

[0141] The matching results are linearly transformed and normalized to obtain the sentiment polarity probability distribution. The linear transformation can be implemented using a fully connected layer, mapping the matching results to the sentiment polarity label space. Normalization typically uses the softmax function to convert the linearly transformed result into a probability distribution. The formula is as follows:

[0142] p ij =softmax(W p .s ij +b p )

[0143] Among them, s ij The score represents the degree of matching between word pairs. Wp is the weight matrix for sentiment polarity classification, bp is the bias term, and p ij It is the probability distribution of word pairs under different emotional polarities.

[0144] Specifically, the standard cross-entropy function is used as the loss function of the model as shown in Equation (4-13), and the global loss is calculated as shown in Equation (14).

[0145]

[0146] in The loss is the word pair's prediction of sentiment polarity, and α, β, and γ are used to adjust the corresponding relation constraint losses.

[0147] Specifically, a richer word pair representation is constructed by concatenating the global semantic feature representation with the relation edge representation. This representation not only includes the semantic information of individual words but also the features relating them, enabling the model to more comprehensively understand the semantic information in the text and thus improve the accuracy of word pair relationship judgment. Processing the word pair representation with a matching model allows for accurate determination of the matching degree between each global semantic feature representation. The matching model can learn complex matching patterns between word pairs based on the rich feature information in the word pair representation, thereby improving the accuracy of the matching results.

[0148] Specifically, step S7 includes the following process:

[0149] The words in the input text are combined to obtain an upper triangular matrix;

[0150] Candidate aspect terms and candidate opinion terms are selected from the upper triangular matrix based on the probability distribution of the emotion model.

[0151] The candidate aspect terms and the candidate opinion terms are combined to obtain a combined result;

[0152] Based on the combined results, word pairs including the candidate aspect terms and the candidate opinion terms in the upper triangular matrix are retrieved to obtain the association prediction results;

[0153] Determine whether the association prediction result is valid to obtain the aspect sentiment triplet.

[0154] Specifically, the words in the input text are combined to form an upper triangular matrix. The rows and columns of the matrix represent the words in the text, and the matrix elements represent the relationships or features between corresponding word pairs. For example, for a text containing n words, an n×n upper triangular matrix is ​​constructed, where the matrix element (i,j) (i≤j) represents the relationship or feature between word i and word j. Based on the sentiment polarity probability distribution, possible candidate aspect terms and candidate opinion terms are identified from the upper triangular matrix. The sentiment polarity probability distribution provides the probability that word pairs belong to different sentiment polarities. By setting a threshold or using other screening strategies, word pairs with higher sentiment polarity probabilities are selected as candidate aspect terms and opinion terms. The candidate aspect terms and candidate opinion terms are combined to form various possible combinations. These combinations represent possible aspect-opinion pairs, providing a basis for subsequent association prediction. Based on the combination results, word pairs containing candidate aspect terms and candidate opinion terms are retrieved from the upper triangular matrix. These word pairs and their corresponding sentiment polarity probability distributions constitute the association prediction results. The validity of the association prediction results is determined to identify the final aspect sentiment triplet. Validity can be determined by setting a threshold for the probability of emotion polarity or other rules. Only when the association prediction result meets certain conditions (such as the probability of emotion polarity being higher than the threshold) is it identified as a valid aspect sentiment triple.

[0155] Specifically, by using the sentiment polarity probability distribution to filter candidate aspect terms and opinion terms from the upper triangular matrix, the model can quickly focus on word pairs with potential sentimental connections, improving efficiency and reducing unnecessary computational overhead. By combining candidate aspect terms and opinion terms, the model can generate a variety of possible aspect-opinion pairs. This flexible combination strategy helps discover potential sentimental relationships in the text, improving the model's recall.

[0156] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will all fall within the scope of protection of the present invention.

[0157] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for extracting aspect triples based on a multi-channel enhanced multi-head graph convolutional network, characterized in that, include: Step S1: Obtain input text containing aspect sentiment information, and encode the input text using a pre-trained model to obtain context representation and hidden context representation; Step S2: Parse the input text according to the hidden context representation to extract several language features and construct a multilingual feature map; Step S3: Obtain the probability distribution between context representations based on the multilingual feature map using a dual affine attention mechanism; Step S4: Calculate the contextual semantic enhancement features of the text using a multi-head self-attention mechanism based on the contextual representation; Step S5: Based on the multilingual feature map, the probability distribution, and the contextual semantic enhancement features, a multi-head graph convolutional network is used to perform feature aggregation on the multilingual feature map to obtain a global semantic feature representation; Step S6: Combine the global semantic feature representation and the multilingual feature map to determine the word pair matching to obtain a judgment result, and calculate the sentiment polarity probability distribution of the word pair matching based on the judgment result; Step S7: Use a triangular matrix structure to perform aspect sentiment triplet analysis to obtain the analysis results, and perform correlation verification based on the said sentiment polarity probability distribution to obtain aspect sentiment triplet.

2. The aspect triple extraction method based on a multi-channel enhanced multi-head graph convolutional network according to claim 1, characterized in that, The process of step S2 includes: The input text is subjected to feature extraction based on language components, dependency types, tree-based distance, and syntactic relative distance to obtain the language features; Each word in the input text is considered as a node in a graph, and the various linguistic feature relationships between words are considered as edges, in order to construct an undirected heterogeneous graph; The language features are initialized using the hidden context representation based on the undirected heterogeneous graph, and different trainable embedding lookup tables are maintained to obtain the multilingual feature map.

3. The aspect triple extraction method based on a multi-channel enhanced multi-head graph convolutional network according to claim 2, characterized in that, The process of extracting language features from the input text by considering language components, dependency types, tree-based distance, and syntactic relative distance includes: The dependency relationships of the input text are parsed to determine the dependency type between each word, and a self-looping edge is added to each node according to the dependency type to represent the dependency type feature of the node; The part-of-speech of each word in the input text is analyzed, and the relationships between words with the same part of speech are used as features of language components. Construct a grammatical dependency tree, and calculate the distance from each word to its neighboring nodes in the tree to construct tree-based distance-based linguistic feature information; Determine the relative distances between nodes in the grammatical dependency tree, and use these relative distances as edges to construct linguistic feature information about grammatical relative distances.

4. The aspect triple extraction method based on a multi-channel enhanced multi-head graph convolutional network according to claim 3, characterized in that, The process of step S3 includes: The word pair relationship features are obtained by concatenating the relationship between each word in the context representation and its corresponding multilingual feature map. Based on the word pair relation features, a biaffine function is used to calculate the score vector of the word pair on different relation types; Perform exponential calculations on the score vectors of all relation types to obtain the relation score exponential vector; The probability distribution is obtained by constructing an adjacency matrix tensor based on the relation score index vector.

5. The aspect triple extraction method based on a multi-channel enhanced multi-head graph convolutional network according to claim 4, characterized in that, The process of step S4 includes: A linear transformation is performed on the context representation to obtain the query vector and the key vector; Calculate the product between the query vector and the transpose of the key vector and scale it to obtain a dot product matrix; The dot product matrix is ​​normalized to obtain the attention score matrix; The attention score matrix is ​​transformed to obtain the attention score for each head; All head attention scores are concatenated to obtain the contextual semantic enhancement features.

6. The aspect triple extraction method based on a multi-channel enhanced multi-head graph convolutional network according to claim 5, characterized in that, The process of step S5 includes: Multiple feature subspaces are obtained by multi-channel partitioning based on multilingual feature maps; The feature subspace is subjected to topological feature extraction using graph convolution kernels to obtain subspace graph convolution features; The convolutional features of all subspace graphs are concatenated to obtain the global semantic feature representation.

7. The aspect triple extraction method based on a multi-channel enhanced multi-head graph convolutional network according to claim 6, characterized in that, A multi-feature adjacency tensor is constructed based on the multilingual feature map, the probability distribution, and the contextual semantic enhancement features. Positive rule terms are embedded between the multi-feature adjacency tensors to constrain the distribution offset and obtain the word pair relation loss value.

8. The aspect triple extraction method based on a multi-channel enhanced multi-head graph convolutional network according to claim 7, characterized in that, The process of step S6 includes: The word pair representation of the label prediction is obtained by connecting the global semantic representation with the relationship edge representation of the global semantic representation. The matching result is obtained by determining the degree of matching between each global semantic feature representation based on the word pair representation; The matching results are subjected to linear transformation and normalization to obtain the emotion polarity probability distribution.

9. The aspect triple extraction method based on a multi-channel enhanced multi-head graph convolutional network according to claim 8, characterized in that, The process of performing linear transformation and normalization on the matching results to obtain the emotion polarity probability distribution includes: p ij =softmax(W p s ij +b p ) Among them, s ij W represents the score indicating the degree of matching between word pairs. p and b p These are trainable weight parameters and bias terms.

10. The aspect triple extraction method based on a multi-channel enhanced multi-head graph convolutional network according to claim 9, characterized in that, The process of step S7 includes: The words in the input text are combined to obtain an upper triangular matrix; Candidate aspect terms and candidate opinion terms are selected from the upper triangular matrix based on the probability distribution of the emotion model. The candidate aspect terms and the candidate opinion terms are combined to obtain a combined result; Based on the combined results, word pairs including the candidate aspect terms and the candidate opinion terms in the upper triangular matrix are retrieved to obtain the association prediction results; Determine whether the association prediction result is valid to obtain the aspect sentiment triplet.

Citation Information

Cited By

  • Emotion triple extraction method and system fused with bottleneck convolution

    CN121390079A