An aspect-level sentiment analysis method based on semantic double syntax

By combining the BERT model, dynamic context weighting, and multi-head attention mechanism, a dual syntactic structure of dependency tree and constituent tree is constructed, which solves the semantic and syntactic mismatch problem of existing methods in complex sentences and improves the accuracy and robustness of sentiment analysis.

CN122153061APending Publication Date: 2026-06-05CHONGQING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610238931.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-02-28
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing aspect-level sentiment analysis methods struggle to accurately capture long-distance modification relationships when dealing with complex sentences, neglect component tree information, and fail to effectively integrate external sentiment knowledge, leading to a decline in the accuracy of sentiment analysis.

Method used

The BERT pre-trained model is used for encoding, and a dynamic context weighting module and multi-head attention mechanism are combined to capture long-distance semantic dependencies. A dual syntactic structure of dependency tree and constituent tree is constructed. Multi-level syntactic features are extracted through graph convolutional network, and contrastive learning is used to optimize the robustness of the model. Semantic and syntactic information are fused through dual affine residual blocks.

Benefits of technology

It effectively solves the problem of semantic and syntactic mismatch in complex sentences in traditional models, improves the accuracy of sentiment analysis, and performs particularly well in handling irony and implicit expressions. It can maintain stable performance when faced with syntactic analysis errors and data noise.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122153061A_ABST
    Figure CN122153061A_ABST
Patent Text Reader

Abstract

The application relates to a semantic double-syntactic aspect-level sentiment analysis method, and belongs to the technical field of natural language processing. The method comprises the following steps: S1: encoding processing, using a BERT pre-training model to encode input sentences and aspect words to obtain word vector representation; S2: semantic and syntactic feature extraction, extracting semantic features through dynamic context weighting and multi-head attention mechanism, and simultaneously extracting syntactic features by combining SenticNet knowledge with double syntactic structures of a dependency tree and a constituent tree; S3: feature fusion and optimization, adopting a contrast learning method to balance different syntactic information, and fusing semantic and syntactic features through a double-affine residual block and a factorized bilinear pooling mechanism; and S4: sentiment classification, performing pooling processing on the fused features, and outputting aspect-level sentiment polarity through linear transformation and a softmax function. Through the cooperative processing of semantic and double-syntactic information, the long-distance dependence and semantic mismatch problems are effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of natural language processing sentiment analysis technology, and in particular to an aspect-level sentiment analysis method based on semantics and bisyntactics. Background Technology

[0002] Aspect-Based Sentiment Analysis (ABSA) is an important research direction in the field of natural language processing. Its goal is to perform fine-grained sentiment polarity classification for specific aspects of a given text. Unlike traditional document-level or sentence-level sentiment analysis, ABSA requires accurately identifying the sentiment tendencies corresponding to different aspects of a text, which is of great value in practical applications such as product reviews and social media analysis.

[0003] Currently, deep learning-based ABSA methods are mainly divided into two categories: semantic-based methods and syntactic-based methods. Semantic-based methods typically use attention mechanisms to capture the semantic relationships between aspect words and context words. For example, the IAN model models the interaction between aspect words and context through bidirectional LSTM and attention mechanisms, while the AEN model uses an attention encoder network to enhance semantic representation capabilities. However, these methods are susceptible to interference from irrelevant words when dealing with long-distance dependencies, leading to semantic mismatch problems.

[0004] Syntactic-based methods utilize syntactic parsing trees to construct dependencies between words. Graph Convolutional Networks (GCNs) are widely used to model syntactic information using dependency tree structures. The TD-GAT model uses graph attention networks to capture syntactic structure, while the DualGCN model considers both syntactic and semantic information simultaneously through dual graph convolutional networks. However, most existing methods only use a single type of syntactic tree (such as dependency trees), ignoring the phrase hierarchy information provided by constituent trees, and are susceptible to syntactic parsing errors when handling complex sentences.

[0005] Furthermore, existing methods still have shortcomings in the following aspects: First, relying solely on attention mechanisms makes it difficult to accurately capture long-distance modification relationships; second, most models fail to effectively combine external sentiment knowledge to enhance sentiment understanding; and finally, the fusion of semantic and syntactic information is relatively simple, failing to fully leverage their complementary advantages. Especially when dealing with complex sentences containing multiple aspect words, existing models often cannot accurately distinguish the sentiment expressions corresponding to different aspect words, leading to a decline in classification performance.

[0006] Therefore, there is an urgent need for an aspect-level sentiment analysis method that can effectively integrate multi-level semantic and syntactic information and make full use of external emotional knowledge to improve the accuracy of sentiment analysis in complex linguistic environments. Summary of the Invention

[0007] To address the aforementioned technical problems, this invention aims to provide a method that combines single semantics and dual syntax for mutual enhancement, thereby resolving the issues existing in the current technology.

[0008] To achieve the above-mentioned technical objectives, the technical solution provided by the present invention includes:

[0009] An aspect-level sentiment analysis method based on semantic bisyntactics specifically includes the following steps:

[0010] S1: Encoding process, using the BERT pre-trained model to encode the input sentence and aspect words to obtain word vector representations;

[0011] S2: Semantic feature extraction, which dynamically adjusts the weights based on the relative distance between words and aspect words through a dynamic context weighting module, and then captures long-distance semantic dependencies through a multi-head attention mechanism;

[0012] S3: Syntactic feature extraction, simultaneously constructing a dual syntactic structure of dependency tree and constituent tree, combined with... External sentiment knowledge is used to enhance node representations, and multi-level syntactic features are extracted through graph convolutional networks.

[0013] S4: Contrastive learning optimization, using the ConDep contrastive learning method to balance the processing results of different syntax trees and enhance the robustness of the model;

[0014] S5: Feature fusion, which fuses semantic and syntactic information through dual affine residual blocks and uses a factorized bilinear pooling mechanism for deep feature interaction;

[0015] S6: Sentiment classification, after pooling the fused features, uses linear transformation and... The function outputs aspect-level sentiment polarity.

[0016] Furthermore, in step S1, the specific implementation of the encoding process is as follows: a BERT-base-uncased pre-trained model is used, and the input format is a concatenation of "[CLS] + complete sentence + [SEP] + aspect word + [SEP]".

[0017] Furthermore, in step S2, the dynamic context weighting module dynamically adjusts the weights of context words by calculating the relative distance between words and aspect words and using a weighted decay mechanism. Specifically, there is a threshold α before the distance. When the relative distance is less than the threshold α, the weight remains unchanged; when the relative distance is greater than α, the weight decays as the distance increases.

[0018] Furthermore, the obtained semantic vectors are fed into a multi-head self-attention module to further strengthen the association between opinion words and corresponding aspect words, and to ensure consistency.

[0019] Furthermore, the calculation process of the multi-head self-attention module includes: selecting the global CLS information output by BERT as the query matrix. This can fully utilize global context information and help capture long-distance dependencies. The specific expression is as follows:

[0020]

[0021]

[0022]

[0023] in, , and They are all weight matrices. , and These are the bias matrices for three linear layers. Next, multi-head dot product attention is performed, as shown in the following formula:

[0024]

[0025]

[0026] in This is for Settings Used to alleviate dimensionality When it gets bigger The problem of vanishing gradient of a function. , and Let these represent the query matrix, key matrix, and value matrix of the i-th attention. This represents the i-th attention head, which will The results obtained from each attention head are then subjected to element-wise dot product. It is a weight matrix used to transform the concatenated header output into the final output result.

[0027] Furthermore, in step S3, the construction of the dual-syntactic structure specifically includes: generating a dependency tree adjacency matrix using a dependency parser, and generating a constituent tree multi-level phrase structure using a constituent parser; simultaneously introducing... Sentiment scores enhance the weight representation of the adjacency matrix.

[0028] Furthermore, the generated dependency tree adjacency matrix is ​​represented as follows:

[0029]

[0030] Here we use undirected dependency graphs because, typically, the relationships between words in a sentence are symmetrical. For example, in "The food was delicious and the service was excellent," the relationships between "delicious" and "food," and between "excellent" and "service," are mutually understandable. Undirected graphs can more naturally represent these symmetrical relationships without explicitly specifying the direction of the relationships.

[0031] Furthermore, the adjacency matrix of the generated component tree is represented as follows:

[0032]

[0033] in The adjacency matrix represented is the first... The phrase information of the layer has a total of layer, Indicates the first Layer, related phrase tags A collection of phrases.

[0034] Furthermore, in order to enhance the intensity of the emotional information of each word, combined with The sentiment score further enhances the adjacency matrix of the dependency tree, and the sentiment score information of each node is represented as follows:

[0035]

[0036] Furthermore, in step S4, the contrastive learning method employs an S-Pool strategy to select anchor nodes, determines positive and negative samples based on the connection relationships in the component tree and dependency tree, and enhances the model's generalization ability through a contrastive loss function. We use S-Pool to select the k nodes with the highest scores as anchor nodes, and the results are obtained using the dynamic context-weighted module of the semantic channel. Average pooling is performed to obtain and max pooling The following formula for anchor point selection is given:

[0037]

[0038] The selection of positive and negative samples follows these principles: From the perspective of the component tree, nodes directly connected to the anchor node in the component tree, as well as nodes sharing the same origin as the anchor node, are selected as positive samples. From the perspective of the dependency tree, nodes connected to the anchor node in the dependency tree, as well as nodes sharing the same origin as the anchor node, are selected as positive samples. All other nodes are considered negative samples.

[0039] Then, complementary knowledge is acquired by narrowing the distance between the anchor point and positive examples, while interference from negative examples is reduced by widening the distance between the anchor point and negative examples, thus achieving a synthesis of information from the dependency tree and component tree. The improved loss function is:

[0040]

[0041] Furthermore, in step S5, the double affine residual block achieves mutual mapping between semantic and syntactic information through double affine transformation. In order to effectively preserve and adjust features after the double affine transformation, residual processing is performed to better fuse the features before and after the transformation. The double affine process is as follows:

[0042]

[0043]

[0044] in , Both represent trainable weight matrices.

[0045] Then, semantic and syntactic features are fused using a factorization bilinear pooling mechanism:

[0046]

[0047] in, and These are learnable weight matrices used to project syntactic and semantic features, respectively. This represents element-wise multiplication, used to combine two features. This is a normalization operation to ensure stable data distribution. Residual connections are used, adding the output of the upper layer to the input each time, helping to maintain stable information flow and gradients.

[0048]

[0049]

[0050] in It is the output of the i-th layer. This represents the result of using bilinear pooling. This indicates the mean pooling operation.

[0051] Furthermore, in step S6, a total loss function combining cross-entropy loss and contrastive learning loss is used to optimize the model during the training phase.

[0052] The beneficial effects of this invention are as follows:

[0053] (1) This invention innovatively combines a dynamic context-weighted semantic module with a dual syntactic structure (dependency tree + constituent tree) and achieves multi-level information complementarity through a dual affine residual fusion mechanism. This method effectively solves the problem of semantic and syntactic mismatch when traditional models process complex sentences.

[0054] (2) This invention uses a dynamic context-weighted module to intelligently adjust weights based on the relative distance between words and aspect words, combined with a multi-head attention mechanism to capture global dependencies. This design enables the model to focus on key local information while effectively capturing long-distance modification relationships. It effectively solves the performance degradation problem of traditional attention mechanisms in long-distance dependency modeling.

[0055] (3) This invention innovatively incorporates The sentiment knowledge base incorporates a dual-syntactic graph structure, strengthening node weight representation through sentiment scores. This method enables the model to combine common-sense sentiment cognition, significantly enhancing its ability to recognize implicit emotions and complex expressions. It demonstrates a clear advantage, particularly in handling complex scenarios such as irony and implicit expressions.

[0056] (4) This invention employs contrastive learning to balance the processing results of different syntactic trees, and achieves deep interaction between semantic and syntactic features through dual affine transformation. Combined with factorized bilinear pooling mechanism, it effectively avoids feature redundancy and overfitting problems. This design enables the model to maintain stable performance when faced with syntactic analysis errors and data noise. Attached Figure Description

[0057] Figure 1 This is a model architecture diagram of an aspect-level sentiment analysis method based on semantics and bisyntactics in a preferred embodiment of the present invention;

[0058] Figure 2 This is a schematic diagram of the dynamic context weighting module in a preferred embodiment of the present invention;

[0059] Figure 3 This is a schematic diagram of a double syntax structure in a preferred embodiment of the present invention; Detailed Implementation

[0060] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0061] In the description of this invention, it should be understood that the terms "upper," "lower," "left," "right," etc., indicating orientation or positional relationship are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this invention.

[0062] like Figure 1As shown, in this invention, an aspect-level sentiment analysis model based on semantics and dual syntax mainly comprises five parts: an input module, followed by parallel semantic and syntactic processing modules, a fusion module, and finally an output module. This invention effectively combines the interaction of dynamic context weighting, multi-head self-attention modules, dependency trees, and constituent trees, and through... The network reinforces the weight information of word nodes. To balance the processing results from different syntactic trees, we introduce a contrastive learning mechanism. Finally, the results from different semantic and syntactic processing channels are integrated through a fusion module to accurately output the classification result.

[0063] The aspect-level sentiment analysis method based on semantics and bisyntactics provided by this invention includes the following steps:

[0064] Step S1: Encoding process, constructing word vectors using BERT based on the input.

[0065] The goal of the ABSA task is to process a set of input sentences. Where n represents the number of words in the sentence. This represents a part of the context word or aspect word, as well as the corresponding aspect word input. Where m represents the number of words in the aspect term, This represents a specific aspect word mentioned in a sentence. The task of ABSA is to predict the sentiment polarity of sentence S relative to aspect A, which includes three categories: {Positive, Neutral, Negative}. The goal of the model design is to utilize the contextual information provided by the entire sentence S, paying particular attention to opinion words related to aspect words A, to understand their contribution to the sentiment polarity, and to accurately classify the sentiment polarity of sentence S relative to aspect word A into one of the three predefined categories.

[0066] The input sentence S is encoded using a BERT pre-trained model, as shown in the following formula. The resulting output is H={X}.

[0067]

[0068] Step S2: Semantic feature extraction, using a dynamic context weighting module to dynamically adjust weights based on the relative distance between words and aspect words;

[0069] To capture more comprehensive emotional information surrounding the target aspect, we designed a dynamic context-weighted method. This method employs an enhanced dynamic masking mechanism that not only identifies the position of each word relative to the target aspect but also dynamically adjusts the range of retained features based on position and context, thereby improving the relevance and accuracy of the information.

[0070] It should be noted that the specific implementation process of step S2 includes the following steps:

[0071] Step S2-1: As Figure 2 As shown, we calculate the contextual relative distance between each word and the target word, and assign these distances to different neighborhood spans. The formula for defining the contextual relative distance is as follows:

[0072]

[0073] in, This represents the central position of the target word, usually the starting or midpoint of the target word. 'm' represents the length of the target word, indicating the span of the target aspect within the input sequence. This represents the half-length of the target, rounded down, indicating the center position of the target. Subtracting this value here... The goal is to balance the impact of the target aspect length on distance calculation. This ensures that the distances from the words at both ends of the aspect term to the aspect term's position are relatively symmetrical.

[0074] Step S2-2: Determine the dynamic masking matrix based on the dynamic masking vector. The definition of the dynamic masking vector is:

[0075]

[0076] Where E is a unit vector used to preserve local features, and n is the length of the input sequence. It is the threshold of CDR, when hour Set directly That is, the weights of local context words remain unchanged. When Time weight pass This means that for non-local context words that are far from the target, their weights will be reduced based on their distance from the target. Specifically, The larger the value, the greater the decay, thus reducing the influence of these words in the model.

[0077] Step S2-3: Then use the dynamic mask matrix. Represent the original context Weighting of non-local contexts in the data:

[0078]

[0079] in, It is by indivual It is formed by concatenating vectors. This is the dot product operation. Through the above operation, we obtain... It includes enhanced local contextual information as well as reduced non-local contextual information.

[0080] Step S2-4: To improve the integration of information, we will obtain the dynamically context-weighted data. With context The enhanced representations are concatenated, and then a linear transformation is used to map them to a unified representation. The final semantic space is obtained In order to better capture emotional information:

[0081]

[0082]

[0083] in, Indicates a connection operation. It is the result of splicing together dynamically context-weighted information and the original information. It is a weight matrix. It is a bias vector. This weighted decay mechanism helps improve the model's sensitivity to local context, ensuring that the model focuses more on local information relevant to the target when generating the final feature representation, while reducing the influence of non-local context.

[0084] Step S3: The semantic information is then processed through a multi-head attention mechanism to capture long-distance semantic dependencies;

[0085] Step S4: As Figure 3 As shown in the left part, the probability of each dependency arc between words is calculated using a dependency parser to obtain a dependency graph. The adjacency matrix of the dependency tree is further enhanced by combining SenticNet sentiment scores, and the role of aspect words in syntax is also considered.

[0086] It should be noted that the specific implementation process of step S4 includes the following steps:

[0087] Step S4-1: The syntactic information of the dependency tree is provided by the dependency parser. The dependency parser probability matrix provides the probability of each dependency arc, indicating the likelihood of syntactic relations between words. The dependency tree is constructed from the adjacency matrix. To embody this, its definition is as follows:

[0088]

[0089] Step S4-2: To further enhance the intensity of the emotional information of each word, combine... The sentiment score further enhances the adjacency matrix of the dependency tree, and the sentiment score information of each node is represented as follows:

[0090]

[0091] in express Node at The sentiment score obtained from the network indicates that the closer the value is to 1, the stronger the positive sentiment meaning; the closer the value is to -1, the stronger the negative sentiment meaning; and the closer the value is to 0, the more neutral the word or the word not in the vocabulary. It is determined by the sum of the sentiment scores of the two nodes. We hope that the subsequent model can learn sentiment information from words with stronger sentiment.

[0092] Step S4-3: Defines the aspect term matrix information. In order to consider the role of aspect words in syntax, therefore .

[0093] The addition of 1 is to introduce a basic term during the calculation process to adjust and balance the weights of the adjacency matrix, ensuring that the dependencies and sentiment polarities between words can be effectively captured under different circumstances.

[0094] Step S5: As Figure 3 As shown in the right part, a component tree is generated using a dependency resolver, and the component tree is initially merged with the dependency tree matrix obtained in the above steps.

[0095] It should be noted that the specific implementation process of step S5 includes the following steps:

[0096] Step S5-1: Our study adopted... The syntactic structure. The tree structure has multiple levels, each level consisting of multiple phrases, and we create a corresponding matrix based on these phrases:

[0097]

[0098] in The adjacency matrix represented is the first... The phrase information of the layer has a total of layer, Indicates the first Layer, related phrase tags A collection of phrases.

[0099] Step S5-2: Calculate the combined adjacency matrix, for the We take the component tree information from each layer and perform positional addition with the dependency tree, obtaining information from two different syntactic trees. For each layer of the component tree, this operation considers words with the same phrase as well as neighbors in the dependency tree, which can shorten the path from some aspects of the dependency tree to the keyword. The resulting fusion is... .

[0100] Step S5-3: Perform graph convolution on the fused syntax matrix:

[0101]

[0102] in = , It is the weight matrix of the i-th layer. It is the first The bias matrix of the layer.

[0103] Step S6: Comparative learning optimization. The ConDep comparative learning method is used to balance the processing results of different syntax trees. The selection of anchor points and the distinction between positive and negative examples are the core parts. We share the anchor points of the two views and dynamically adjust the anchor point selection strategy. This method effectively combines the information of the component tree and the dependency tree, thereby achieving more accurate comparative learning.

[0104] It should be noted that the specific implementation process of step S6 includes the following steps:

[0105] Step S6-1: We use S-Pool to select the k nodes with the highest scores as anchor nodes, and use the dynamic context weighting module of semantic channels to obtain the results. Average pooling is performed to obtain and max pooling The following formula for anchor point selection is given:

[0106]

[0107] Step S6-2: Select positive and negative samples, following these principles: From the perspective of the component tree, select nodes directly connected to the anchor node in the component tree, and nodes with the same origin as the anchor node, as positive samples. From the perspective of the dependency tree, select nodes connected to the anchor node in the dependency tree, and nodes with the same origin as the anchor node, as positive samples. The remaining nodes are considered negative samples.

[0108] Step S6-3: Obtain the improved loss .

[0109] in Indicates the anchor point. This represents a positive sample. Indicates a negative sample. and These represent the weights of positive and negative samples, respectively. The distance weight for positive samples is... This means that the smaller the distance, the greater the weight; conversely, for negative samples, the weight is smaller. It increases with increasing distance.

[0110] Step S7: In order to obtain semantic processing results, the present invention... and the syntactic processing obtained To further integrate the data, a dual affine residual module was designed. Specifically, the semantic and syntactic results are first subjected to dual affine processing, mapping semantic information to syntax and syntactic information to semantics, thereby achieving the correlation and fusion of information at different granularities. In order to effectively preserve and adjust features after the dual affine transformation, residual processing is performed to better integrate the features before and after the transformation.

[0111] It should be noted that the specific implementation process of step S7 includes the following steps:

[0112] Step S7-1: Map the syntax to the semantic result, and simultaneously map the result to the syntactic information. Specifically:

[0113]

[0114]

[0115] in , Both represent trainable weight matrices.

[0116] Step S7-2: Next, semantic and syntactic features are fused using a factorization bilinear pooling mechanism:

[0117]

[0118] in, and These are learnable weight matrices used to project syntactic and semantic features, respectively. This represents element-wise multiplication, used to combine two features. This is a normalization operation to ensure stable data distribution. Residual connections are used, adding the output of the upper layer to the input each time, helping to maintain stable information flow and gradients.

[0119]

[0120]

[0121] in It is the output of the i-th layer. This represents the result of using bilinear pooling. This indicates the mean pooling operation.

[0122] Step S8: Finally, the fused result r is used together with the Softmax function for sentiment polarity prediction, resulting in:

[0123]

[0124] in This indicates the final predicted emotional polarity. This represents the weight parameters of the linear layer. This represents the bias parameter. To ensure classification accuracy, we choose to minimize the cross-entropy loss function:

[0125]

[0126] in It is the true polarity of emotions. is the predicted sentiment category, and C is the number of sentiment categories. The final total loss is:

[0127]

[0128] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A semantic and bisyntactic aspect-level sentiment analysis method, characterized in that, The method specifically includes the following steps: S1: Encoding process, using the BERT pre-trained model to encode the input sentence and aspect words to obtain word vector representations; S2: Semantic feature extraction, which dynamically adjusts the weights based on the relative distance between words and aspect words through a dynamic context weighting module, and then captures long-distance semantic dependencies through a multi-head attention mechanism; S3: Syntactic feature extraction, simultaneously constructing a dual syntactic structure of dependency tree and constituent tree, combining SenticNet external sentiment knowledge to enhance node representation, and extracting multi-level syntactic features through graph convolutional network; S4: Contrastive learning optimization, using the ConDep contrastive learning method to balance the processing results of different syntax trees and enhance the robustness of the model; S5: Feature fusion, which fuses semantic and syntactic information through dual affine residual blocks and uses a factorized bilinear pooling mechanism for deep feature interaction; S6: Sentiment classification, after pooling the fused features, outputs aspect-level sentiment polarity through linear transformation and SoftMax function.

2. The aspect-level sentiment analysis method based on semantics and bisyntactics according to claim 1, characterized in that, In step S2, word weights are generated and adjusted using a dynamic context-weighted approach, and then processed by a multi-head self-attention module to capture long-distance semantic dependencies. Specifically, this includes: Calculate the contextual relative distance between each word and the target word. : in, This represents the central position of the target word, usually the starting or midpoint of the target word. 'm' represents the length of the target word, indicating the span of the target aspect within the input sequence. This represents the half-length of the target, rounded down, indicating the center position of the target. Subtracting this value here... The goal is to balance the impact of the target aspect length on distance calculation. This ensures that the distances from the words at both ends of the aspect term to the aspect term's position are relatively symmetrical. The dynamic masking matrix is ​​determined based on the dynamic masking vector, which is defined as follows: Where E is a unit vector used to preserve local features, and n is the length of the input sequence. It is the threshold of CDR, when hour Set directly That is, the weights of local context words remain unchanged. When Time weight pass This means that for non-local context words that are far from the target, their weights will be reduced based on their distance from the target. Specifically, The larger the value, the greater the decay, thus reducing the influence of these words in the model. Then use a dynamic mask matrix. Represent the original context Weighting is applied to non-local contexts: in, It is by indivual Consisting of vectors This is the dot product operation. Through the above operation, we obtain... It includes enhanced local contextual information as well as reduced non-local contextual information. To improve the integration of information, we obtained the dynamic context weighting. With context The enhanced representations are concatenated, and then a linear transformation is used to map them to a unified representation. The final semantic space is obtained In order to better capture emotional information: in, Indicates a connection operation. It is the result of splicing together dynamically context-weighted information and the original information. It is a weight matrix. It is a bias vector. This weighted decay mechanism helps improve the model's sensitivity to local context, ensuring that the model focuses more on local information relevant to the target when generating the final feature representation, while reducing the influence of non-local context.

3. The aspect-level sentiment analysis method based on semantic bisyntactic as described in claim 1, characterized in that, Step S3 employs a dual-syntactic structure using both dependency trees and component trees. Specifically, this includes: A dependency parser is used to generate a dependency tree adjacency matrix, and a constituent parser is used to generate a constituent tree multi-level phrase structure; simultaneously, the following is introduced... Sentiment scores enhance the weight representation of the adjacency matrix. The generated dependency tree adjacency matrix is ​​represented as follows: Here we use undirected dependency graphs because, typically, the relationships between words in a sentence are symmetrical. For example, in "The food was delicious and the service was excellent," the relationships between "delicious" and "food," and between "excellent" and "service," are mutually understandable. Undirected graphs can more naturally represent these symmetrical relationships without explicitly specifying the direction of the relationships. The adjacency matrix of the generated component tree is represented as follows: in The adjacency matrix represented is the nth... The phrase information of the layer has a total of layer, Indicates the first Layer, related phrase tags A collection of phrases. To enhance the emotional message of each word, combined with The sentiment score further enhances the adjacency matrix of the dependency tree, and the sentiment score information of each node is represented as follows:

4. The aspect-level sentiment analysis method based on semantics and bisyntactics according to claim 1, characterized in that, In step S4, contrastive learning is used to fuse information from two syntaxes, specifically including: First, the S-Pool strategy is used to select anchor nodes. Positive and negative samples are determined based on the connection relationships in the component tree and dependency tree. The generalization ability of the model is enhanced by comparing the loss functions. We use the S-Pool to select the k nodes with the highest scores as anchor nodes, and the results are obtained using the dynamic context-weighted module of the semantic channel. Average pooling is performed to obtain and max pooling The following formula for anchor point selection is given: The selection of positive and negative samples follows these principles: From the perspective of the component tree, nodes directly connected to the anchor node in the component tree, as well as nodes sharing the same origin as the anchor node, are selected as positive samples. From the perspective of the dependency tree, nodes connected to the anchor node in the dependency tree, as well as nodes sharing the same origin as the anchor node, are selected as positive samples. All other nodes are considered negative samples. Then, complementary knowledge is acquired by narrowing the distance between the anchor point and positive examples, while interference from negative examples is reduced by widening the distance between the anchor point and negative examples, thus achieving a synthesis of information from the dependency tree and component tree. The improved loss function is:

5. The aspect-level sentiment analysis method based on semantics and bisyntactics according to claim 1, characterized in that, In step S5, the dual-affine residual block achieves mutual mapping between semantic and syntactic information through dual-affine transformation, specifically including: First, a double affine mapping is used to map semantic and syntactic information to the other dimension. The double affine mapping process is as follows: in , Both represent trainable weight matrices. Then, semantic and syntactic features are fused using a factorization bilinear pooling mechanism: in, and These are learnable weight matrices used to project syntactic and semantic features, respectively. This represents element-wise multiplication, used to combine two features. This is a normalization operation to ensure stable data distribution. Residual connections are used, adding the output of the upper layer to the input each time, helping to maintain stable information flow and gradients. in It is the output of the i-th layer. This represents the result of using bilinear pooling. This indicates the mean pooling operation.