Research on the emotional tendency of web texts based on long short-term memory network

Xiaojie LiJournal of Intelligent Systems 2021

Abstract

Through the analysis of emotional tendency in online public opinion, governments and enterprises can stabilize people’s emotion more effectively and maintain social stability. The problem studied in this paper is how to analyze the emotional tendency of online public opinion efficiently, and finally, this paper chooses deep learning algorithm to perform fast analysis of emotional tendency of online public opinion. This paper briefly introduced the structure of the basic model used for emotional tendency analysis of online public opinion and the convolutional neural network (CNN) model used for text emotion classification. Then, the CNN model was improved by long short-term memory (LSTM). A simulation experiment was carried out on MATLAB for the improved text emotion classification model to verify the influence of activation function type on the improved model and the performance difference between the improved model and support vector machine (SVM) and traditional CNN models. The results showed that the improved classification model that adopted the sigmoid activation function had higher accuracy and was less affected by language than the relu and tanh activation functions; the improved classification model had the highest accuracy, recall rate, and F-value in classifying emotional tendency of web texts, followed by the traditional CNN model and the SVM model.

Introduction

In the age of rapid information spread, online public opinion can shift social stability in hours. Governments and enterprises need to monitor these emotional shifts to address rumors or public concerns effectively. However, manual analysis is impossible given the sheer volume of data, and traditional automated methods struggle with the nuances of natural language. The authors identify two main hurdles: contextual blindness, where traditional encoding fails to capture word relationships, and model rigidity, where standard machine learning models like Support Vector Machines (SVM) fail to capture the complex, non-linear emotional patterns found in informal web texts.

Methodology

The researchers proposed a multi-stage pipeline to transform raw text into emotional insights. Initially, text is vectorized via the Word2Vec Skip-gram model to create dense vectors that preserve semantic context. The core innovation is the LSTM-CNN hybrid architecture.

Flowchart of the improved LSTM-CNN hybrid classification model.

As shown in the flowchart above, the process begins with an LSTM layer designed to extract long-term semantic dependencies while filtering out noise. The output is then converted into a 2D matrix, allowing a CNN to perform convolution and pooling operations to identify local emotional triggers. Furthermore, the study tested various activation functions, finding that the Sigmoid function provided the most stable results across different languages compared to ReLU and Tanh.

Experimental Results

The model was evaluated using two distinct datasets: 15,000 Chinese Weibo entries and 15,000 English film reviews. This cross-language approach demonstrated the model's versatility and its ability to handle different linguistic structures, such as the word segmentation required for Chinese text.

Accuracy comparison between SVM, traditional CNN, and the improved LSTM-CNN model across different datasets.

The improved LSTM-CNN model significantly outperformed both the traditional CNN and the SVM across all metrics. As illustrated in the comparison, the hybrid model achieved approximately 93.1% accuracy on the Weibo dataset and 92.7% on English film reviews when using the Sigmoid function. In contrast, the SVM model lagged behind with accuracies near 71-73%. The model also maintained a lead in F-value and recall, generally staying above the 92% mark.

Conclusion

This research highlights the effectiveness of combining LSTM for semantic pre-filtering with CNN for spatial pattern recognition in text. While the results are promising, future work is needed to address the computational overhead of hybrid architectures and to refine performance on complex linguistic nuances like Chinese word segmentation. Expanding the granularity of emotion detection beyond broad categories like happiness or anger remains a key goal for future public opinion analysis tools.

Summary updated

BibTeX
@article{li2021research,
  author = {Xiaojie Li},
  title = {{Research on the emotional tendency of web texts based on long short-term memory network}},
  journal = {Journal of Intelligent Systems},
  year = {2021},
  doi = {10.1515/jisys-2021-0088},
}
Figure