Network emotion text classification method based on deep semantic feature fusion
By improving the BERT pre-trained model and feature fusion techniques, and combining TextCNN, BiLSTM and TF-IDF, the limitations of feature extraction and fusion in online sentiment text classification are solved, achieving higher classification accuracy and feature interpretability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-18
- Publication Date
- 2026-03-27
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing technologies for classifying online sentiment text suffer from problems such as strong reliance on human resources, high limitations in feature design, single feature extraction dimensions, and rigid fusion mechanisms, resulting in insufficient classification accuracy and poor generalization ability.
An improved BERT pre-trained model is used in conjunction with TextCNN and BiLSTM channels to extract global, local and temporal semantic features. Dependency parsing and an improved TF-IDF method are combined to dynamically weight and fuse features at different levels to form a unified feature representation.
It improves the accuracy and feature interpretability of emotion text classification, enhances the model's versatility and robustness, and adapts to diverse online text classification needs.
Smart Images

Figure CN121743499A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of natural language processing technology, specifically relating to a network sentiment text classification method based on deep semantic feature fusion. Background Technology
[0002] With the popularization and development of social media, online commenting platforms, and online news information, online texts involving tobacco-related topics and containing users' subjective emotions have emerged on the Internet. Identifying and accurately classifying the emotional tendencies of such texts has become a core technical support for fields such as tobacco public opinion monitoring, public health analysis, intelligent customer service, and marketing strategy optimization. The accuracy of classification directly affects the decision-making efficiency and service quality of related businesses.
[0003] Currently, the classification methods for online sentiment texts in the industry can be mainly divided into three major technical schools. The technical principles and application limitations of each school are as follows: 1. Classification method based on sentiment dictionary: This type of method relies on manually constructed standardized sentiment dictionaries. It matches words in the text to be classified with predefined sentiment words, negation words, degree adverbs, etc. in the dictionary, and combines rule-based algorithms to determine the overall sentiment tendency of the text. However, its core weakness lies in its strong dependence on human resources. Not only does the construction and maintenance of the dictionary require a large investment of human resources, but it is also difficult to quickly adapt to the dynamic changes in language forms such as popular internet slang and emerging emotional expressions. It is prone to problems such as missed detection and mismatch of sentiment words, and its classification generalization ability is insufficient.
[0004] 2. Classification methods based on traditional machine learning: These methods, centered around models such as Support Vector Machines, Naive Bayes, and Logistic Regression, use manually designed shallow text features like word frequency, part-of-speech tags, and n-grams to input into the model for sentiment classification. Compared to sentiment dictionary methods, they possess a degree of self-learning capability, but the limitations of manual feature engineering are significant: firstly, manually designed features struggle to accurately capture the deep semantic connections and complex emotional logic within the text context; secondly, feature design has a high professional threshold, resulting in poor feature transferability across different scenarios and failing to meet the diverse classification needs of online text.
[0005] 3. Deep learning-based classification methods: With the development of natural language processing technology, deep learning models such as Convolutional Neural Networks (CNN), Bidirectional Long Short-Term Memory Networks (BiLSTM), and Pre-trained Language Models (BERT) have been widely used in sentiment text classification. These methods can automatically extract semantic features from text through the hierarchical structure of the model, significantly reducing the workload of manual feature design and uncovering deep semantic information. However, in practical applications, these methods still face several technical bottlenecks: First, the feature extraction dimensions of a single model are limited. For example, CNN excels at capturing local features but is weak in global semantic understanding, while BERT can extract global semantics but easily ignores local context and syntactic dependencies, resulting in insufficient completeness of feature representation. Second, the model cannot effectively distinguish the contribution of words with different parts of speech and different dependency relationships to sentiment expression, and pays insufficient attention to core sentiment words and degree adverbs, resulting in an imbalance in the weighting of sentiment features. Third, multi-source feature fusion often adopts static methods such as simple concatenation and weighted averaging, lacking an adaptive dynamic weighting mechanism, making it difficult to achieve optimal synergy between features at different levels, thus affecting classification accuracy and model interpretability. Summary of the Invention
[0006] The purpose of this invention is to provide a network sentiment text classification method based on deep semantic feature fusion, which can comprehensively utilize global, local and temporal semantic information, thereby improving the classification accuracy and feature interpretability of the model.
[0007] The technical solution adopted in this invention is a network sentiment text classification method based on deep semantic feature fusion, comprising the following steps: S1: Collect and preprocess data to build a dataset; S2 uses an improved BERT pre-trained model to perform dynamic word embedding encoding on the dataset text, extracts global contextual semantic features, and outputs the encoding feature matrix and attention weight matrix; S3, extracts local context features and temporal dependency features based on the encoded feature matrix; S4. Based on dependency parsing and pre-defined effective part-of-speech tagging, the dataset text is filtered to form a feature word set, and the improved TF-IDF method is used to statistically analyze the feature words to construct a sentiment feature matrix. S5 dynamically weights and fuses the emotion feature matrix and the attention weight matrix, while also fusing contextual features and temporal dependency features to obtain a unified feature representation; S6 inputs the unified feature representation into the fully connected layer and performs a linear mapping to generate a score vector. After being converted into an emotion category probability distribution by the Softmax layer, the emotion classification result is output.
[0008] The invention is further characterized in that, The data preprocessing in step S1 includes text cleaning, word segmentation, stop word filtering, and label re-encoding. The dataset is constructed by combining data augmentation and undersampling.
[0009] The improved BERT pre-trained model in step S2 is optimized by introducing an external emotion feature weight matrix T into the self-attention mechanism and using a dynamic learning weight fusion method. The attention fusion formula is shown below: ; In the formula, The attention parameters are weighted. These are the original attention parameters. To adjust the weight values, This is the weight matrix of the original text after the feature selection and feature extraction methods used.
[0010] In step S3, local context features are extracted by constructing a TextCNN channel. The TextCNN channel extracts n-gram local features through convolutional kernels, and then aggregates them using max pooling to obtain the local context features. The aggregation formula is shown below: ; In the formula, The hidden representation (or word vector) matrix of the input sequence. k Convolution kernel window size, The convolution weight matrix corresponding to the window size, There is typically one bias term for each filter. Local features of window size; Temporal dependency features are extracted by constructing BiLSTM channels. The BiLSTM channels capture the preceding and following contextual information through a bidirectional LSTM and output temporal dependency features, as shown in the following expression: ; In the formula, The input vector at a certain moment, Perform a forward LSTM, Captured temporal features.
[0011] In step S4, the preset effective parts of speech include verbs, nouns, adjectives, adverbs, interrogative words, and conjunctions. The selected emotion-related feature words include keywords, degree adverbs, and dependency core words. The feature word set provides the core vocabulary foundation for TF-IDF feature construction.
[0012] The improved TF-IDF method in step S4 sets a part-of-speech influence weight p and determines the value of p by combining it with the emotion category weighting. The part-of-speech influence weight p is a differentiated basic weight allocated according to the preset effective part-of-speech types, and is weighted and adjusted based on the emotion category corresponding to the text. The value of p for the same part of speech is different under different emotion categories. Simultaneously considering the weights of sentiment synonyms, this is achieved by incorporating the sentiment synonyms of feature words into word frequency statistics. The final TF-IDF value calculation expression is shown in the following formula: ; In the formula, This indicates the number of times word i appears in category j. This represents the total number of occurrences of all words in category j. This indicates the number of sentences in the current category that contain word i. This represents the number of sentences that contain word i but are not in the current category. To influence the weight of part-of-speech tags, their values are set using a data category weighting method.
[0013] Step S5 specifically includes the following steps: S501, Perform dimension adaptation between the attention weight matrix output in step S2 and the emotion feature matrix constructed in step S4 to ensure that the feature dimensions of the two are consistent. S502 introduces a linear layer, which takes the dimension-adapted attention weight matrix as input and generates adaptive weight coefficients in the 0-1 range through the Sigmoid activation function. These weight coefficients are adaptively updated during model training as the classification loss backpropagates. S503, using element-wise multiplication, the adaptive weight coefficients and the dimension-adapted emotion feature matrix are weighted and fused to obtain the fused features; S504 performs dimensionality compression on the extracted local context features and temporal dependency features to make their dimensions consistent with the dimensions of the fused features. Then, the three are integrated by feature concatenation to form a unified feature representation.
[0014] In step S6, the dimension of the score vector is the same as the number of emotion categories. After the Softmax layer converts the score vector into the probability distribution of each emotion category, it selects the category with the highest probability as the final emotion prediction result.
[0015] The beneficial effects of this invention are: This invention extracts global semantic features of text through an improved BERT pre-trained model, and captures local contextual features and temporal semantic dependency features through TextCNN and BiLSTM channels respectively, achieving collaborative extraction of multi-dimensional semantic information. This breaks through the limitations of traditional deep models in terms of single-dimensional feature extraction and insufficient capture of emotional information. At the same time, it relies on part-of-speech analysis and dependency parsing to screen core emotion-related feature words, and combines an improved TF-IDF statistical method to assign differentiated weights to feature words with different parts of speech and dependency relationships, effectively optimizing the weight allocation of emotional features and enhancing the model's sensitivity to key emotional expression words. Furthermore, this invention performs a learnable, dynamically weighted fusion of the emotion feature matrix constructed by the improved TF-IDF and the BERT attention weight matrix. The fusion ratio can be adaptively adjusted according to the contribution of each feature during training, which solves the drawbacks of the rigidity of traditional feature fusion mechanisms and improves the coordination and adaptability of features at different levels. It has strong versatility, robustness and engineering application value, and can significantly improve the classification accuracy of various emotion recognition tasks, providing strong technical support for emotion judgment work in fields such as public opinion monitoring, mental health analysis, and intelligent customer service. Attached Figure Description
[0016] Figure 1 This is a flowchart illustrating the network sentiment text classification method based on deep semantic feature fusion of the present invention. Detailed Implementation
[0017] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0018] Example 1 This invention relates to a network sentiment text classification method based on deep semantic feature fusion, such as... Figure 1 As shown, it includes the following steps: S1 collects tobacco-related online text data and accompanying manually labeled sentiment tags of various categories. The collected text data is preprocessed, including text cleaning to remove noise characters and invalid symbols, word segmentation, and stop word filtering. At the same time, the manually labeled tags are extracted and re-encoded into a single-label format. To address the problem of uneven distribution of various sentiments in the text, a balanced dataset is constructed by combining data augmentation and undersampling. The aim is to provide a high-quality, class-balanced input foundation for subsequent model training and avoid the negative impact of data bias on classification performance.
[0019] S2 employs an improved BERT pre-trained model to dynamically embed and encode words in the dataset text. The core objective is to enhance the model's explicit attention to key feature words in emotion classification, thereby improving the accuracy of emotion feature expression while maintaining the model's original semantic modeling capabilities. This encoding process extracts global contextual semantic features of the text, adapting to the dynamic changes in the semantics of network text and laying an overall semantic foundation for the subsequent extraction of various local and temporal features. Finally, it outputs an encoded feature matrix and an attention weight matrix, providing core data support for subsequent feature fusion.
[0020] S3. Based on the encoded feature matrix output in step S2, extract local context features and temporal dependency features. Relying on the global semantic information already contained in the encoded feature matrix, the extraction of local and temporal features can be more targeted and relevant. Among them, the extraction of local context features aims to capture the emotional expression information at the phrase level in the text, while the extraction of temporal dependency features is used to mine the long-distance semantic logical connections in the text. Together, they make up for the shortcomings of a single global feature in capturing detailed semantics and enrich the feature dimensions.
[0021] S4, based on dependency parsing and pre-defined effective part-of-speech tagging, filters the preprocessed dataset text from step S1, accurately locates and selects emotion-related keywords, degree adverbs, and dependency core words to form a feature word set, thereby eliminating irrelevant vocabulary interference and focusing on the core information of emotion expression; then, an improved TF-IDF method is used to statistically analyze this feature word set, and by optimizing the weight allocation logic of feature words, the differentiated contributions of different feature words in emotion expression are highlighted, and finally, a highly targeted and recognizable emotion feature matrix is constructed to provide exclusive feature support for emotion classification.
[0022] S5 involves dynamically weighting and fusing the emotion feature matrix constructed in step S4 with the attention weight matrix output in step S2. The fusion ratio is adaptively adjusted using learnable weight coefficients to address the rigidity and poor feature synergy issues of traditional static fusion mechanisms. Simultaneously, the fusion result is further integrated with the local contextual features and temporal dependency features extracted in S3 to achieve deep complementarity between global semantic features, local detail features, temporal logic features, and emotion-specific features. Ultimately, a unified feature representation that is comprehensive, coordinated, and adaptable is obtained, providing a solid foundation for subsequent accurate classification.
[0023] S6. The unified feature representation obtained in step S5 is input into the fully connected layer for linear mapping, converting the high-dimensional features into a score vector corresponding to the number of emotion categories. Then, the score vector is converted into a probability distribution of each emotion category through the Softmax layer, which intuitively reflects the probability that the text belongs to each emotion category. Finally, the category with the highest probability is selected as the emotion classification result of tobacco-related online text, so as to achieve accurate determination of emotion tendency and meet the core needs of emotion classification in scenarios such as tobacco public opinion monitoring and public health analysis.
[0024] Example 2 Based on Embodiment 1 above, the data preprocessing in step S1 of this invention specifically includes: text cleaning, which removes special symbols, garbled characters, redundant spaces, and meaningless semantic units to purify the text data and retain effective semantic information; word segmentation, based on dictionary matching or statistical word segmentation algorithms known in the field of natural language processing, decomposes continuous text into lexical units that can independently represent semantics; stop word filtering, which combines a general stop word list with tobacco-related topic-specific stop words (such as industry-wide function words and interjections without emotional connotations), removes words that do not contribute substantial emotional value to reduce noise interference; and tag re-encoding, which converts manually labeled multiple types of emotion tags into a standardized single-tag format to adapt to the input requirements of model training.
[0025] The dataset addresses the uneven distribution of various emotion samples in tobacco-related texts. Data augmentation employs well-known techniques in the field, such as synonym substitution, word order adjustment, and random insertion / deletion while preserving core semantics, to expand the number of minority emotion samples. Simultaneously, undersampling techniques are used to reasonably reduce the number of majority emotion samples. Through the synergistic effect of these two methods, a training dataset with balanced categories and reliable sample quality is obtained, ensuring the stability and generalization ability of subsequent model training.
[0026] Example 3 Based on Example 1 above, the improved BERT pre-training model in step S2 of this invention focuses on enhancing its ability to capture key information related to emotion classification. This is achieved by introducing an external emotion feature weight matrix T into the self-attention mechanism of the original BERT model. Simultaneously, a dynamic learning weight fusion method is used instead of static weight settings, enabling the model to adaptively adjust weight allocation according to the characteristics of text emotion expression. This improves the accuracy of emotion feature expression while maintaining the original semantic modeling capabilities. The attention fusion formula is shown below: ; In the formula, The attention parameters are weighted. These are the original attention parameters. To adjust the weight values, This is the weight matrix of the original text after the feature selection and feature extraction methods used.
[0027] Example 4 Based on Embodiment 3 above, in step S3 of this invention, based on the encoded feature matrix output in step S2, local context features and temporal dependency features are extracted in parallel through dual channels to achieve accurate capture of semantic information in different dimensions, as detailed below: A TextCNN channel is constructed, primarily used to capture phrase-level local sentiment information in text. This channel performs sliding convolution operations on the encoded feature matrix using convolution kernels of different sizes, selectively extracting n-gram local features and effectively mining the sentiment semantics formed by consecutive word combinations in the text. Subsequently, max pooling is used to aggregate the convolution output, filtering out key feature information within each local window, achieving feature dimensionality compression and core information enhancement, ultimately obtaining local contextual features. The aggregation formula is shown below: ; In the formula, The hidden representation (or word vector) matrix of the input sequence. k Convolution kernel window size, The convolution weight matrix corresponding to the window size, There is typically one bias term for each filter. Local features of window size.
[0028] Furthermore, a BiLSTM channel is constructed to uncover semantic logical connections and temporal changes in the text across distances. This channel employs a bidirectional LSTM structure, where the forward LSTM propagates from left to right along the text sequence to capture historical context information prior to the current moment; the backward LSTM propagates from right to left along the text sequence to capture future context information after the current moment; by fusing the outputs of the bidirectional propagation, a feature representation containing complete temporal connections is obtained, namely, temporal dependent features.
[0029] The expression is as follows: ; In the formula, The input vector at a certain moment, Perform a forward LSTM, Captured temporal features.
[0030] Example 5 Based on Embodiment 4 above, the core of step S4 of this invention is to provide a highly relevant foundation for subsequent TF-IDF feature construction through precise feature word selection. Specifically, it is implemented as follows: Preset effective parts of speech selection includes verbs, nouns, adjectives, adverbs, interrogative words, and conjunctions. This selection is based on the well-known semantic function logic of parts of speech in the field of natural language processing—verbs can reflect the tendency of emotion-related actions, nouns clearly indicate the core object of emotion, adjectives are the core parts of speech that directly carry the tendency of emotion, adverbs can strengthen or weaken the intensity of emotion expression, interrogative words can convey specific emotions such as doubt and confusion, and conjunctions maintain the semantic logical coherence of emotion expression. By focusing on these parts of speech that are strongly related to emotion expression, interference from words that do not contribute to emotion is eliminated from the source.
[0031] Based on the aforementioned pre-defined effective part-of-speech tagging and dependency parsing, emotion-related feature words are accurately selected from the preprocessed text. These include keywords carrying core emotional intent, degree adverbs regulating emotional intensity, and dependency core words maintaining the semantic logic of the text. Together, these three constitute a highly targeted feature word set with strong emotional relevance. This feature word set serves as the core lexical foundation for subsequent improvements to TF-IDF feature construction. It ensures that TF-IDF weight calculation focuses on key elements of emotional expression, effectively avoiding the noise impact of irrelevant words, and allowing the subsequently constructed emotion feature matrix to more accurately reflect the emotional tendency of the text.
[0032] Furthermore, the improved TF-IDF method in step S4 primarily enhances the accuracy of sentiment feature weight allocation through a dual optimization strategy, addressing the shortcomings of traditional TF-IDF in considering part-of-speech differences and sentiment correlation. The specific implementation is as follows: First, we designed a weight p for the influence of part of speech. This weight is based on the differences in the emotional expression function of preset effective parts of speech and assigns differentiated basic weights. At the same time, we adjust the weights in combination with the corresponding emotional category of the text. The p value of the same part of speech is different under different emotional categories. For example, the p value of an adjective is dynamically adapted to the difference in its contribution to emotional expression between "positive emotion" and "negative emotion", so that the weight allocation is more in line with the expression rules of specific emotional scenarios.
[0033] Secondly, the weighting of emotional synonyms is included. By simultaneously incorporating the emotional synonyms of feature words into the word frequency statistics, the shortcomings of single-word statistics in covering the diversity of emotional expression are compensated for, and the intensity of emotional emotion in the text is reflected more comprehensively. For example, the frequency of occurrence of synonyms of the feature word "satisfied" such as "content" and "pleasing" is included in the statistics to ensure the complete capture of emotional semantics.
[0034] The final TF-IDF value is calculated as follows: ; In the formula, This indicates the number of times word i appears in category j. This represents the total number of occurrences of all words in category j. This indicates the number of sentences in the current category that contain word i. This represents the number of sentences that contain word i but are not in the current category. To influence the weight of part-of-speech tags, their values are set using a data category weighting method.
[0035] Example 6 Based on Embodiment 5 above, step S5 of this invention achieves deep fusion through multi-stage feature processing to ensure the collaborative adaptation of features of different dimensions. Specifically, it includes the following steps: S501, the attention weight matrix output in step S2 and the emotion feature matrix constructed in step S4 are subjected to feature dimension adaptation processing. Through known techniques such as dimension adjustment and alignment, the feature dimensions of the two are fully matched, eliminating the dimensional barriers of subsequent weighted fusion and laying the foundation for accurate collaboration between features.
[0036] S502 introduces a linear layer as a weight generation module. The dimension-adapted attention weight matrix is input into this linear layer for feature transformation. Then, through the non-linear mapping characteristics of the Sigmoid activation function, adaptive weight coefficients in the 0-1 range are generated. These weight coefficients are not fixed values, but are continuously and adaptively updated during model training with classification loss as the optimization objective through backpropagation mechanism to ensure that the weight allocation can dynamically fit the needs of emotion classification and strengthen the contribution ratio of key features.
[0037] S503, using an element-wise multiplication weighted fusion method, performs corresponding element-wise operations on the adaptive weight coefficients generated in step S502 and the dimension-adapted emotion feature matrix, so that while retaining its own emotional semantic information, the emotion feature matrix incorporates the attention weights on key information, achieving a deep binding between emotion features and attention weights, and obtaining fusion features that focus on core emotional information.
[0038] In step S504, the local context features and temporal dependency features extracted in step S3 are adjusted using feature compression techniques (such as pooling and dimensionality reduction) to make their feature dimensions completely consistent with the fusion feature dimensions obtained in step S503. Subsequently, the fusion features, local context features, and temporal dependency features are horizontally integrated through feature concatenation to form a unified feature representation that combines global semantic attention, local emotional details, and temporal logical connections, providing comprehensive and coordinated feature support for subsequent accurate classification.
[0039] Furthermore, in step S6, the unified feature representation is first input into the fully connected layer, and the high-dimensional features are converted into a score vector through linear mapping. The dimension of the score vector is strictly consistent with the number of preset emotion categories, and the value of each dimension corresponds to the original score of the text belonging to the corresponding emotion category. Then, the score vector is input into the Softmax layer, and the original score is converted into a probability distribution of each emotion category in the range of 0-1 with a sum of 1 through normalization processing, which intuitively quantifies the possibility that the text belongs to each emotion category. Finally, the category with the highest value in the probability distribution is selected as the final emotion prediction result of tobacco-related network text, so as to achieve accurate determination of the emotional tendency of the text and meet the clear requirements of emotion classification in practical application scenarios.
[0040] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0041] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A network sentiment text classification method based on deep semantic feature fusion, characterized in that, Includes the following steps: S1: Collect and preprocess data to build a dataset; S2 uses an improved BERT pre-trained model to perform dynamic word embedding encoding on the dataset text, extracts global contextual semantic features, and outputs the encoding feature matrix and attention weight matrix; S3, extracts local context features and temporal dependency features based on the encoded feature matrix; S4. Based on dependency parsing and pre-defined effective part-of-speech tagging, the dataset text is filtered to form a feature word set, and the improved TF-IDF method is used to statistically analyze the feature words to construct a sentiment feature matrix. S5 dynamically weights and fuses the emotion feature matrix and the attention weight matrix, while also fusing contextual features and temporal dependency features to obtain a unified feature representation; S6 inputs the unified feature representation into the fully connected layer and performs a linear mapping to generate a score vector. After being converted into an emotion category probability distribution by the Softmax layer, the emotion classification result is output.
2. The network sentiment text classification method based on deep semantic feature fusion according to claim 1, characterized in that, The data preprocessing in step S1 includes text cleaning, word segmentation, stop word filtering, and label re-encoding. The dataset is constructed by combining data augmentation and undersampling.
3. The network sentiment text classification method based on deep semantic feature fusion according to claim 1, characterized in that, The improved BERT pre-trained model in step S2 is optimized by introducing an external emotion feature weight matrix T into the self-attention mechanism and using a dynamic learning weight fusion method. The attention fusion formula is shown below: ; In the formula, The attention parameters are weighted. These are the original attention parameters. To adjust the weight values, This is the weight matrix of the original text after the feature selection and feature extraction methods used.
4. The network sentiment text classification method based on deep semantic feature fusion according to claim 1, characterized in that, In step S3, local context features are extracted by constructing a TextCNN channel. The TextCNN channel extracts n-gram local features through convolutional kernels, and then aggregates them using max pooling to obtain the local context features. The aggregation formula is shown in the following formula: ; In the formula, The hidden representation (or word vector) matrix of the input sequence. k Convolution kernel window size, The convolution weight matrix corresponding to the window size, There is typically one bias term for each filter. Local features of window size; Temporal dependency features are extracted by constructing BiLSTM channels. The BiLSTM channels capture the preceding and following contextual information through a bidirectional LSTM and output temporal dependency features, as shown in the following expression: ; In the formula, The input vector at a certain moment, Perform a forward LSTM, Captured temporal features.
5. The network sentiment text classification method based on deep semantic feature fusion according to claim 1, characterized in that, In step S4, the preset effective parts of speech include verbs, nouns, adjectives, adverbs, interrogative words, and conjunctions. The selected emotion-related feature words include keywords, degree adverbs, and dependency core words. The feature word set provides the core vocabulary foundation for TF-IDF feature construction.
6. The network sentiment text classification method based on deep semantic feature fusion according to claim 1, characterized in that, The improved TF-IDF method in step S4 sets a part-of-speech influence weight p and determines the value of p by combining it with the emotion category weighting. The part-of-speech influence weight p is a differentiated basic weight allocated according to the preset effective part-of-speech types, and is weighted and adjusted based on the emotion category corresponding to the text. The value of p for the same part of speech is different under different emotion categories. Simultaneously considering the weights of sentiment synonyms, this is achieved by incorporating the sentiment synonyms of feature words into word frequency statistics. The final TF-IDF value calculation expression is shown in the following formula: ; In the formula, This indicates the number of times word i appears in category j. This represents the total number of occurrences of all words in category j. This indicates the number of sentences in the current category that contain word i. This represents the number of sentences that contain word i but are not in the current category. To influence the weight of part-of-speech tags, their values are set using a data category weighting method.
7. The network sentiment text classification method based on deep semantic feature fusion according to claim 1, characterized in that, Step S5 specifically includes the following steps: S501, Perform dimension adaptation between the attention weight matrix output in step S2 and the emotion feature matrix constructed in step S4 to ensure that the feature dimensions of the two are consistent. S502 introduces a linear layer, which takes the dimension-adapted attention weight matrix as input and generates adaptive weight coefficients in the 0-1 range through the Sigmoid activation function. These weight coefficients are adaptively updated during model training as the classification loss backpropagates. S503, using element-wise multiplication, the adaptive weight coefficients and the dimension-adapted emotion feature matrix are weighted and fused to obtain the fused features; S504 performs dimensionality compression on the extracted local context features and temporal dependency features to make their dimensions consistent with the dimensions of the fused features. Then, the three are integrated by feature concatenation to form a unified feature representation.
8. The network sentiment text classification method based on deep semantic feature fusion according to claim 1, characterized in that, In step S6, the dimension of the score vector is the same as the number of emotion categories. After the Softmax layer converts the score vector into the probability distribution of each emotion category, it selects the category with the highest probability as the final emotion prediction result.