An aspect-level sentiment analysis method of a dual-channel hypergraph convolution fusing external knowledge
Patent Information
- Application Number
- CN202610451061.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-08
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2046-04-08
AI Technical Summary
[0004]综上所述,尽管现有工作在方面级情感分析中取得了出色效果,但仍存在两个主要技术瓶颈:首先,传统图神经网络受限于节点间的二元连接,在处理复杂的语义或语法多元关系时,难以捕捉高阶关联特征,容易导致信息丢失;其次,现有方法过度依赖单一的句法路径,在处理长距离依赖时容易造成关键情感信息阻断,且未能深度、动态地融入外部先验知识的引导,难以有效应对复杂的隐式情感表达与一词多义现象
[0028]Compared with existing technologies, the beneficial effects of this invention are as follows: This invention introduces a hypergraph structure into aspect-level sentiment analysis. By leveraging the characteristic of hyperedges connecting any number of nodes, it overcomes the limitation of traditional graph structures, which can only model binary relationships, and effectively captures higher-order many-to-many interaction relationships between words. Simultaneously, the introduction of WordNet knowledge graphs in the semantic channel alleviates the semantic deficiency problem caused by rare words and polysemy; in the grammatical channel, the sentiment hyperedges constructed using sentiment prior knowledge (SenticNet) enable sentiment words with the same sentiment polarity to interact directly across long distances, shortening the path of sentiment signals. Furthermore, for the semantic and grammatical features extracted from both channels, a gated fusion mechanism adaptively filters noise while preserving the important context of the original text, significantly enhancing the perception and reasoning ability for complex implicit sentiment expressions and improving classification accuracy.
Smart Images

Figure CN122311220B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of aspect-based sentiment analysis, and specifically relates to a method based on graph neural networks and external knowledge enhancement. Specifically, it proposes an aspect-based sentiment analysis method that integrates external knowledge through dual-channel hypergraph convolution. Background Technology
[0002] Sentiment analysis, a fundamental task in natural language processing, aims to uncover the emotional tendencies inherent in text. With the increasing sophistication of applications, traditional document-level or sentence-level sentiment analysis can no longer meet the demands for fine-grained analysis, as a single sentence may contain multiple evaluation objects with potentially diametrically opposed sentiment polarities. Therefore, aspect-level sentiment analysis has emerged, with its core objective being to identify the sentiment polarity of each aspect word in a given sentence.
[0003] Early aspect-level sentiment analysis research primarily relied on manually labeled features combined with traditional machine learning techniques. With the development of deep learning, methods based on recurrent neural networks and their variants became mainstream. However, these sequential methods treat sentences as linear structures, making it difficult to effectively capture long-distance dependencies. To address the limitations of sequential methods, graph convolutional networks based on syntactic dependency trees became popular. These networks construct graph structures based on syntactic dependency trees, thereby shortening the distance between aspect words and context sentiment words. However, traditional graph convolutional networks typically use average or linear weighting when aggregating information, leading to irrelevant nodes introducing noise and weakening feature representations. Although subsequent graph attention networks enhanced the ability to capture key information through dynamic weights, their core computation is still limited by the binary interaction characteristics of graph structures, making it difficult to capture higher-order relevance in natural language. Furthermore, purely data-driven methods often lack robustness and generalization ability when faced with polysemy, obscure words, implicit sentiment, or domain-specific expressions. While introducing external prior knowledge such as sentiment dictionaries and knowledge graphs is an effective way to enhance semantic understanding and sentiment reasoning capabilities, existing methods still face significant challenges in how to efficiently integrate structured external knowledge with deep networks and fully explore the complementary information of semantics and syntax.
[0004] In summary, although existing work has achieved excellent results in aspect-level sentiment analysis, there are still two major technical bottlenecks: First, traditional graph neural networks are limited by binary connections between nodes, making it difficult to capture high-order relational features when dealing with complex semantic or grammatical multivariate relationships, which can easily lead to information loss; second, existing methods rely too much on a single syntactic path, which can easily cause the blockage of key sentiment information when dealing with long-distance dependencies, and they fail to deeply and dynamically integrate the guidance of external prior knowledge, making it difficult to effectively deal with complex implicit sentiment expressions and polysemy. Summary of the Invention
[0005] To address the problems of existing technologies, this invention proposes an aspect-level sentiment analysis method that integrates external knowledge with dual-channel hypergraph convolution. This method effectively breaks through the limitations of binary graph connectivity, captures higher-order semantics, and deeply integrates external knowledge graphs and sentiment dictionaries to efficiently and accurately predict the sentiment polarity of aspect words.
[0006] This invention is achieved through the following technical solution: an aspect-level sentiment analysis method based on dual-channel hypergraph convolution that integrates external knowledge, comprising the following steps: Step 1 Text Encoding: BERT-PT, enhanced with domain knowledge, is used as the text encoder to convert the input text sequence into initial word embedding vectors; Constructing the input sequence of BERT ,in For sentence text, For aspect terms; the sequence is input into the BERT-PT encoder, which outputs the initial embedding vector of the sentence. ,in It refers to sentence length. It is the embedding dimension, and the formula is as follows:
[0007] in, It is the input sequence. It refers to sentence length. It is the embedded dimension.
[0008] Step 2 Semantic Feature Extraction: In the semantic channel, BiLSTM is used to extract the hidden state of the context, and a semantic hypergraph association matrix is constructed by combining self-attention and aspect word attention mechanisms; at the same time, external knowledge embeddings are obtained by using WordNet knowledge graph, which are fused with the context representation as the initial node features, and high-order semantic features are extracted by semantic hypergraph convolutional network. The initial embedding vector is input into the BiLSTM of the semantic channel, and the forward and backward hidden states are concatenated to obtain the semantic context representation. The whole is represented as ;Will The self-attention score matrix is calculated using both query and key values. The formula is as follows:
[0009] in, , The weight matrix is a learnable matrix. The dimension of the key vector, and the scaling factor. This is used to prevent gradient vanishing due to excessively large dot product values. Subsequently, aspect word features are extracted and average pooling is performed to obtain... Expanded into a matrix Post-compute aspect-based attention matrix The formula is as follows:
[0010] in, , The weight matrix is a learnable matrix. It is a learnable bias term. It is a term used to indicate aspects; The semantic attention score is obtained by fusing the self-attention score and the aspect word attention score. To construct a global semantic hyperedge matrix , of which elements ; and combined with the semantic hyperedge matrix of aspect terms The semantic hypergraph association matrix is obtained by concatenating the matrices. ; Obtain the embedding vector of the input word in the external knowledge graph WordNet. , with context representation The initial node representation is obtained by splicing. ; Calculate relevance weights using the dot product attention mechanism The enhanced node features are obtained by weighting the features. The formula is as follows:
[0011] in, words indicating aspects and words Attention weights and These are the aspect terms and sentence representations after knowledge embedding, respectively. The weighted text features This is the scaling factor.
[0012] All of Constructing the enhanced node feature matrix Finally, a semantic hypergraph convolutional network is used for feature update. l+1 Semantic node feature representation of a layer The calculation formula is as follows:
[0013] in, For semantic hypergraph association matrix, and For the node and hyperedge degree matrix, It is the hyperedge weight matrix. It is the first l Learnable weight parameters of the layer It is the ReLU nonlinear activation function.
[0014] Step 3: Syntactic Feature Extraction: In the syntactic channel, another set of BiLSTMs is used to extract the hidden state of the syntactic context. Based on the syntactic dependency tree, SenticNet sentiment dictionary and the relative distance between words, a syntactic hypergraph association matrix containing global syntactic hyperedges, aspect lexical syntactic hyperedges and sentiment polarity hyperedges is constructed. Then, a syntactic hypergraph convolutional network is used to extract syntactic features that fuse syntactic and sentiment signals. The initial embedding vector is input into the BiLSTM of the grammar channel to generate a hidden state sequence containing grammar context information. ; Construct a dependency relation weighted matrix D based on the syntactic dependency tree, and assign weights to adjective modifiers (amod) and adverb modifiers (advmod). Other dependencies have a weight of 1.0, as shown in the following formula:
[0015] in, Indicator and Types of dependency relationships between them;
[0016] Calculate the sentiment score matrix using SenticNet Combine aspect-based keyword enhancement matrix The global syntax hyperedge matrix is obtained. :
[0017] in, This is a dependency matrix. For the sentiment score matrix, Enhance the matrix for aspect terms; Subsequently, a lexical hyperedge matrix is constructed by combining dependency relations. The formula is as follows:
[0018] in, This is a relative position weighting function, designed to give higher attention to context words that are closer to the relative word. For words The sentiment score in the sentiment dictionary, and Respectively represent words and aspect words Absolute position index in a sentence; Set emotional threshold Words with SenticNet scores greater than 0.5 and less than -0.5 are selected, and hyper-edge matrices of positive and negative sentiment polarity are constructed by combining distance weights. :
[0019] In this column, the pos column corresponds to the positive sentiment hyperedge, and the neg column corresponds to the negative sentiment hyperedge.
[0020] Global Syntax Hyperedge Matrix Aspect-based lexical hyperedge matrix and the emotional polarity hyperedge matrix The hypergraph correlation matrix is obtained by concatenating the hyperedge dimensions. After processing with a syntactic hypergraph convolution, a syntactic representation that integrates deep syntactic structure and sentiment features is obtained. :
[0021] in, For semantic hypergraph association matrix, and For the node and hyperedge degree matrix, It is the hyperedge weight matrix. It is the first l Learnable weight parameters of the layer It is the ReLU nonlinear activation function.
[0022] Step 4 Adaptive Gated Fusion: The semantic features, syntactic features, and original text features are adaptively weighted and fused through a gated fusion mechanism to obtain the final features of the aspect words in the multi-view fusion. Using aspect term mask semantic features grammatical features and original text features Perform average pooling to extract specific representations of aspect terms:
[0023] in, This represents the average pooling function. When the first i The value is 1 if the word is an aspect term, otherwise it is 0. These represent semantic, grammatical, and original text-related aspects of word features, respectively. Through linear transformation and the Sigmoid activation function Calculate the gating coefficients and perform element-wise weighting on the features. :
[0024] in, and These are the learnable weight matrix and the bias term, respectively. For the Sigmoid function, This represents element-wise multiplication; The weighted features are concatenated to obtain the final fused feature representation used for sentiment classification. ; Step 5 Sentiment Classification: Input the final features of aspect words into a fully connected layer for linear mapping, and then use the Softmax function to calculate the probability distribution of aspect words in each sentiment category, and output the sentiment polarity category with the highest score; Fusion features Inputting the fully connected layer yields the predicted probability distribution of the sentiment category. :
[0025] in, and These are the weight matrix and bias term of the classifier, respectively.
[0026] The cross-entropy loss function is used for training to correctly predict the sentiment polarity of aspect words, as shown in the following formula:
[0027] in, The total number of training samples, For the number of emotion categories, For the predicted sentiment probability, This is a label representing the true polarity of emotions.
[0028] Compared with existing technologies, the beneficial effects of this invention are as follows: This invention introduces a hypergraph structure into aspect-level sentiment analysis. By leveraging the characteristic of hyperedges connecting any number of nodes, it overcomes the limitation of traditional graph structures, which can only model binary relationships, and effectively captures higher-order many-to-many interaction relationships between words. Simultaneously, the introduction of WordNet knowledge graphs in the semantic channel alleviates the semantic deficiency problem caused by rare words and polysemy; in the grammatical channel, the sentiment hyperedges constructed using sentiment prior knowledge (SenticNet) enable sentiment words with the same sentiment polarity to interact directly across long distances, shortening the path of sentiment signals. Furthermore, for the semantic and grammatical features extracted from both channels, a gated fusion mechanism adaptively filters noise while preserving the important context of the original text, significantly enhancing the perception and reasoning ability for complex implicit sentiment expressions and improving classification accuracy. Attached Figure Description
[0029] Figure 1 System architecture diagram of an aspect-level sentiment analysis method that integrates external knowledge through dual-channel hypergraph convolution; Figure 2 : A model structure diagram of an aspect-level sentiment analysis method that integrates external knowledge through dual-channel hypergraph convolution; Figure 3 : A schematic diagram of the information transfer process in hypergraph convolution. Detailed Implementation
[0030] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0031] An aspect-level sentiment analysis method incorporating external knowledge through dual-channel hypergraph convolution, the process of which is as follows: Figure 1 As shown, it includes the specific algorithm details. Meanwhile, the overall model structure corresponding to the method proposed in this invention is as follows: Figure 2 As shown, the model mainly includes a dual-channel architecture for parallel processing, specifically encompassing: a text encoding layer, a semantic channel, a syntactic channel, a gated fusion layer, and a final sentiment classification layer. The specific algorithm steps are as follows: Step 1. Text encoding.
[0032] The task of this invention is defined as follows: given a text sequence containing n words... And a sequence of aspect words a containing m words, predicting the sentiment polarity of aspect word a.
[0033] like Figure 2As shown in the text encoding module on the left, BERT-PT enhanced with domain knowledge is first used as the text encoder to convert the input text sequence into an initial word embedding vector. Constructing the input sequence of BERT ,in For sentence text, For aspect terms; the sequence is input into the BERT-PT encoder, which outputs the initial embedding vector of the sentence. ,in It refers to sentence length. It is the embedding dimension, and the formula is as follows:
[0034] in, It is the input sequence. It refers to sentence length. It is the embedded dimension.
[0035] Step 2. Semantic feature extraction.
[0036] Step 2.1 Context Feature Extraction: Input the initial embedding vector X into a bidirectional long short-term memory (BiLSTM) network to generate a hidden state vector containing positive and negative context information, as shown in the following formula:
[0037] in, and These represent the forward and backward hidden states of the i-th word, respectively. For words Contextual representation; These are the learnable parameters of the LSTM. The semantic context representation of the sentence is obtained by concatenating the forward and backward hidden states. ,in is the dimension of the LSTM hidden layer.
[0038] Step 2.2 Constructing the semantic hypergraph association matrix: combining Figure 2 As shown in the "Semantic Hypergraph" branch in the upper part, this step extracts features through self-attention and aspect word attention mechanisms, respectively. Specifically, it extracts the input context features. As a query and key-value pair in the self-attention mechanism, the self-attention score matrix is calculated. The formula is as follows:
[0039] in, , The weight matrix is a learnable matrix. The dimension of the key vector, and the scaling factor. This is used to prevent the gradient from vanishing due to excessively large dot product values.
[0040] To make the semantic hypergraph focus more on aspect words, aspect word features are extracted and average pooling is performed to obtain... Expanded into a matrix Post-compute aspect-based attention matrix The formula is as follows:
[0041] in, , The weight matrix is a learnable matrix. It is a learnable bias term. It is a term used to indicate aspects; The semantic attention score is obtained by fusing the self-attention score and the aspect word attention score. To construct a global semantic hyperedge matrix , of which elements .
[0042] Extract the part corresponding to the aspect word index from the semantic attention score S, and aggregate it through average pooling to obtain a vector representing the overall association strength between the aspect word and other words in the sentence. This vector constitutes the semantic hyperedge matrix of the aspect term. .
[0043] The global semantic hyperedge matrix and the aspect word semantic hyperedge matrix are concatenated along the hyperedge dimension to obtain the semantic hypergraph association matrix. :
[0044] Step 2.3 WordNet Knowledge Graph Augmentation: Obtain the embedding vector of the input word in the external knowledge graph WordNet by searching the pre-trained WordNet embedding matrix. If a word is not in the graph, it is filled with a zero vector. This is then combined with the context representation. The initial node representation is obtained by splicing. ; Calculate relevance weights using the dot product attention mechanism The enhanced node features are obtained by weighting the features. The formula is as follows:
[0045] in, words indicating aspects and words Attention weights and These are the aspect terms and sentence representations after knowledge embedding, respectively. The weighted text features This is the scaling factor.
[0046] Then all of them Constructing the enhanced node feature matrix , as the initial input for hypergraph convolution .
[0047] Step 2.4 Semantic Hypergraph Convolution: Define the Node Degree Matrix and hypermarginality matrix Both are diagonal matrices, and their diagonal elements are calculated as follows:
[0048] in, Indicates the first j The weight of each superedge, Represents the nodes in the incidence matrix i With super-edge j Connection weights.
[0049] The hypergraph convolution information transfer process in this invention is as follows: Figure 3 As shown, the hypergraph structure breaks the binary connection limitation of traditional graphs, allowing a single hyperedge to connect any number of nodes simultaneously. Hypergraph convolution employs a two-stage message passing mechanism: "node-hyperedge-node." In the first stage, nodes aggregate their feature information onto the hyperedges they are connected to; in the second stage, the hyperedges distribute the fused higher-order information back to each node, achieving feature updates. After multiple convolutional operations, a final node feature representation that fully integrates higher-order association information is obtained. Specifically, the... l+1 Semantic node feature representation of a layer The calculation formula is as follows:
[0050] in, For semantic hypergraph association matrix, It is the hyperedge weight matrix. and For the node and hyperedge degree matrix, It is the first l Learnable weight parameters of the layer It is the ReLU non-linear activation function. After L layers of convolution, it outputs the final high-order semantic feature representation. .
[0051] Step 3. Extraction of grammatical features.
[0052] Step 3.1 Context Feature Extraction: Considering the difference in the distribution of semantic and syntactic features in the latent space, a separate BiLSTM network is used in the syntactic channel to extract syntactic-related context features. The initial embedding vector is input into the BiLSTM of the syntactic channel to generate a hidden state sequence containing syntactic context information. .
[0053] Step 3.2 Construct the syntactic hypergraph association matrix: (e.g.) Figure 2 The lower part, the "Syntax Hypergraph" branch, shows that the model extracts syntactic dependency relations between words in a sentence, as well as SenticNet sentiment lexicon information. Specifically, it uses a syntax parsing tool to obtain a syntactic dependency tree, constructs a dependency relation weighted matrix D, and sets weights for adjective modification (amod) and adverb modification (advmod). Other dependencies have a weight of 1.0, as shown in the following formula:
[0054] in, Indicator and The types of dependency relationships between them. By assigning higher weight to modifying relationships, we can more keenly capture the modifying effect of sentiment modifiers on aspect words.
[0055] Calculate the sentiment score matrix using the SenticNet sentiment dictionary The formula is as follows:
[0056] in, The sentiment score for each word in the sentiment dictionary. A value close to 1 indicates strong positive emotions; conversely, when... A value close to -1 indicates a strong negative emotion; when A value of 0 indicates that the word is neutral or that the word does not exist in the sentiment dictionary.
[0057] To focus more on aspect terms and enhance the emotional dependence between aspect terms and other terms, an aspect term enhancement matrix is constructed. :
[0058] Based on the above dependency matrix Emotional Score Matrix and aspect-word enhancement matrix The final global grammar hyperedge incidence matrix is obtained. The formula is as follows:
[0059] The aspect term itself, its first-order neighbors in the syntactic tree, and the second-order neighbors of the negation relation (neg) are included to capture the most basic syntactic context and preserve negation semantics. Based on the above node set, an aspect term syntactic hyperedge association matrix is defined by combining sentiment intensity and relative position information. :
[0060] in, This is a relative position weighting function, designed to give higher attention to context words that are closer to the relative word. For words The sentiment score in the sentiment dictionary, and Respectively represent words and aspect words Absolute position index in a sentence.
[0061] Set emotional threshold Words with SenticNet scores greater than 0.5 and less than -0.5 are selected, and hyper-edge matrices of positive and negative sentiment polarity are constructed by combining distance weights. :
[0062] in, pos The column corresponds to the positive sentiment superedge. neg The column corresponds to the negative emotion superedge. Indicator The relative distance weight to the term center is calculated using the following formula:
[0063] in, This is the index of the center position of the aspect term sequence.
[0064] Global Syntax Hyperedge Matrix Aspect-based lexical hyperedge matrix and the emotional polarity hyperedge matrix The hypergraph correlation matrix is obtained by concatenating the hyperedge dimensions. The formula is as follows:
[0065] Step 3.3 Syntax Hypergraph Convolution: with As the initial node representation Perform syntax hypergraph convolution processing, as shown in the following formula:
[0066] in, For semantic hypergraph association matrix, and For the node and hyperedge degree matrix, It is the hyperedge weight matrix. It is the first l Learnable weight parameters of the layer It is the ReLU nonlinear activation function.
[0067] After L layers of convolution, a grammatical feature representation that integrates deep grammatical structure and sentiment features is obtained. .
[0068] Step 4. Adaptive gating fusion.
[0069] like Figure 2 As shown in the right-hand fusion stage, after hypergraph convolution processing of semantic and syntactic channels, the output high-order features need to be aggregated with the original text encoding features. Considering that the contribution of semantic information, syntactic structure, and original context to sentiment discrimination varies in different language scenarios, simple feature concatenation or addition is difficult to achieve optimal information complementarity. Therefore, a gating fusion mechanism is used to adaptively learn the importance weights of features in each channel.
[0070] First, regarding semantic features grammatical features and original text features Using aspect mask Perform average pooling to obtain specific representations of aspect terms:
[0071] in, This represents the average pooling function. When the first i The value is 1 if the word is an aspect term, otherwise it is 0. These represent semantic, syntactic, and primitive aspect feature vectors, respectively.
[0072] Subsequently, a gating mechanism is introduced to learn the confidence level of each feature. Gating coefficients are calculated using a linear transformation and a sigmoid activation function, and the features are then weighted element-wise.
[0073] in, , , and , , These are the learnable weight matrix and the bias term, respectively. For the Sigmoid function, This indicates element-wise multiplication.
[0074] Finally, the three weighted feature vectors are concatenated to obtain the final fused feature representation O used for sentiment classification:
[0075] in, These are the aspect word features ultimately used for sentiment classification.
[0076] Step 5. Sentiment Classification.
[0077] like Figure 2 As shown in the sentiment classification module on the right, after obtaining the aspect word features O from multi-view fusion through a gating mechanism, these features are input into a fully connected layer for linear mapping. Subsequently, the probability distribution of each sentiment category is calculated using the softmax function, as shown in the following formula:
[0078] in, and These are the weight matrix and bias term of the classifier, respectively, and C represents the number of categories representing sentiment polarity (3 in this method, i.e., positive, negative, and neutral). This represents the predicted sentiment probability distribution. Finally, the category with the highest probability is selected as the sentiment prediction label for that category of words.
[0079] The cross-entropy loss function is used for training to correctly predict the sentiment polarity of aspect words, as shown in the following formula:
[0080] in, The total number of training samples, For the number of emotion categories, For the predicted sentiment probability, This is a label representing the true polarity of emotions.
Claims
1. A method for aspect-level sentiment analysis using dual-channel hypergraph convolution that integrates external knowledge, characterized in that, Includes the following steps: Step 1 Text Encoding: BERT-PT, enhanced with domain knowledge, is used as the text encoder to convert the input text sequence into an initial embedding vector; Step 2 Semantic Feature Extraction: In the semantic channel, BiLSTM is used to extract the contextual hidden state, and a semantic hypergraph association matrix is constructed by combining self-attention and aspect word attention mechanisms; external knowledge embeddings are obtained with the WordNet knowledge graph, and after being fused with the context representation, they are used as the initial node features, and high-order semantic features are extracted through the semantic hypergraph convolutional network. Step 3: Syntactic Feature Extraction: In the syntactic channel, another set of BiLSTMs is used to extract the hidden state of the syntactic context. Based on the syntactic dependency tree, SenticNet sentiment dictionary and the relative distance between words, a syntactic hypergraph association matrix containing global syntactic hyperedges, aspect lexical syntactic hyperedges and sentiment polarity hyperedges is constructed. Then, a syntactic hypergraph convolutional network is used to extract syntactic features that fuse syntactic and sentiment signals. The specific method is as follows: The initial embedding vector is input into the BiLSTM of the grammar channel to generate a hidden state sequence containing grammar context information. ; Construct a dependency relation weighted matrix D based on the syntactic dependency tree, and assign weights of adjective modifier (amod) and adverb modifier (advmod) to each. Other dependencies have a weight of 1.0, as shown in the following formula: ; in, Indicator and Types of dependency relationships between them; Calculate the sentiment score matrix using SenticNet Combine aspect-based keyword enhancement matrix The global syntax hyperedge matrix is obtained. : ; in, This is a dependency matrix. For the sentiment score matrix, Enhance the matrix for aspect terms; Subsequently, a lexical hyperedge matrix is constructed by combining dependency relations. The formula is as follows: ; ; in, This is a relative position weighting function that assigns higher attention to context words that are closer to the given word in terms of distance. For words The sentiment score in the sentiment dictionary; and Respectively represent words and aspect words Absolute position index in a sentence; Set emotional threshold Words with SenticNet scores greater than 0.5 and less than -0.5 are selected, and hyper-edge matrices of positive and negative sentiment polarity are constructed by combining distance weights. : ; ; Among them, the pos column corresponds to the positive sentiment hyperedge, and the neg column corresponds to the negative sentiment hyperedge; Global Syntax Hyperedge Matrix Aspect-based lexical hyperedge matrix and the emotional polarity hyperedge matrix The hypergraph correlation matrix is obtained by concatenating the hyperedge dimensions. After processing with a syntactic hypergraph convolution, a syntactic feature representation that integrates deep syntactic structure and sentiment features is obtained. : ; in, For the grammatical hypergraph correlation matrix, For a node matrix, It is a hyperedge matrix. It is the hyperedge weight matrix. These are the learnable weight parameters of the l-th layer. It is the ReLU nonlinear activation function; Step 4 Adaptive Gated Fusion: The semantic features, syntactic features, and original text features are adaptively weighted and fused through a gated fusion mechanism to obtain the final features of the aspect words in the multi-view fusion. Step 5 Sentiment Classification: Input the final features of aspect words into a fully connected layer for linear mapping, and then use the Softmax function to calculate the probability distribution of aspect words in each sentiment category, and output the sentiment polarity category with the highest score.
2. The aspect-level sentiment analysis method based on dual-channel hypergraph convolution incorporating external knowledge as described in claim 1, characterized in that, In step 1, the specific method is as follows: Constructing the input sequence of BERT ,in For sentence text, For aspect terms; the sequence is input into the BERT-PT encoder, which outputs the initial embedding vector of the sentence. The formula is: ; in, It is the input sequence. It refers to sentence length. It is the embedded dimension.
3. The aspect-level sentiment analysis method based on dual-channel hypergraph convolution incorporating external knowledge as described in claim 1, characterized in that, In step 2, the specific method is as follows: The initial embedding vector is input into the BiLSTM of the semantic channel, and the forward and backward hidden states are concatenated to obtain the semantic context representation. The whole is represented as ;Will The self-attention score matrix is calculated using both query and key values. The formula is as follows: ; in, , The weight matrix is a learnable matrix. The dimension of the key vector, and the scaling factor. This is used to prevent gradient vanishing due to excessively large dot product values. Subsequently, aspect word features are extracted and average pooling is performed to obtain... Expanded into a matrix Post-compute aspect-based attention matrix The formula is as follows: ; in, , The weight matrix is a learnable matrix. It is a learnable bias term. It is a term used to indicate aspects; The semantic attention score is obtained by fusing the self-attention score and the aspect word attention score. To construct a global semantic hyperedge matrix , of which elements ; and combined with the semantic hyperedge matrix of aspect terms The semantic hypergraph association matrix is obtained by concatenating the matrices. ; Obtain the embedding vector of the input word in the external knowledge graph WordNet. , with context representation The concatenation yields a word representation that integrates context and external knowledge. ; Calculate relevance weights using the dot product attention mechanism The enhanced node features are obtained by weighting the features. The formula is as follows: ; ; in, words indicating aspects and words Attention weights To represent aspect terms that integrate context and external knowledge, To integrate word representations with context and external knowledge, This is the scaling factor; All of Constructing the enhanced node feature matrix Finally, a semantic hypergraph convolutional network is used for feature update, and the semantic feature representation of the (l+1)th layer is... The calculation formula is as follows: ; in, For semantic hypergraph association matrix, For a node matrix, It is a hyperedge matrix. It is the hyperedge weight matrix. These are the learnable weight parameters of the l-th layer. It is the ReLU nonlinear activation function.
4. The aspect-level sentiment analysis method based on dual-channel hypergraph convolution incorporating external knowledge as described in claim 1, characterized in that, In step 4, the specific method is as follows: Using aspect term mask semantic features grammatical features and original text features Perform average pooling to extract specific representations of aspect terms: ; ; ; in, This represents the average pooling function. The value is 1 when the i-th word is an aspect word, and 0 otherwise. These represent semantic, grammatical, and original text-related aspect features, respectively. Through linear transformation and the Sigmoid activation function Calculate the gating coefficients and perform element-wise weighting on the features. : ; ; ; in, and These are the learnable weight matrix and the bias term, respectively. For the Sigmoid function, This represents element-wise multiplication; The weighted features are concatenated to obtain the final fused feature representation used for sentiment classification. .
5. The aspect-level sentiment analysis method based on dual-channel hypergraph convolution incorporating external knowledge as described in claim 4, characterized in that, In step 5, the specific method is as follows: Fusion features Inputting the fully connected layer yields the predicted probability distribution of the sentiment category. : ; in, and These are the weight matrix and bias term of the classifier, respectively; The cross-entropy loss function is used for training to correctly predict the sentiment polarity of aspect words, as shown in the following formula: ; in, The total number of training samples, For the number of emotion categories, For the predicted sentiment probability, This is a label representing the true polarity of emotions.
Citation Information
Patent Citations
Drammar-fused aspect-level text sentiment classification method and system
CN113254637A
Sentence-level multi-aspect sentiment analysis method based on double-graph convolutional neural network
CN121456136A