Aspect level sentiment analysis method and device based on two-stage dependency enhancement graph transformation

Through a two-stage dependency-enhanced graph transformation method, a basic dependency graph and aspect-aware interaction graph are constructed. Combined with graph convolutional coding and Transformer coding, the problem of insufficient fusion of syntactic information and semantic information in existing methods is solved, and the accuracy and robustness of sentiment polarity discrimination are improved.

CN120804787APending Publication Date: 2025-10-17XINJIANG UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510957292.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-11
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

Existing aspect-level sentiment analysis methods have difficulty in accurately capturing long-distance dependencies when processing complex sentences or multi-aspect words, and the fusion of syntactic information and semantic information is insufficient, resulting in insufficient accuracy in sentiment polarity judgment.

Method used

A two-stage dependency-enhanced graph transformation method is adopted. By constructing a basic dependency graph and an aspect-aware interaction graph, which are input into the graph convolutional encoding model and the Transformer encoding module respectively, combined with a feature fusion strategy, the model's modeling ability of syntactic structure and global semantic information is enhanced.

Benefits of technology

The model's ability to identify sentiment polarity under complex syntactic structures is improved, its ability to capture long-distance dependencies is enhanced, and the accuracy and robustness of aspect-level sentiment analysis are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120804787A_ABST
    Figure CN120804787A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of natural language processing, and discloses an aspect level sentiment analysis method and device based on two-stage dependency enhancement graph transformation, and the method comprises the steps: obtaining a data set containing sentences, aspect words and sentiment tags, carrying out the preprocessing, constructing a basic dependency graph through dependency syntax analysis, and extracting related information; constructing an interaction graph by taking the aspect word as a center, and fusing the interaction graph with the basic dependency graph to obtain an enhanced graph; respectively inputting the two features into a graph convolution coding model to obtain structure and enhancement features; performing weighted average pooling on the basis of aspect word masks after fusion to obtain aspect word representation, and inputting the aspect word representation into a classifier to output sentiment polarity. The method can effectively capture the features of aspect words under different graph structures, improves the sentiment analysis precision, and is suitable for text sentiment analysis scenes.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of natural language processing, and particularly relates to an aspect-level sentiment analysis method and device based on a two-stage dependency-enhanced graph transformation. BACKGROUND

[0002] With the explosive growth of user-generated content on the Internet (such as product reviews), sentiment analysis technology has received widespread attention. However, traditional sentiment analysis is usually performed at the overall document or sentence level, and can only give the sentiment tendency of the entire text, and cannot identify specific evaluations for different fine-grained objects. This has limitations in practical applications: for example, in e-commerce reviews, users may mention multiple aspects of a product (such as appearance, performance, etc.), and the evaluations of each aspect may be completely different. To obtain more accurate and accurate opinion information, aspect-level sentiment analysis has emerged, aiming to identify the sentiment polarity of each explicitly mentioned aspect target in the text.

[0003] Early aspect-level sentiment analysis mostly uses sequence models of deep learning, such as using a recurrent neural network combined with an attention mechanism to model the relationship between aspect words and context. This method assigns a higher weight to the context words related to the target aspect through attention, thereby to some extent capturing the key information representing the sentiment of the aspect. The advantage is that it is relatively simple to implement, and can learn the association between aspects and sentiment using a data-driven approach. However, due to the lack of explicit syntactic knowledge guidance, when the sentence structure is complex or the aspect words are far away from the corresponding sentiment words, purely sequence-based models may have difficulty in capturing accurate dependency relationships in time.

[0004] To this end, a class of methods introduces syntactic dependency relationships to construct a graph structure, and applies a graph convolution network or a graph attention network to propagate features on the dependency graph, so that the information of aspect words and related sentiment words is transmitted along the syntactic path. In particular, the graph attention network can assign different weights to the information of neighbor nodes in combination with the type of dependency relationship, in order to highlight the key syntactic associations. This type of model uses explicit syntactic knowledge to more directly link aspect words with their modifiers and sentiment descriptions, to some extent reducing the interference of irrelevant content. The disadvantage is that the dependency graph as a general syntactic structure is not optimized for specific aspects, and may contain redundant edges unrelated to the target; in addition, the graph network is prone to over-smoothing of node features after stacking multiple layers, which weakens the modeling ability of long-distance dependency relationships.

[0005] In recent years, the development of deep pre-trained models brings new opportunities to aspect-level sentiment analysis. By fine-tuning pre-trained language models based on the Transformer architecture such as BERT, the vast amount of semantic knowledge contained in the pre-trained model can be utilized to improve the overall performance of sentiment recognition. The global self-attention mechanism of Transformer can model the dependency between any two words within a single sentence, and has a natural advantage in capturing long-distance dependencies. However, due to the lack of syntactic structure constraints, such models may introduce irrelevant semantic noise when processing sentences containing multiple entities or complex expressions, i.e., paying attention to some irrelevant content to the target aspect, thereby affecting the accuracy of the judgment. In addition, purely Transformer-based models lack the ability to perceive syntactic relationships and cannot ensure that the model focuses on truly key syntactic information.

[0006] To address the above limitations, some improved methods have been proposed. For example, some research integrates external knowledge (sentiment lexicons, knowledge graphs, etc.) to provide additional semantic associations for aspect words and sentiment expressions, to make up for the implicit relationships that the dependency graph may miss. Some work uses dynamic graph structures to adaptively adjust the dependency relationships according to specific sentences and target aspects, and removes irrelevant edges to improve the relevance of information transmission. In addition, multi-view fusion methods model sentences from both syntactic and semantic perspectives, and effectively combine multi-perspective information to obtain a more comprehensive representation. Some research introduces a masking mechanism, such as masking irrelevant words to the current aspect in attention calculation, to reduce the interference of complex context on aspect sentiment judgment. These innovations have improved the performance of aspect-level sentiment analysis to some extent.

[0007] Although these innovative methods have improved model performance to some extent, there are still many technical bottlenecks in the field of aspect-level sentiment analysis that need to be addressed. First, static dependency syntactic graphs lack relevance and often introduce irrelevant redundant connections when targeting specific aspects. Second, graph neural network-based models suffer from over-smoothing problems, where node features tend to converge when multiple layers of graph networks are stacked, making it difficult to effectively model long-distance dependencies. Third, global attention models such as Transformer can capture long-distance dependencies, but lack syntactic constraints and are prone to introducing semantic noise, and lack syntactic perception ability. In addition, the integration of dependency structure information and global semantic information is still insufficient, and existing methods have not effectively combined the advantages of both. Finally, in the case of complex sentence structure and multiple aspect words, the representation of the target aspect word is easily affected by the context and becomes ambiguous, making it difficult to accurately determine the sentiment polarity. SUMMARY

[0008] The application aims to provide an aspect-level sentiment analysis method and device based on a two-stage dependency enhanced graph transformation, which is based on an original syntax dependency graph, combines the relative position information between aspect words and context, constructs an aspect-aware interaction graph, and then fuses the original dependency graph to form an enhanced graph, thereby effectively improving the pertinence of structural representation and the semantic guidance ability. By introducing a two-stage graph structure processing mechanism, the original dependency graph and the enhanced graph are respectively input into two independent graph neural networks and Transformer encoding modules, realizing hierarchical modeling of syntax structure and global semantic information, and forming the final aspect representation through a feature fusion strategy, thereby enhancing the expression ability and discrimination ability of the model under complex syntax structure.

[0009] In order to achieve the above-mentioned purpose, the technical scheme adopted is as follows:

[0010] In a first aspect, the application provides an aspect-level sentiment analysis method based on a two-stage dependency enhanced graph transformation, which comprises:

[0011] Obtaining a data set containing sentences, aspect words and sentiment polarity labels;

[0012] Preprocessing the data set, including: unifying the text encoding format, removing illegal characters and duplicate samples, truncating the text length, marking the start and end positions of aspect words and generating aspect word mask sequences;

[0013] Based on the preprocessed data set, using a dependency syntax analysis tool to parse the sentence and construct a basic dependency graph, while extracting dependency edge types and inter-word relative position information;

[0014] Centered on the aspect word position, an aspect-aware interaction graph is constructed, and the basic dependency graph and the interaction graph are fused to obtain an enhanced graph;

[0015] The basic dependency graph and the enhanced graph are respectively input into a first graph convolutional encoding model and a second graph convolutional encoding model for feature encoding to obtain structural features and enhanced features;

[0016] The structural features and the enhanced features are fused to obtain fused features, and the fused features are weighted average-pooled based on the aspect word mask to obtain aspect word representation;

[0017] The aspect word representation is input into a classifier to output sentiment polarity.

[0018] Further, based on the preprocessed data set, using a dependency syntax analysis tool to parse the sentence and construct a basic dependency graph, while extracting dependency edge types and inter-word relative position information, comprising:

[0019] Dependency parsing is performed on each sentence in the preprocessed data set to generate a syntax dependency tree;

[0020] determine the dependency relationship between words in the sentence based on the syntax dependency tree;

[0021] The dependency relationship is taken as an edge in the basic dependency graph, and is represented by an adjacency matrix as shown in formula (1):

[0022]

[0023] In the formula, D i,j represents the adjacency matrix element of the dependency graph, which is used to represent the syntactic dependency relationship between words in the sentence, w i represents the i-th word, w j represents the j-th word.

[0024] Further, in the aspect of aspect word position, the aspect-aware interaction graph is constructed in the manner as shown in formula (2):

[0025]

[0026] In the formula, p a represents the position index of the aspect word, A is the set of aspect words, T is the node in the dependency graph, is the enhanced dependency graph, i and j represent the row index of the dependency graph matrix, corresponding to the i-th and j-th words in the sentence.

[0027] Further, according to the speed of each vehicle, the basic dependency graph and the interaction graph are fused by the following formula to obtain the enhanced graph:

[0028]

[0029] In the formula, represents the enhanced graph.

[0030] Further, the basic dependency graph and the enhanced graph are respectively input into the first graph convolutional encoding model and the second graph convolutional encoding model for feature encoding, and the calculation process of the structure feature and the enhanced feature is represented as:

[0031]

[0032] In the formula, l represents the number of network layers, represents the structure feature of the l-th layer, represents the enhanced feature of the l-th layer, Transform represents the Transformer operation, ReLU represents the activation function, Norm represents the normalization operation, GraphConv represents the graph convolution, D represents the basic dependency graph, D E represents the enhanced graph, and respectively represent the structure feature and the enhanced feature of the l-1th layer.

[0033] Further, the first graph convolutional encoding model or the second graph convolutional encoding model performs graph convolution through the following formula:

[0034] E' = Linear(E) (6)

[0035] M = ReLU(X + E') (7)

[0036]

[0037] In the formula, E' represents the transformed edge feature matrix, Linear represents linear operation, E represents the edge feature matrix, M represents the aggregated feature matrix, X represents the node feature matrix, X' i represents the updated feature vector of the i-th node, N(i) represents the neighbor node set of node i, M j represents the aggregated feature vector of neighbor node j, X i represents the original feature vector of node i.

[0038] Further, when performing the Transformer operation, the first graph convolutional encoding model or the second graph convolutional encoding model introduces a multi-head attention mechanism, and the calculation process of the multi-head attention mechanism includes:

[0039]

[0040] In the formula, Q = xW Q , K = xW K , and V = xW V Q represents a query matrix, K represents a key matrix used to calculate the correlation weight between words, V represents a value matrix used to aggregate features, softmax activation function is used to convert attention scores into probability distribution, d k represents the dimension of the key matrix K, Attention(Q, K, V) represents the core calculation process of the self-attention mechanism, W Q , W K , and W V respectively represent the weight matrix of Q, K, and V, and x represents the output X' of the graph convolutional layer, i.e. the updated node feature matrix.

[0041] Further, the calculation process of fusing the structure feature and the enhanced feature to obtain the fused feature is represented as:

[0042] H final = αH1 + (1-α)H2 (10)

[0043] In the formula, Hfinal represents the fusion feature, a represents the fusion weight, H1 represents the structure feature, and H2 represents the enhanced feature;

[0044] The aspect word representation is obtained by weighted average pooling based on the aspect word mask, and the calculation process is represented as:

[0045]

[0046] In the formula, H aspect represents the aspect word representation, m i represents the aspect word mask, i represents a position index in a sequence, H final,i represents the fusion feature representation of the i-th token, and L represents the length of the input sequence.

[0047] Further, the aspect word representation is input into a classifier to output a sentiment polarity in the following manner:

[0048] p(a) = Softmax(WH aspect +b) (12)

[0049] In the formula, p(a) represents a sentiment polarity probability, H aspect represents the aspect word representation, Softmax is an activation function, used to convert attention scores into a probability distribution, w represents a weight matrix of a full connection layer, and b represents a bias vector.

[0050] In a second aspect, the present application provides an aspect-level sentiment analysis device based on a two-stage dependency enhanced graph transformation, which comprises:

[0051] A data acquisition module configured to acquire a data set containing sentences, aspect words, and sentiment polarity labels;

[0052] A data preprocessing module configured to preprocess the data set, including: unifying text encoding formats, removing illegal characters and duplicate samples, truncating text length, marking aspect word start and end positions, and generating aspect word mask sequences;

[0053] A dependency graph construction module configured to parse sentences using a dependency syntax analysis tool based on the preprocessed data set, construct a basic dependency graph, and extract dependency edge types and relative position information between words;

[0054] An enhanced graph construction module configured to construct an aspect-aware interaction graph centered on aspect word positions, and fuse the basic dependency graph and the interaction graph to obtain an enhanced graph;

[0055] The feature coding module is configured to input the basic dependency graph and the enhanced graph into a first graph convolutional coding model and a second graph convolutional coding model respectively for feature coding to obtain structural features and enhanced features.

[0056] The fusion pooling module is configured to fuse the structural features and the enhanced features to obtain fused features, and perform weighted average pooling on the fused features based on an aspect word mask to obtain aspect word representations.

[0057] The classification output module is configured to input the aspect word representations into a classifier to output sentiment polarity.

[0058] The present application has the following advantages:

[0059] 1) The enhanced graph in the present application not only retains the connection information in the dependency structure that is significant for emotion judgment, but also gives higher connection strength to the context words in the vicinity of the aspect word by introducing an aspect distance weight mechanism, thereby suppressing the interference of redundant structures. In the process of graph neural network modeling, in view of the problem of feature over-smoothing in the traditional GCN, the present method effectively alleviates the node representation degradation phenomenon by limiting the depth of graph convolution propagation and introducing an asymmetric structure combination design. At the same time, in order to bridge the structural difference between the syntactic graph and the semantic representation, the present application further combines the graph neural module and the Transformer module in series, so that the local dependency features in the graph structure can complete the supplement of the global context semantics in the Transformer layer, solving the problem of incomplete structure information or semantic information under a single modeling path.

[0060] 2) In the aspect word representation learning stage, the present application designs a mask-based pooling mechanism to effectively suppress the context interference caused by the simultaneous occurrence of multiple aspects, thereby enhancing the model's discriminant robustness in dealing with multi-target sentiment conflicts in sentences. Through the above two-stage modeling structure and aspect perception graph structure fusion strategy, the present application can more accurately depict the semantic path between aspects and sentiment words, improve the model's recognition ability of sentiment polarity under long-distance dependency relationships and complex syntactic structures, and significantly improve the shortcomings of existing aspect-level sentiment analysis methods in terms of accuracy, robustness and generalization ability.

[0061] 3) The application carries out comparative experiments on two sub-datasets of Restaurant and Laptop in SemEval 2014 task and Twitter sentiment analysis dataset, and adopts accuracy and F1 value as performance evaluation indexes. The experimental results show that the aspect-level sentiment analysis method model based on the two-stage dependency enhanced graph transformation proposed in the application has better performance than the existing mainstream method on all benchmark datasets, especially in the sentence containing multi-aspect words or ambiguous expressions, the model can better maintain the consistency of structure information and semantic representation, and accurately identify the sentiment tendency of the aspect. BRIEF DESCRIPTION OF DRAWINGS

[0062] Figure 1 A flowchart of an aspect-level sentiment analysis method based on two-stage dependency enhanced graph transformation according to an embodiment of the application is shown.

[0063] Figure 2 An example of dependency relationship of a sentence according to an embodiment of the application is shown.

[0064] Figure 3 A principle framework diagram of an aspect-level sentiment analysis method according to the prior art is shown.

[0065] Figure 4 A model structure diagram of implementing an aspect-level sentiment analysis method based on two-stage dependency enhanced graph transformation according to an embodiment of the application is shown.

[0066] Figure 5 A schematic diagram of the influence of GCN layer on accuracy according to an embodiment of the application is shown.

[0067] Figure 6 A schematic diagram of the influence of GCN layer on F1 according to an embodiment of the application is shown.

[0068] Figure 7 A structure diagram of an aspect-level sentiment analysis device based on two-stage dependency enhanced graph transformation according to an embodiment of the application is shown. DETAILED DESCRIPTION

[0069] The embodiments of the application are described below through specific concrete examples, and those skilled in the art can easily understand other advantages and effects of the application from the disclosure. The application can also be implemented or applied through other different specific embodiments, and each detail in the specification can be modified or changed based on different views and applications without departing from the spirit of the application. It should be noted that the following examples and features in the examples can be combined with each other without conflict.

[0070] The specific embodiments of the present application are described in further detail below in conjunction with the accompanying drawings and examples.

[0071] The embodiment of the present application provides an aspect-level sentiment analysis method based on a two-stage dependency enhanced graph transformation. The method faces three key challenges commonly existing in the current aspect-level sentiment analysis task: first, traditional methods only use static dependency graphs to model syntactic structures, and cannot effectively capture the dynamic interaction between aspect words and sentiment words; second, the structure modeling based on graph neural networks lacks the modeling ability of long-distance dependency and global context; third, syntactic information and semantic information are often modeled separately, making it difficult to form a unified expression. To solve the above problems, the present application proposes an enhanced graph mechanism that fuses the original dependency graph and aspect-guided interaction graph, strengthens the aspect-related dependency path in structure, and at the same time retains the necessary syntactic skeleton information. In the representation learning stage, a two-stage graph modeling strategy is introduced to extract basic structural features and aspect semantic features respectively; and further combined with the Transformer encoding module to capture long-distance word relationships, enhance the semantic integrity and grammatical perception of aspect word representation. Finally, the final semantic representation of the aspect word is generated through feature fusion and mask mechanism, and the sentiment polarity classification task is completed. The method has the characteristics of flexible structure, strong information fusion ability and strong adaptability, can model local dependency structure and global semantic information at the same time, and solves the performance degradation problem of traditional models in the multi-aspect word, long sentence structure and implicit sentiment expression scene.

[0072] Figure 1 A flowchart of an aspect-level sentiment analysis method based on a two-stage dependency enhanced graph transformation according to an embodiment of the present application is shown, as shown in Figure 1 The method includes steps S100 to S700, which are described in detail as follows.

[0073] S100: Obtain a data set containing sentences, aspect words and sentiment polarity labels.

[0074] In this embodiment, the data set is the basis for the aspect-level sentiment analysis task. The data set meets the following elements:

[0075] A. Corpus Source Range: Select a publicly available dataset that is representative and widely used in the field of aspect-level sentiment analysis as the original corpus source. Preferably, use the Restaurant and Laptop sub-task datasets in SemEval 2014 Task 4, which are published by an international authoritative evaluation organization, have a standardized structure, uniform labeling standards, and have become one of the main benchmarks for current ABSA task model evaluation. In addition, it is also necessary to combine the Twitter sentiment analysis dataset, which is derived from real social media platforms, and has more colloquial, informal, and diverse language expressions, which is suitable for testing the robustness of the model in noisy text environments. The above three types of data cover multiple fields (such as electronic products, catering services, social public opinion) and different language styles (such as structured evaluation language, free comment language), with high quality, wide coverage, strong comparability, etc., which can effectively support the data requirements of aspect-level sentiment analysis tasks, and ensure the stability, applicability and reproducibility of subsequent algorithm experiments.

[0076] B. Corpus Size and Diversity Requirements: To ensure that the sentiment analysis model has good learning ability and generalization ability, the selected dataset should meet the diversity and representativeness requirements in terms of size and content. In terms of sample quantity, each sub-task should contain a sufficient number of samples, usually not less than three thousand valid labeled samples in the training and test sets of each dataset, and the sentiment polarity labels are relatively balanced among the three categories of positive, negative and neutral, avoiding class imbalance caused by model training imbalance. In terms of corpus diversity, the selected samples should cover multiple expression styles and usage scenarios, including written and spoken expressions, formal reviews and informal social texts, as well as explicit and implicit emotional expressions. Specifically, the SemEval dataset contains mostly structured consumer reviews, with a standard sentence structure suitable for modeling syntactic dependencies; while the Twitter dataset has more colloquial and casual language, with more complex and implicit emotional expressions, which helps to improve the robustness and adaptability of the model in practical applications. By introducing multi-source heterogeneous text data, the model can learn more comprehensive semantic and emotional expression patterns from different contexts, thereby improving the generalization performance and practical value of the overall system.

[0077] C. Data Accuracy: Each sample should contain sentence content, explicit aspect word labeling and sentiment polarity label, the aspect word boundary should be strictly aligned with the context, and the sentiment label should be provided by the original dataset to ensure consistency and professionalism of the labeling.

[0078] S200: Preprocess the dataset, including: unify the text encoding format, remove illegal characters and duplicate samples, truncate the text length, mark the start and end positions of the aspect word and generate the aspect word mask sequence.

[0079] In some embodiments, the data set is preprocessed as follows:

[0080] The data set is constructed and preprocessed.

[0081] To ensure the normalization and consistency of the model input data, the original data set is structurally preprocessed in this embodiment. First, the text encoding format is unified, illegal characters, blank lines and duplicate samples are removed, and all text lengths are truncated to a maximum of 85 words to meet the input requirements of the model. Second, according to the aspect word label information in each data, the start and end positions of the aspect word in the sentence are marked, and the corresponding aspect mask sequence is generated. Subsequently, the Stanford CoreNLP tool is used to perform dependency syntax analysis on each sentence to extract the dependency relationship between words, and a standard dependency adjacency matrix is constructed. At the same time, to support the construction of enhanced graphs, the relative distance between the aspect word and the context word can be calculated to generate the distance decay factor required by the interaction graph and the enhanced graph, and converted into a tensor format that can be used as input features by the model.

[0082] The data set used is a publicly released high-quality aspect-level sentiment analysis data set with good annotation quality and universality, so there is no need to use a language perplexity filter; the annotation consistency, structural integrity and format specification are ensured by programmed cleaning and structural verification in the preprocessing stage, and the specific processing process is as described above.

[0083] S300: Based on the preprocessed data set, use the dependency syntax analysis tool to parse the sentence and construct the basic dependency graph, while extracting the dependency edge type and relative position information between words.

[0084] In some embodiments, the way to construct the basic dependency graph includes:

[0085] First, use Stanford CoreNLP to perform dependency parsing on each sentence to generate a syntactic dependency tree. Through dependency parsing, the dependency relationship between words in the sentence is obtained, which is regarded as an edge in the graph and represented in the form of an adjacency matrix.

[0086]

[0087] The basic dependency graph As an initial graph structure, it provides basic topological information of syntactic relationships, denotes a real number set, and n denotes the dimension.

[0088] As Figure 2 shown, an example of a basic dependency graph obtained by this embodiment.

[0089] S400: Centered on the aspect word position, construct an aspect-aware interaction graph, and fuse the basic dependency graph and the interaction graph to obtain an enhanced graph.

[0090] In some embodiments, to enhance the explicit connection between aspect words and context words, an aspect-aware interaction graph is defined. The weight thereof is determined according to the distance between the words and the aspect words, following the principle of distance decay:

[0091]

[0092] In the formula, p a represents the position index of the aspect word, A is the set of aspect words, and T is the node in the basic dependency graph. In this way, the aspect-guided semantic weight is assigned to the edge in the graph.

[0093] In some embodiments, to introduce aspect semantic guidance information in the dependency structure, the embodiment fuses the original dependency graph and the interaction graph to generate an enhanced graph D E , and the fusion strategy is as follows:

[0094]

[0095] The enhanced graph not only retains the syntactic connection structure, but also fuses the distance-aware weight between the aspect words and the context words, realizing the semantic reconfiguration of the dependency graph.

[0096] S500: input the basic dependency graph and the enhanced graph into the first graph convolutional coding model and the second graph convolutional coding model respectively for feature coding to obtain the structure feature and the enhanced feature.

[0097] In the embodiment, the first graph convolutional coding model and the second graph convolutional coding model have the same basic structure, and both include a graph convolutional network and a Transformer network connected in sequence.

[0098] In some embodiments, for feature-enhanced graph convolutional calculation, in the graph neural network modeling, the edge feature embedding is embedded into the vector space and adjusted by linear transformation to the same dimension as the node feature:

[0099] E' = Linear (E)

[0100] The features of the nodes and edges are jointly transmitted, and the calculation method is as follows:

[0101] M = ReLU (X + E')

[0102] X' = ∑ (M + X)

[0103] The above operation realizes the joint update of the node itself feature, the neighbor feature and the edge feature, and improves the modeling ability of the model to the fine-grained dependency relationship in the syntactic structure.

[0104] To model the global semantic information, the embodiment introduces a multi-head attention mechanism, and the core calculation process thereof is as follows:

[0105]

[0106] where q = wW Q K = xW K V = xW V The weight matrix is learnable, used to calculate the dependency weight between words in the whole sequence and generate semantic enhanced representation.

[0107] In some embodiments, to comprehensively model the original dependency structure and the enhanced structure, a two-stage modeling strategy is adopted, including a first stage and a second stage, which are executed by a first graph convolutional encoding model and a second graph convolutional encoding model.

[0108] The first stage takes the dependency graph D as input, and sequentially performs graph convolution, normalized activation, and Transformer operation:

[0109]

[0110] The second stage takes the enhanced graph D E as input, and repeats the above process to extract the enhanced structure-semantic features:

[0111]

[0112] S600: Fuse the structure features and the enhanced features to obtain fused features, and perform weighted average pooling on the fused features based on the aspect word mask to obtain aspect word representation;

[0113] In some embodiments, a weighted fusion mechanism is used to integrate the representations of the two stages, and the fusion method is as follows:

[0114] H final = aH1 + (1-a)H2

[0115] And then combine the aspect word mask m i to perform weighted average pooling:

[0116]

[0117] Finally, the overall representation vector of the aspect word is generated.

[0118] S700: Input the aspect word representation into the classifier to output the sentiment polarity.

[0119] In some embodiments, the aspect word representation is sent to a linear layer and the sentiment polarity probability is generated by Softmax:

[0120] p(a) = Softmax(WH aspect +b)

[0121] Output the sentiment category label corresponding to the aspect word.

[0122] In some embodiments, a cross-entropy loss function is employed as the objective function, defined as follows:

[0123]

[0124] In the formula, P represents a set of all sample pairs, C is a set of sentiment polarity categories, and θ represents all learnable parameters of the model.

[0125] Embodiment 2

[0126] In this embodiment, three public standard data sets are selected for experiments, including the SemEval2014 Restaurant and Laptop data sets, and the Twitter data set. The data sets as above cover user reviews in different fields, and are suitable for the task of aspect-level sentiment analysis. In order to obtain the context feature representation of the text, the pre-trained GloVe word vector is generally used as the word embedding, and the bidirectional context features of the text are extracted through the Bi-LSTM.

[0127] In this embodiment, the information of the benchmark model used for the test data is as follows:

[0128] ATAE-LSTM: This model introduces aspect word embedding on the basis of the traditional LSTM, concatenates the aspect word vector to each input word vector, so that the aspect information is always visible in the entire sequence encoding process. At the same time, the attention mechanism is combined to improve the focusing ability on the content related to the aspect word. This method increases the guidance of aspect pair context modeling in the model structure, but due to the static participation of the aspect word in the representation process, it cannot realize dynamic semantic interaction, and the structural hierarchical information has not been introduced.

[0129] IAN: IAN adopts a double-flow modeling method, respectively constructs independent representations for the context and the aspect word, and through the interactive attention mechanism, the context and the aspect representation influence and guide each other, and then generates an aspect representation with stronger semantic consistency. This method better captures the semantic interaction between the aspect and the context, and is suitable for the case of single sentence and multiple aspect sentiment conflicts, but lacks the ability to perceive the syntactic structure, especially in sentences with complex rhetoric and long-distance dependency of modifier words.

[0130] AOA: The AOA model proposes an "attention-in-attention" mechanism, which establishes a bidirectional interaction between the sentence and the aspect, to more accurately capture the sentiment information related to the aspect. The model first encodes the sentence and the aspect word using bidirectional LSTM, then calculates the relevance of the aspect and each word in the sentence through an interaction matrix, further calculates the attention of the sentence to the aspect and the attention of the aspect to the sentence, and fuses the two types of attention to generate the final context representation.

[0131] Sentic LSTM: Sentic LSTM significantly enhances the model's ability in sentiment word recognition by embedding the sentiment concept knowledge in SenticNet into the gating structure of LSTM units. The model introduces an external vector triggered by sentiment knowledge for each time step to control the information flow of the forget gate, input gate, and output gate, while introducing a knowledge output gate to supplement the concept-level sentiment information into the final hidden state. Through this knowledge-driven sequence modeling approach, Sentic LSTM not only strengthens the modeling ability of syntactic structure, but also alleviates the problem of insufficient context dependency of the model, outperforming standard LSTM and BERT baseline models in multiple ABSA tasks.

[0132] TNet: TNet model designs a specific transformation mechanism for aspect words and combines a context preservation strategy to dynamically reconstruct word-level representations for more accurate sentiment feature extraction. Specifically, the model introduces an aspect-aware transformation mechanism module to adjust the context word representation according to the current target aspect word during sentence encoding, so that the semantic representation of each word can more fully reflect its relationship with the target aspect. At the same time, to avoid losing original semantic information in multiple rounds of transformation, TNet introduces a context preservation mechanism to maintain effective connections to the initial word representation in each round of transformation, thereby maintaining the integrity of the overall sentence semantics while enhancing features. Finally, the aspect-aware context representation is gradually optimized through multiple layers of stacked transformation networks and used for sentiment classification. TNet improves the model's discriminative ability while maintaining semantic consistency, especially suitable for scenarios where the relationship between aspect words and sentiment words is more implicit in complex contexts.

[0133] ASGCN: ASGCN is based on GCN and first systematically integrates aspect word information into dependency graph modeling. The key lies in constructing an aspect-specific graph structure, which enhances the modeling ability of the dependency relationship between aspect words and context sentiment words by applying aspect masks on the syntactic dependency tree. ASGCN designs two graph structures: directed dependency graph and undirected dependency graph, and extracts the context representation of nodes in the graph through a multi-layer graph convolutional network to enhance the model's ability to model long-distance dependency relationships. Experiments show that this method significantly outperforms conventional LSTM and CNN structures on multiple benchmark datasets.

[0134] R-GAT: R-GAT addresses the problem of traditional GAT models being unable to handle labeled edges by introducing a relationship-aware graph attention mechanism and combining aspect-oriented dependency sub-tree structures to achieve more fine-grained sentiment modeling. This method reconstructs the dependency tree of the sentence, making the aspect word the root node of the tree and retaining the dependency edges directly related to it, thereby concentrating on modeling sentiment information directly related to the aspect. RGAT further utilizes a multi-head graph attention mechanism to model different types of dependency relationships, assigning different weights to each type of dependency edge, significantly improving the semantic modeling ability between aspect words and sentiment words.

[0135] DGEDT: The DGEDT model proposes a dual structure fusion strategy that combines a bidirectional graph convolutional network with a dual-branch Transformer encoder to model both the planar text representation and the dependency graph structure information of a sentence. This method is divided into two main pathways in the model structure: on the one hand, a bidirectional GCN is used to encode the dependency graph of the sentence, making full use of the adjacency information in the syntactic structure and the dependency relationships between words; on the other hand, a dual Transformer structure is constructed to process the original text sequence and the structure-enhanced sentence representation, respectively, achieving complementary modeling of local semantics and global dependencies. In the representation generation stage, the model fuses the features from the GCN and Transformer two pathways to obtain aspect word representations that are synergistically enhanced with semantic and structural information. DGEDT effectively addresses the fragmentation problem between structure modeling and context interaction in traditional methods, improving the modeling ability of structural semantic consistency in aspect-level sentiment classification tasks.

[0136] DualGCN: The DualGCN model is based on the dual graph structure modeling idea, which simultaneously constructs a syntactic view and a semantic view to improve the structural representation ability of aspect words. The syntactic view generates a basic graph structure through dependency syntax trees, while the semantic view constructs an enhanced relationship graph based on the shortest distance between aspect words and context and dependency edge types. Two GCN branches run in parallel, extracting semantic features of different granularities on the two graph structures, and then performing feature fusion to generate more representative aspect word vectors. In addition, the model introduces dependency edge type filtering and semantic distance weight mechanisms to improve the focusing ability on key contexts. DualGCN effectively solves the problems of static structure limitations of dependency graphs and insufficient information modeling of single-path modeling through multi-perspective and multi-level structure modeling, and has strong cross-sentence expression ability and sentiment discrimination robustness under multi-aspect word interference.

[0137] SPGCN: SPGCN fuses sub-dependency information and relative position information on the basis of standard GCN, effectively enhances the modeling ability of long-distance sentiment dependency by constructing sub-adjacency matrix and position mask. The model uses a multi-layer graph convolution structure to process direct dependency and sub-dependency relationships respectively, and uses position information to construct a weight matrix to accurately model the complex dependency relationship between aspect words and context. On multiple datasets, SPGCN outperforms existing mainstream methods in terms of F1 value and accuracy.

[0138] SSEGCN: SSEGCN model fuses syntactic dependency structure and global semantic attention mechanism, and proposes a structure and semantic collaborative modeling graph convolution framework. This method first extracts word-level context representation through Bi-LSTM, then introduces a double attention mechanism, including aspect-oriented perception attention and self-attention for capturing global dependency, to generate semantic-oriented graph structure. At the same time, the model constructs multiple syntax mask graphs according to syntactic distance to guide the attention matrix, thereby forming a structure-semantic joint mapping scheme. In the graph convolution stage, a multi-channel GCN is used to aggregate multiple graph structures to realize feature propagation from multiple perspectives. Finally, the aspect perception representation is extracted by combining the aspect word mask pooling method, and the sentiment polarity classification is completed by Softmax. This method solves the problems of poor adjacency density, long-distance information loss, and weak semantic alignment of GCN, and achieves leading performance on multiple datasets.

[0139] SEGCN: SEGCN model embeds sentiment knowledge into the graph structure, and proposes a sentiment-enhanced graph neural network architecture. This model assigns weights to the edges based on the relative distance from the aspect word to the context word when constructing the dependency graph, forming an aspect-guided interaction path. At the same time, by connecting positive and negative sentiment words to a shared sentiment polarity node, it introduces domain-independent sentiment concepts to enhance the model's ability to identify opinion words. The sentiment node in this model is a globally trainable parameter that can be learned across samples and transferred to different domains, enhancing the generalization ability of sentiment modeling. Auxiliary tasks are also introduced during training to explicitly classify sentiment words, guiding the model to pay attention to and strengthen the graph path features related to sentiment expression. SEGCN effectively combines explicit syntactic structure, relative position, and implicit sentiment representation guided by knowledge, achieving more semantically aware aspect-level sentiment classification.

[0140] The embodiment of the application proposes an aspect-level sentiment analysis method based on a two-stage dependency enhanced graph transformation. The method combines a graph convolutional neural network and a Transformer structure, constructs an enhanced dependency graph structure, accurately models the complex syntax and semantic relationship between aspect words and context, and has stronger robustness and discriminability when processing complex sentences containing multiple aspect words or implicit sentiment expressions. The method addresses the problems of insufficient utilization of dependency structure information, weak long-distance sentiment association capturing ability, and other issues in existing models. It introduces an aspect perception interaction graph and effectively optimizes the original dependency relationship through a graph structure enhancement mechanism to guide the model to focus on aspect-related semantic areas, thereby significantly improving the accuracy of aspect representation and sentiment polarity classification performance. The specific implementation process of the method is described in Embodiment 1, which will not be described here.

[0141] Figure 3 The current mainstream aspect-level sentiment analysis method model is shown.

[0142] The current mainstream aspect-level sentiment analysis model mostly adopts a modeling method combining a graph convolutional neural network and dependency syntax analysis. The basic idea is to convert a text sentence into a graph structure through a dependency syntax analysis tool, with each word in the sentence as a node in the graph and the dependency relationship as an edge, thereby constructing a dependency graph guided by the syntactic structure. On this basis, the graph convolutional network is used to perform multi-layer information propagation on the nodes to realize the interaction and feature enhancement of the syntax information between the words.

[0143] The model first uses a word embedding or a pre-trained BERT model to extract an initial word representation and uses it as the input feature of each node in the graph. Then, according to the constructed dependency adjacency matrix, the GCN module aggregates the features of each word node and its adjacent nodes, and through layer-by-layer propagation, the local structure information is integrated into the word representation. In the final representation stage, the model usually constructs a mask according to the aspect word position, aggregates the context information related to the aspect word through pooling or attention mechanism, obtains the aspect-specific sentence representation, and then completes the sentiment polarity classification task.

[0144] The advantage of this type of model is that it can introduce explicit syntactic structure information, make up for the lack of syntax awareness of traditional LSTM or Transformer models, and is particularly suitable for short texts and sentences with clear grammatical structure. However, this method still has certain limitations: first, the dependency graph structure used is usually static and cannot be dynamically adjusted for specific aspect words; second, all adjacent nodes are treated equally and lack fine-grained semantic weight modeling, which is easily disturbed by redundant edges or irrelevant nodes; third, when dealing with long-distance dependencies or multi-aspect word sentences, the information transmission efficiency is low and the sentiment representation ability is limited. Therefore, more and more research has begun to explore how to combine graph structure and semantic information for deep integration to improve the discriminability and generalization ability of the model.

[0145] Figure 4 The specific model of the aspect-level sentiment analysis method based on the two-stage dependency enhanced graph transformation proposed by the application is shown, and the aspect-level sentiment analysis method based on the two-stage dependency enhanced graph transformation proposed by the application is a two-stage graph modeling method combining dependency syntax structure and aspect semantic information, aiming to improve the structure perception and semantic expression ability in aspect-level sentiment analysis.

[0146] First, the model is based on the input sentence-aspect word pair, and uses a dependency syntax analysis tool to construct an original dependency graph to capture the syntactic relationship between words. On this basis, combined with the position of the aspect word, an aspect-aware interaction graph construction mechanism is introduced, and a semantic-guided connection weight is generated according to the relative distance between the aspect word and other words in the sentence. Then, the interaction graph and the original dependency graph are fused to form an enhanced graph, which retains the core skeleton of the syntactic structure and strengthens the path connection related to the aspect word semantics, thereby improving the aspect feature perception ability on the graph structure.

[0147] Next, the model uses a two-stage graph convolutional network for feature encoding: the first stage takes the original dependency graph as input to extract local structural dependency features; the second stage takes the enhanced graph as input to focus on global semantic structure modeling under the guidance of the aspect. In the two-stage modeling process, the graph convolutional network is used to update the word nodes at multiple levels to obtain structural information from different perspectives. Then, the graph features of the two stages are input into the Transformer module to capture long-distance dependency relationships within the sentence through the multi-head self-attention mechanism, realizing the collaborative modeling of structural information and global context semantics.

[0148] Finally, the model fuses the representations from the two stages of the Transformer and combines an aspect word mask mechanism to weight and aggregate relevant words to form the final aspect word representation. This representation is fed into a sentiment classifier, which outputs the corresponding sentiment polarity label (positive, negative, or neutral). Through this structure, the aspect-level sentiment analysis method based on two-stage dependency-enhanced graph transformation preserves the advantages of syntactic dependency structures while incorporating aspect-aware semantic guidance information, effectively improving recognition accuracy and robustness in multi-aspect word, multi-sentiment sentence, and long-distance dependency scenarios.

[0149] The Restaurant and Laptop datasets in SemEval 2014 Task 4 and the public sentiment analysis dataset from the Twitter platform were used as experimental corpora in this embodiment, as shown in Table 1. The above datasets all contain sentences, aspect words, and corresponding sentiment labels, covering both formal written language and informal social language scenarios, and have good representativeness and universality, which can be used to comprehensively evaluate the effectiveness and robustness of the aspect-level sentiment analysis method of the present application. Table 1 is the statistical information of the three benchmark datasets used in this experiment.

[0150] Table 1: Statistical information of the dataset

[0151]

[0152]

[0153] The aspect-level sentiment analysis method based on two-stage dependency-enhanced graph transformation was systematically compared and tested on the Restaurant and Laptop standard evaluation datasets in SemEval 2014 Task 4 and the Twitter sentiment analysis dataset, and its performance was compared with that of multiple existing mainstream benchmark models. The accuracy and F1 value were used as evaluation indicators in the experiment.

[0154] Table 2: Comparison of results of different datasets based on LSTM word embedding, The results reproduced using open source code are shown

[0155]

[0156]

[0157] The experimental results in Table 2 show that the aspect-level sentiment analysis method based on two-stage dependency-enhanced graph transformation outperforms existing methods in terms of performance on all datasets, especially in terms of F1 value, showing stronger sentiment recognition ability.

[0158] Especially in Restaurant and Twitter datasets, the aspect-level sentiment analysis method based on the two-stage dependency enhanced graph transformation shows higher robustness and discriminability in dealing with complex sentence structures, implicit sentiment expressions, or multiple aspect words coexisting in challenging scenarios, verifying the advancement and practical value of the present application in aspect-level sentiment analysis tasks.

[0159] Table 3 Comparison of results of word embedding based on different BERT datasets Results reproduced using open source

[0160]

[0161] The experimental results in Table 3 show that on the data of the word embedding based on BERT model, our algorithm has better performance than the existing methods on most datasets.

[0162] In order to determine the influence of the number of GCN layers, the present embodiment conducts experiments on three datasets, and the number of layers varies from 1 to 8. As shown in Table 4, the results in Table 5 and Table 6 show that the model performs best when the number of layers is 5. The fewer the number of layers, the more limited the receptive field, and the model mainly captures local dependency relationships, resulting in suboptimal results. With the increase of the number of layers, the model will aggregate more global information, thereby improving the feature representation and performance. After more than 5 layers, the increase in complexity will bring redundancy and interference, and optimization problems such as gradient vanishing or explosion will also affect the training. Therefore, the 5-layer model strikes a balance between sufficient feature extraction and training stability on all datasets. Figure 5 Figure 6 Therefore, the method proposed in the present application is verified by system on the Restaurant and Laptop two sub-datasets in the SemEval 2014 Task 4 standard evaluation task, and the Twitter social media review dataset. In the experiment, the accuracy (Accuracy) and F1 value are selected as the evaluation indexes, and the results show that the present method has significantly better performance than the existing mainstream models on all datasets. On test samples containing multiple aspect words, implicit sentiment expressions, or large syntactic dependency spans, the present method shows stronger discriminative robustness and context modeling capability. From the practical application point of view, the present application is applicable to various typical natural language processing scenarios such as product review analysis, user feedback understanding, and public opinion sentiment tracking, and can be extended and applied to multilingual sentiment analysis tasks as a general model. The overall structure of the model is highly compatible and can be seamlessly integrated with pre-trained language models (such as BERT and RoBERTa), and has good transfer learning capability. In summary, the present application has significant advantages in structural modeling depth, sentiment perception breadth, and application promotion capability, and provides a high-performance solution with practical value for aspect-level sentiment analysis.

[0163] Therefore, the method proposed in the present application is verified by system on the Restaurant and Laptop two sub-datasets in the SemEval 2014 Task 4 standard evaluation task, and the Twitter social media review dataset. In the experiment, the accuracy (Accuracy) and F1 value are selected as the evaluation indexes, and the results show that the present method has significantly better performance than the existing mainstream models on all datasets. On test samples containing multiple aspect words, implicit sentiment expressions, or large syntactic dependency spans, the present method shows stronger discriminative robustness and context modeling capability. From the practical application point of view, the present application is applicable to various typical natural language processing scenarios such as product review analysis, user feedback understanding, and public opinion sentiment tracking, and can be extended and applied to multilingual sentiment analysis tasks as a general model. The overall structure of the model is highly compatible and can be seamlessly integrated with pre-trained language models (such as BERT and RoBERTa), and has good transfer learning capability. In summary, the present application has significant advantages in structural modeling depth, sentiment perception breadth, and application promotion capability, and provides a high-performance solution with practical value for aspect-level sentiment analysis.​

[0164] Embodiment 3:

[0165] The embodiment of the present application also provides an aspect-level sentiment analysis device based on a two-stage dependency enhanced graph transformation, please refer to Figure 7 The device comprises:

[0166] A data acquisition module 701 is configured to acquire a data set containing sentences, aspect words and sentiment polarity labels;

[0167] A data preprocessing module 702 is configured to preprocess the data set, including: unifying text encoding format, removing illegal characters and duplicate samples, truncating text length, marking aspect word start and end positions and generating aspect word mask sequence;

[0168] A dependency graph construction module 703 is configured to parse sentences using a dependency syntax analysis tool based on the preprocessed data set, construct a basic dependency graph, and extract dependency edge types and relative position information between words;

[0169] An enhanced graph construction module 704 is configured to construct an aspect-aware interaction graph centered on aspect word positions, and fuse the basic dependency graph and the interaction graph to obtain an enhanced graph;

[0170] A feature encoding module 705 is configured to input the basic dependency graph and the enhanced graph into a first graph convolutional encoding model and a second graph convolutional encoding model respectively for feature encoding to obtain structure features and enhanced features;

[0171] A fusion pooling module 706 is configured to fuse the structure features and the enhanced features to obtain fusion features, and perform weighted average pooling on the fusion features based on aspect word masks to obtain aspect word representations;

[0172] A classification output module 707 is configured to input the aspect word representations into a classifier to output sentiment polarity.

[0173] It should be noted that the aspect-level sentiment analysis device based on the two-stage dependency enhanced graph transformation and the method described above belong to the same technical concept, and have the same technical principles and beneficial effects, so this will not be repeated here.

[0174] The above embodiments are only used to illustrate the present application, and not to limit the present application. Those skilled in the related art can make various changes and modifications without departing from the spirit and scope of the present application, therefore all equivalent technical solutions also belong to the scope of the present application, and the patent protection scope of the present application should be defined by the claims.

Claims

1. A two-stage dependency-enhanced graph transformation-based aspect-level sentiment analysis method, characterized by: The method comprises: Get a dataset containing sentences, aspect words, and sentiment polarity labels; Preprocessing the data set includes: unifying the text encoding format, removing illegal characters and repeated samples, truncating the text length, marking the start and end positions of aspect words, and generating aspect word mask sequences; Based on the preprocessed dataset, use the dependency parser to parse the sentence, build the basic dependency graph, and extract the dependency edge type and relative position information between words; Taking the aspect word position as the center, constructing an aspect-aware interaction graph, and fusing the basic dependency graph with the interaction graph to obtain an enhanced graph; Inputting the basic dependency graph and the enhanced graph into a first graph convolutional coding model and a second graph convolutional coding model respectively for feature coding to obtain structural features and enhanced features; The structural features and the enhanced features are fused to obtain fused features, and the fused features are weighted average pooled based on the aspect word mask to obtain aspect word representation; The aspect word representation is input into the classifier to output the sentiment polarity.

2. The method according to claim 1, wherein Based on the preprocessed dataset, we use dependency parsing tools to parse sentences, build a basic dependency graph, and extract dependency edge types and relative position information between words, including: Perform dependency parsing on each sentence in the preprocessed dataset to generate a syntactic dependency tree; Determining dependency relationships between words in a sentence based on the syntactic dependency tree; The dependency relationships are treated as edges in the basic dependency graph and expressed as the adjacency matrix shown in formula (1): Where D i,j Represents the adjacency matrix elements of the dependency graph, which are used to represent the syntactic dependency between words in a sentence, w i represents the i-th word, w j represents the jth word.

3. The method according to claim 2, wherein The way to construct the aspect-aware interaction graph with the aspect word position as the center is shown in formula (2): Where p a Represents the position index of the aspect word, A is the aspect word set, T is the node in the dependency graph, is the enhanced dependency graph, i and j represent the row indices of the dependency graph matrix, corresponding to the i-th and j-th words in the sentence.

4. The method according to claim 3, wherein According to the speed of each vehicle, the basic dependency graph and the interaction graph are fused using the following formula to obtain an enhanced graph: Where, Represents the enhanced graph.

5. The method according to claim 1, wherein The basic dependency graph and the enhanced graph are respectively input into the first graph convolutional coding model and the second graph convolutional coding model for feature coding. The calculation process of obtaining the structural features and the enhanced features is expressed as follows: In the formula, l represents the number of network layers, represents the structural features of the lth layer, represents the enhanced features of the lth layer, Transformer represents the Transformer operation, ReLU represents the activation function, Norm represents the normalization operation, GraphConv represents the graph convolution, D represents the basic dependency graph, and D E represents the enhanced graph, and They represent the structural features and enhanced features of the l-1th layer respectively.

6. The method according to claim 5, wherein The first graph convolutional coding model or the second graph convolutional coding model performs graph convolution using the following formula: E'=Linear(E)(6)M=ReLU(X+E')(7) Where, E' represents the transformed edge feature matrix, Linear represents the linear operation, E represents the edge feature matrix, M represents the aggregated feature matrix, X represents the node feature matrix, X' i represents the updated feature vector of the i-th node, N(i) represents the set of neighbor nodes of node i, and M j represents the aggregated feature vector of neighbor node j, X i Represents the original feature vector of node i.

7. The method according to claim 5, wherein When the first graph convolutional coding model or the second graph convolutional coding model performs the Transformer operation, a multi-head attention mechanism is introduced. The calculation process of the multi-head attention mechanism includes: Where Q = xW Q ,K=xW K , V=xW V , Q represents the query matrix, K represents the key matrix, which is used to calculate the association weights between words, V represents the value matrix, which is used to aggregate features, and the softmax activation function is used to convert the attention score into a probability distribution, d k represents the dimension of the key matrix K, Attention(Q,K,V) represents the core calculation process of the self-attention mechanism, W Q 、W K and W V Represent the weight matrices of Q, K and V respectively, and x represents the output X' of the graph convolutional layer, which is the updated node feature matrix.

8. The method according to claim 1, wherein The calculation process of fusing the structural features and the enhanced features to obtain the fused features is expressed as: H final =αH1+(1-α)H2 (10) Where H final represents fusion features, α represents fusion weight, H1 represents structural features, and H2 represents enhanced features; The calculation process of performing weighted average pooling on the fusion features based on the aspect word mask to obtain the aspect word representation is expressed as: Where H aspect Indicates aspect words, m i Represents the aspect word mask, i represents the position index in the sequence, and H final,i represents the fused feature representation of the i-th token, and L represents the length of the input sequence.

9. The method according to claim 1, wherein The way to input the aspect word representation into the classifier and output the sentiment polarity is: p(a)=Softmax(WH aspect +b) (12) In the formula, p(a) represents the probability of sentiment polarity, H aspect represents the aspect word representation, the Softmax activation function is used to convert the attention score into a probability distribution, W represents the weight matrix of the fully connected layer, and b represents the bias vector.

10. An aspect-level sentiment analysis device based on a two-stage dependency-enhanced graph transformation, characterized in that: The device comprises: A data acquisition module is configured to acquire a data set including sentences, aspect words and sentiment polarity labels; A data preprocessing module is configured to preprocess the data set, including: unifying the text encoding format, removing illegal characters and repeated samples, truncating the text length, marking the start and end positions of aspect words, and generating aspect word mask sequences; The dependency graph construction module is configured to parse sentences based on the preprocessed dataset using a dependency parser, build a basic dependency graph, and extract dependency edge types and relative position information between words. an enhanced graph construction module configured to construct an aspect-aware interaction graph centered on aspect word positions, and fuse the basic dependency graph with the interaction graph to obtain an enhanced graph; a feature encoding module configured to input the basic dependency graph and the enhanced graph into a first graph convolutional coding model and a second graph convolutional coding model, respectively, for feature encoding to obtain structural features and enhanced features; a fusion pooling module configured to fuse the structural features and the enhanced features to obtain fused features, and perform weighted average pooling on the fused features based on aspect word masks to obtain aspect word representations; The classification output module is configured to input the aspect word representation into a classifier and output the sentiment polarity.