Two-channel feature fusion Chinese sentiment analysis method based on self-attention mechanism

By introducing a dual-channel feature fusion method with a self-attention mechanism in Chinese sentiment analysis and combining it with CNN and LSTM networks, the shortcomings of existing methods in accuracy and adaptability are solved, and more efficient Chinese sentiment analysis is achieved.

CN120671677APending Publication Date: 2025-09-19XIAN UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510774699.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-11
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

Existing Chinese sentiment analysis methods have poor accuracy and adaptability, and it is difficult to effectively identify emotional tendencies in multi-context and multi-structure texts.

Method used

A dual-channel feature fusion method based on the self-attention mechanism is adopted to extract multi-scale semantic features through CNN and LSTM networks, and the self-attention mechanism is combined to enhance the model's ability to focus on key information.

Benefits of technology

It significantly improves the accuracy of Chinese sentiment analysis and the generalization ability of the model, and can more effectively identify complex word orders and sentiment modifiers. It is suitable for scenarios such as e-commerce review analysis and social network public opinion monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120671677A_ABST
    Figure CN120671677A_ABST
Patent Text Reader

Abstract

The invention discloses a two-channel feature fusion Chinese sentiment analysis method based on a self-attention mechanism, and the method comprises the steps: carrying out the coding expression of a sentiment text through employing a character as a basic unit, and obtaining a character level and a corresponding text level embedding vector; constructing a two-channel feature extraction architecture, extracting local semantic information by using CNN, and extracting global semantic information by using LSTM; a self-attention mechanism is introduced on the basis of dual-channel feature output, and features of different positions in the text are endowed with different weights; the extracted features are spliced and classified through a full connection layer, and an analysis result is output. According to the method, through character-level modeling and a multi-scale feature extraction structure, the multi-context adaptive capacity and sentiment analysis capacity of sentiment analysis are improved, a self-attention mechanism is introduced to endow the model with the attention capacity on key semantic words, the recognition capacity on different contexts and rhetorical structures is enhanced, and the recognition efficiency is improved. The method can be widely applied to emotion polarity rapid identification tasks of scenes such as social platforms and user generated content analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of Chinese sentiment analysis methods, and specifically relates to a Chinese sentiment analysis method based on a dual-channel feature fusion self-attention mechanism. Background Art

[0002] In today's highly information-rich and interconnected world, individuals and organizations generate vast amounts of Chinese text daily, including news, social media updates, customer feedback, and product reviews. These texts often contain rich sentiment and opinion, and understanding their underlying meaning has become a crucial requirement in fields such as marketing, customer service, and financial risk management. Sentiment analysis provides an effective means of interpreting the sentiment of these texts, helping to improve decision-making quality and user experience. The primary goal of sentiment analysis is to identify the emotional tendencies expressed in text and categorize them as positive, negative, or neutral. This technology can not only be used to understand public attitudes toward topics, brands, or events, but also to track user sentiment trends and extract valuable information for business or policy. In business and marketing, companies can use sentiment analysis to gauge customer opinion, track brand reputation, and fine-tune advertising campaigns. In politics, sentiment analysis helps monitor public opinion about candidates, policies, and elections. In healthcare, sentiment analysis helps analyze patient feedback and identify potential issues in healthcare services. Research on sentiment analysis systems can also help understand public sentiment and public opinion, assist in corporate brand management and market decision-making, optimize public relations and crisis management, and support social issues and public affairs. Summary of the Invention

[0003] The purpose of the present invention is to provide a dual-channel feature fusion Chinese sentiment analysis method based on the self-attention mechanism, which solves the problems of poor accuracy and adaptability of existing Chinese sentiment analysis methods.

[0004] The technical solution adopted by the present invention is: a dual-channel feature fusion Chinese sentiment analysis method based on the self-attention mechanism, comprising the following steps: Step 1: Obtain Chinese sentiment text data with labels and perform preprocessing; Step 2: Encode the preprocessed data using characters as basic units, and obtain character-level embedding vectors and corresponding text-level embedding vectors through the character embedding layer; Step 3: Build a CNN and LSTM dual-channel feature extraction architecture, extract multi-scale semantic features based on character-level embedding vectors and text-level embedding vectors, and concatenate them to form a fused semantic feature vector; Step 4: Based on the fused semantic feature vector, a self-attention mechanism is introduced to assign different weights to features at different positions in the text, and the features are concatenated to generate the final text vector representation; Step 5: Input the final text vector representation into the fully connected layer for classification and output the positive and negative analysis results.

[0005] The present invention is also characterized in that: The data acquisition method in step 1 is to obtain a sentiment analysis dataset with positive and negative sentiment labels from Chinese social platforms.

[0006] The preprocessing in step 1 is to remove noise information.

[0007] Step 2 specifically includes the following steps: Step 2.1: Set the preprocessed data to include Text, each text All by characters Composition, then the text Expressed as:

[0008] Step 2.2: For each character Perform one-hot encoding and map it into a high-dimensional sparse vector :

[0009] Where, Represents the total size of the character set. In the sparse vector, only one dimension is 1, and the rest of the elements are 0. express dimensional real number space; Step 2.3, through the embedding matrix For high-dimensional sparse vectors Perform linear transformation to obtain the low-dimensional dense vector of the character, that is, the character-level embedding vector :

[0010] Where, is the dimension of the embedding vector; is the bias vector; Step 2.4: Character-level embedding vector Text The embedding vector is represented as a text-level embedding vector : .

[0011] Step 3 specifically includes the following steps: Step 3.1. Select each character Front and back Characters build length The context window is based on the embedding vector of each character in the window Forming context representation vector :

[0012] Step 3.2: Represent the context vector As the input of the convolution kernel, the convolution operation is used to extract local context features to obtain the local semantic feature vector :

[0013] Where, represents the activation function, is the convolution kernel weight matrix, represents the convolution operation, is the bias term corresponding to the convolution operation; Step 3.3: Embed the text level vector As the input of the global channel LSTM, the global context features are extracted to obtain the global semantic feature vector :

[0014] Where, the last hidden state of LSTM is As a global feature of text ; Step 3.4: Transform the global semantic feature vector and local semantic feature vector Do overall splicing to form a fused semantic feature vector sequence : .

[0015] Step 4 specifically includes the following steps: Step 4.1: fusion of semantic feature vector sequence Perform linear mapping to generate query matrices , key matrix Sum Matrix :

[0016] Where, 、 、 are all weight matrices; Step 4.2: Calculate the attention distribution matrix using the inner product relationship between the query and key vectors Measure the degree of correlation between different positions:

[0017] Where, represents the matrix transpose operation, is the scaling factor; Step 4.3, through the value matrix According to the attention distribution matrix Weighted summation to obtain the enhanced feature matrix :

[0018] Step 4.4: Use residual connection to combine the fused semantic feature vector sequence And the enhanced feature matrix Add to form the updated feature sequence :

[0019] Step 4.5: Update the feature sequence Apply the maximum pooling operation to generate the final text vector representation : .

[0020] Step 5 specifically includes the following steps: Step 5.1: Represent the final text vector Input the fully connected layer and use the Softmax activation function to output the probability distribution of sentiment classification. Expressed as:

[0021] Where, 、 Corresponding to the prediction scores of the model on the two categories; Step 5.2: Use the binary cross entropy loss function as the optimization target and combine it with the Adam optimization algorithm to iteratively update the parameters. The loss function is as follows:

[0022] Where, is the true label, The sentiment polarity probability output by the model; Step 5.3: In the prediction stage, based on the sentiment probability value output by the model Classify and combine the set judgment threshold to achieve the final emotional tendency classification :

[0023] Where, is the classification decision threshold.

[0024] The classification decision threshold in step 5.3 Set to 0.5.

[0025] The beneficial effects of the present invention are as follows: the dual-channel feature fusion Chinese sentiment analysis method based on the self-attention mechanism is oriented towards the sentiment discrimination task of multi-context and multi-structure text. By constructing a dual-channel feature extraction architecture and combining it with a gated residual connection mechanism, it significantly enhances the ability to capture local features and model global semantics. The further introduction of the self-attention mechanism enables adaptive attention to key information, thereby improving the recognition effect of complex word order and sentiment modifiers. The present invention has good generalization ability and practical application value in Chinese sentiment classification application scenarios such as e-commerce review analysis and social network public opinion monitoring. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 Schematic diagram of the process of the dual-channel feature fusion Chinese sentiment analysis method based on the self-attention mechanism of the present invention; Figure 2 Schematic diagram of the architecture of the dual-channel feature fusion Chinese sentiment analysis method based on the self-attention mechanism of the present invention; Figure 3 is an example illustration of a single word embedding operation; Figure 4 It is the structural diagram of the CNN model; Figure 5 This is the structural diagram of the LSTM model; Figure 6 It is a calculation flow chart of the self-attention mechanism module of the present invention; Figure 7 This is a curve chart showing the changes in the training accuracy and test accuracy of the Douban dataset model. Figure 8 This is a curve chart showing the changes in the training accuracy and test accuracy of the Weibo dataset model; Figure 9 This is a comparison chart of the average accuracy of different models. DETAILED DESCRIPTION

[0027] The present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.

[0028] Example 1 The present invention provides a dual-channel feature fusion Chinese sentiment analysis method based on self-attention mechanism, such as Figure 1As shown, first, a sentiment analysis dataset with positive and negative labels is obtained from a Chinese social platform, and the Chinese text is preprocessed, including removing stop words and special characters; the processed text is embedded at the character level to generate a fixed-length vector representation; a convolutional neural network is used to extract local semantic features, and an LSTM network is used to extract global semantic features, and the extracted features are spliced; a self-attention mechanism is introduced to enhance the model's ability to model semantic relationships; true sentiment polarity classification is completed through a fully connected layer; a cross-entropy loss function is used for model training, and model parameters are updated through multiple rounds of iterations; in the testing phase, new input text is classified and the sentiment polarity recognition result is output. The method of the present invention gives the model the ability to pay attention to key semantic words through the self-attention mechanism, and combines the multi-scale feature extraction capabilities of CNN and LSTM, effectively improving the analysis accuracy and model generalization ability in Chinese scenarios, and is suitable for sentiment analysis tasks such as social media content and user feedback analysis.

[0029] The overall network architecture of the model of the present invention is shown in FIG. Figure 2 As shown in the figure, it includes the embedding layer, feature extraction layer, self-attention mechanism module and classification output layer. The specific implementation is as follows: Step 1: Obtain labeled Chinese sentiment text data from social platforms or user feedback-related datasets, and clean the obtained Chinese sentiment text, including removing noise information such as special symbols, HTML tags, stop words, web links, and non-language characters to ensure the standardization and consistency of text input.

[0030] Step 2: This stage decomposes and encodes the preprocessed Chinese sentiment corpus. Using an embedding layer, each character is mapped into a low-dimensional continuous vector, thereby constructing a vectorized input form that the neural network can accept. This character-level embedding strategy helps the model capture fine-grained linguistic features. Figure 3 Shows examples of how individual words are represented in the embedding process.

[0031] Step 3: Figure 4 and Figure 5 As shown in the figure, a dual-channel feature extraction neural network structure is constructed to extract local and global semantic features of emotional text at multiple scales to form a basic semantic representation.

[0032] Step 4: Figure 6 As shown in the figure, after obtaining the initial feature representation, the self-attention mechanism is introduced to model the feature differences at different positions in the input sequence. This mechanism can assign different weights to highlight key emotional segments, thereby enhancing the model's ability to respond to important emotional signals in the sentence.

[0033] Step 5: Input the fused deep semantic features into the fully connected layer for mapping and discrimination to achieve the classification output of sentiment polarity, thereby completing the recognition and analysis of text sentiment.

[0034] Step 6: During the model training phase, real social media platform corpora are selected as the data source, and network parameters are optimized during the training process. After model training is completed, its parameter weights can be persisted and reused in other tasks or platforms, achieving efficient sentiment prediction for newly added text.

[0035] Example 2 The present invention provides a dual-channel feature fusion Chinese sentiment analysis method based on the self-attention mechanism. Based on Example 1, step 2 is preferably: Step 2.1: Assume that the preprocessed corpus contains Chinese sentiment texts, each text All by characters It can be formalized as follows:

[0036] Step 2.2: Since the original characters are discrete symbols and cannot be directly processed by the neural network, they must first be converted into vector form. To this end, the unique hot encoding method is first used to convert each character Mapping to high-dimensional sparse vector :

[0037] Where, is the size of the character dictionary, that is, the dimension of the one-hot vector; this vector is 1 at the corresponding character index and 0 at all other positions.

[0038] Step 2.3: Due to the high dimensionality and limited expression of one-hot encoding, we introduce an embedding layer to project it into a low-dimensional continuous vector space. Perform linear transformation and bias translation to obtain compact dense representation :

[0039] In the formula, the embedding matrix Responsible for converting the one-hot vector into a D-dimensional embedding vector, bias term Used to optimize expression effects.

[0040] Step 2.4: Combine the embedding vectors of each character in order to form the entire text Character-level representation of , specifically expressed as:

[0041] This representation embeds the entire text as a sequence of character vectors, providing continuous and differentiable input for subsequent feature extraction and model learning. This embedding strategy helps the model capture contextual information and semantic connections between characters, thereby enhancing representational capabilities and generalization performance in sentiment analysis tasks.

[0042] Example 3 The present invention provides a dual-channel feature fusion Chinese sentiment analysis method based on the self-attention mechanism. Based on Example 1, step 3 is preferably: Step 3.1: Use CNN for feature modeling to extract local n-gram-level patterns, LSTM to extract global semantic features, and combine the self-attention mechanism to further enhance the key emotional text expression ability. , with it as the center, characters, the construction length is The context window is formed based on the embedding vector of each character in the window to form a context representation vector , specifically expressed as:

[0043] Where, Indicates the character The center is a sequence of embedding vectors containing its neighboring context characters; Represents characters Embedding vector of Indicates the window radius, i.e., the forward and backward characters.

[0044] Step 3.2: In the convolution calculation phase, a sliding convolution window mechanism is used to extract local context features. The entire text sequence is scanned by the convolution kernel. Each window is regarded as a convolution receptive field, and features are extracted through the convolution operation. As the input of the convolution kernel, the local context features are extracted by convolution operation. The result of the convolution operation is recorded as the local feature vector , the calculation formula is as follows:

[0045] Where, is the convolution kernel weight matrix; is the bias term corresponding to the convolution operation; Represents the convolution operation; Represents the activation function, which is used to increase the nonlinear expression ability of features.

[0046] Step 3.3: In the sequence modeling phase, a long short-term memory network is used to extract the global semantic features of the text. LSTM captures long-range dependencies in the context through a recursive structure and models the input text vector sequence to retain the long-term semantic information in the sentence. Taking the embedding representation of the entire text sequence as input, LSTM gradually encodes the sequence to obtain the hidden state vector at each time step. , and its corresponding LSTM hidden state is . Then the LSTM update calculation is as follows:

[0047] Where, is the hidden state at the current time step, is the cell state at the current time step, They are forget gate, input gate and output gate respectively. Represents candidate memory information, which determines the new information of the current time step, is the weight matrix input to each gate, is the weight matrix from the hidden state of the previous time step to each gate, is the bias term of each gate, the last hidden state of LSTM As a global feature of text .

[0048] Step 3.4, by and Splicing to form a whole local feature sequence , used to characterize the feature vector after text fusion:

[0049] Where, Represents text The number of characters.

[0050] Example 4 The present invention provides a dual-channel feature fusion Chinese sentiment analysis method based on the self-attention mechanism. Based on Example 1, step 4 is preferably: Step 4.1: In order to further improve the expressiveness of text sentiment features, the self-attention mechanism is introduced. In this process, the fused feature sequence is first Perform linear mapping operations and multiply by the weight matrix 、 、 Calculate the corresponding query moment , key matrix Sum Matrix , the formula is:

[0051] Step 4.2: Based on the query and key vectors generated above, calculate the attention weight matrix A to measure the correlation between each position in the input sequence. The formula is as follows:

[0052] in, Represents the matrix transpose operation, the purpose of which is to prevent the gradient from being too large or disappearing; Represents the dimension scaling factor of the key vector.

[0053] Step 4.3. Next, the attention matrix and value matrix Perform weighted summation to generate the enhanced representation matrix , the formula is:

[0054] This representation can integrate the global dependency information within the text, thereby improving the model's recognition ability in complex semantic structures, especially showing stronger modeling effects when dealing with cross-phrase or cross-sentence dependencies.

[0055] Step 4.4: In order to fuse the original representation and the enhanced representation, a residual connection is used to Add to the original feature sequence to generate an updated feature sequence , the formula is:

[0056] Step 4.5: Final alignment of the sequence Perform the maximum pooling operation to extract the most significant context features and obtain the global semantic representation , the formula is:

[0057] Where, That is, the overall vector representation of the text after pooling and integration, which serves as the input feature of the subsequent classification task.

[0058] Example 5 The present invention provides a dual-channel feature fusion Chinese sentiment analysis method based on the self-attention mechanism. Based on Example 1, step 5 is preferably: Step 5.1: After completing the text representation, the extracted text features need to be further classified to determine their sentiment polarity. The goal of the classification task is to predict the probability of a given text being "positive" or "negative" based on the feature representation learned by the model. The specific operation is: the pooled feature vector Input to the fully connected layer and output the binary classification probability through the Softmax activation function. is defined as:

[0059] Where, 、 are the scores of the two categories, output by the model.

[0060] Step 5.2: To improve the prediction accuracy of the model, binary cross entropy is used as the loss function for optimization. This loss function can effectively measure the difference between the model output and the true label. The formula is as follows:

[0061] in, is the true label, Represents the probability of positive sentiment output by the model. The Adam optimization algorithm is used during training to accelerate convergence and improve model performance.

[0062] Step 5.3: In the testing phase, for a given emotional text , the model outputs its corresponding probability value , classify it according to the preset threshold and get the final prediction label To classify:

[0063] in, is the final classification result; is the classification decision threshold, which is usually set to 0.5.

[0064] Example 6 The trained analysis model is used to test the test data. After obtaining the output results, the results are evaluated using accuracy, precision, recall, and F1 score as evaluation criteria. The pseudo code of the dual-channel feature fusion algorithm based on the self-attention mechanism is shown in Table 1.

[0065] Table 1 Pseudo code of dual-channel feature fusion network algorithm based on self-attention mechanism

[0066] To validate the effectiveness of our model in sentiment analysis, we conducted experiments on two representative Chinese social media datasets: the Taobao dataset and the Douban dataset. These datasets, drawn from a wide range of Chinese social media platforms, such as Sina Weibo and Douban's film and television rating platform, provide sentiment analysis annotations in real-world social contexts, enabling a comprehensive assessment of the model's effectiveness in actual Chinese text sentiment analysis tasks.

[0067] The Weibo dataset is a binary classification dataset containing 15,000 social text messages with positive and negative labels, of which 7,542 are labeled as positive and 7,458 as negative. This dataset, derived from real Weibo corpus, features a more colloquial style, diverse language, frequent short sentences, and emotional expressions. It is suitable for building classification models for sentiment recognition tasks in Chinese short text.

[0068] The Douban dataset is primarily used to analyze user sentiment and perspectives. The text is relatively long and has complex semantic structures. It contains 15,000 film review samples, of which 7,621 are positive and 7,379 are negative. This dataset was selected to enhance the model's adaptability and generalization capabilities for complex emotional expressions and long text dependency modeling.

[0069] In the experiment, the CLATT model proposed in this invention was applied to the above two datasets respectively. Combining convolutional extraction with the global modeling capabilities of LSTM, a horizontal comparative analysis was conducted with multiple mainstream models. The accuracy and robustness of the invention were systematically verified on the Chinese social media sentiment analysis dataset.

[0070] Figure 7 and Figure 8 The curve changes of the training accuracy and test accuracy of the present invention in 50 epochs on the Douban and Weibo datasets are shown. The training and test accuracy always maintain a small gap, indicating that the model effectively integrates local and global features, and at the same time enhances the focus on key emotional components through the attention mechanism, thereby achieving strong adaptability and generalization ability. Figure 9 The results show the average accuracy comparison of different models on all data sets. It can be seen that the classification accuracy of the method of the present invention is better than that of other mainstream models on both data sets, and it has strong classification and discrimination capabilities. The fusion of convolution, recurrent network, attention mechanism and gated residual structure has obvious advantages in capturing the emotional characteristics of text. In order to verify the effectiveness of the Chinese sentiment analysis method based on dual-channel feature fusion of self-attention mechanism in the present invention, six comparison algorithms are used to compare with the classification algorithm of the present invention. The specific experimental results are shown in Tables 2 and 3.

[0071] Table 2 Algorithm comparison results

[0072] Table 3 Algorithm comparison results

[0073] On the Douban long text dataset, CLATT significantly outperforms traditional models and is close to the optimal level. The model achieved an accuracy of 88.58% and an F1 value of 88.74% on this dataset, second only to BERT+CNN (Acc: 88.82%, F1: 89.07%), but an increase of more than 11 percentage points compared to LSTM (Acc: 76.98%, F1: 77.39%), indicating that this model has significantly enhanced its ability to model sentiment features in complex contexts and has strong robustness and context-awareness.

[0074] In the Weibo dataset, the model performed reliably despite complex emotional expressions. CLATT maintained an F1 score of 85.70%, second only to BERT+CNN (86.76%), a gap of 1.06 percentage points. However, compared to LSTM (76.43%) and TEXT-CNN (74.18%), it achieved improvements of 9.27% ​​and 11.52%, respectively, demonstrating the model's excellent ability to extract complex emotions, such as those expressed in formal expressions. The model demonstrated particularly strong stability in reviews containing multiple evaluations, such as those on product quality and service.

[0075] Through this approach, the present invention demonstrates high accuracy and robustness in Chinese social media scenarios. By introducing a self-attention mechanism, the model dynamically focuses on key semantic information within the text, enhancing its ability to identify misleading content and emotionally expressive keywords. This structural design effectively enhances the model's ability to model and generalize complex semantic relationships, and is widely applicable to scenarios such as analyzing social platform content and user-generated content.

Claims

1. A dual-channel feature fusion Chinese sentiment analysis method based on self-attention mechanism, characterized by: The following steps are involved: Step 1: Obtain Chinese sentiment text data with labels and perform preprocessing; Step 2: Encode the preprocessed data using characters as basic units, and obtain character-level embedding vectors and corresponding text-level embedding vectors through the character embedding layer; Step 3: Build a CNN and LSTM dual-channel feature extraction architecture, extract multi-scale semantic features based on character-level embedding vectors and text-level embedding vectors, and concatenate them to form a fused semantic feature vector; Step 4: Based on the fused semantic feature vector, a self-attention mechanism is introduced to assign different weights to features at different positions in the text, and the features are concatenated to generate the final text vector representation; Step 5: Input the final text vector representation into the fully connected layer for classification and output the positive and negative analysis results.

2. The Chinese sentiment analysis method based on dual-channel feature fusion and self-attention mechanism according to claim 1 is characterized in that: The data acquisition method in step 1 is to obtain a sentiment analysis dataset with positive and negative sentiment labels from a Chinese social platform.

3. The Chinese sentiment analysis method based on dual-channel feature fusion and self-attention mechanism according to claim 1 is characterized in that: The preprocessing in step 1 is to remove noise information.

4. The Chinese sentiment analysis method based on dual-channel feature fusion and self-attention mechanism according to claim 1 is characterized in that: The step 2 specifically includes the following steps: Step 2.1: Set the preprocessed data to include Text, each text All by characters Composition, then the text Expressed as: Step 2.2: For each character Perform one-hot encoding and map it to a high-dimensional sparse vector : Where, Represents the total size of the character set. In the sparse vector, only one dimension is 1, and the rest of the elements are 0. express dimensional real number space; Step 2.3, through the embedding matrix For high-dimensional sparse vectors Perform linear transformation to obtain the low-dimensional dense vector of the character, that is, the character-level embedding vector : Where, is the dimension of the embedding vector; is the bias vector; Step 2.4: Character-level embedding vector Text The embedding vector is represented as a text-level embedding vector : 。 5. The Chinese sentiment analysis method based on dual-channel feature fusion and self-attention mechanism according to claim 4 is characterized in that: The step 3 specifically includes the following steps: Step 3.

1. Select each character Front and back Characters build length The context window is based on the embedding vector of each character in the window Forming context representation vector : Step 3.2: Represent the context vector As the input of the convolution kernel, the convolution operation is used to extract local context features to obtain the local semantic feature vector : Where, represents the activation function, is the convolution kernel weight matrix, represents the convolution operation, is the bias term corresponding to the convolution operation; Step 3.3: Embed the text level vector As the input of the global channel LSTM, the global context features are extracted to obtain the global semantic feature vector : Where, the last hidden state of LSTM is As a global feature of text ; Step 3.4: Transform the global semantic feature vector and local semantic feature vector Do overall splicing to form a fused semantic feature vector sequence : 。 6. The Chinese sentiment analysis method based on dual-channel feature fusion and self-attention mechanism according to claim 5 is characterized in that: The step 4 specifically includes the following steps: Step 4.1: fusion of semantic feature vector sequence Perform linear mapping to generate query matrices , key matrix Sum Matrix : Where, 、 、 are all weight matrices; Step 4.2: Calculate the attention distribution matrix using the inner product relationship between the query and key vectors Measure the degree of correlation between different positions: Where, represents the matrix transpose operation, is the scaling factor; Step 4.3, through the value matrix According to the attention distribution matrix Weighted summation to obtain the enhanced feature matrix : Step 4.4: Use residual connection to combine the fused semantic feature vector sequence And the enhanced feature matrix Add to form the updated feature sequence : Step 4.5: Update the feature sequence Apply the maximum pooling operation to generate the final text vector representation : 。 7. The Chinese sentiment analysis method based on dual-channel feature fusion and self-attention mechanism according to claim 6 is characterized in that: The step 5 specifically includes the following steps: Step 5.1: Represent the final text vector Input the fully connected layer and use the Softmax activation function to output the probability distribution of sentiment classification. Expressed as: Where, 、 Corresponding to the prediction scores of the model on the two categories respectively; Step 5.2: Use the binary cross entropy loss function as the optimization target and combine it with the Adam optimization algorithm to iteratively update the parameters. The loss function is as follows: Where, is the true label, The sentiment polarity probability output by the model; Step 5.3: In the prediction stage, based on the sentiment probability value output by the model Classify and combine the set judgment threshold to achieve the final emotional tendency classification : Where, is the classification decision threshold.

8. The Chinese sentiment analysis method based on dual-channel feature fusion and self-attention mechanism according to claim 7 is characterized in that: The classification decision threshold in step 5.3 Set to 0.5.