Article Details

Title · Authors · Abstract · Keywords · DOI · References

Sentiment Analysis of Online Public Opinion Based on RoBERTa-CNN and Attention Pooling

WANG Jiahui, ZHANG Chunyan

(Department of Information Security Engineering, Xinjiang Police College, Urumqi 830011, China)

Section:Artificial Intelligence · Vol. 2026, Issue 19 · Pages:36-41 · 2096-4706(2026)19-0036-06 · CLC number:TP18 · Document code:A · DOI:10.19850/j.cnki.2096-4706.2026.19.008

Abstract

Addressing the issue of insufficient feature extraction in existing sentiment analysis methods for online public opinion texts, which leads to poor classification performance, this paper proposes a sentiment analysis model for online public opinion based on RoBERTa-CNN and attention pooling. First, the model utilizes the RoBERTa-wwm pre-trained language model to obtain deep dynamic contextual semantic representations of texts and extracts the [CLS] vector as the global semantic feature. Second, the model extracts local features in parallel through multi-scale convolutional layers. Then, an attention pooling mechanism is introduced to replace traditional max pooling, dynamically weighting and aggregating the contribution of each local feature to the classification task so as to retain more effective information. Finally, the global semantic feature and the local sentiment feature are concatenated and fused, and the sentiment category prediction is completed through a Softmax classifier. Experimental results on the Xinjiang tourism Sina Weibo public opinion dataset show that the model achieves an accuracy of 85.5% and an F1 score of 85.0%, outperforming multiple baseline models, thus verifying the effectiveness of the proposed model in online public opinion sentiment analysis tasks.

Keywords

pre-trained language model; Convolutional Neural Network; sentiment analysis; online public opinion

References

  1. [1] Lan Yuexin, Li Qifeng, He Wei, etc Listening to both sides leads to clarity: A mechanism for preventing cognitive risks in online public opinion based on group sentiment entropy [J]. Modern Intelligence, 2025, 45 (12): 103-117
  2. [2] Wang Ting, Yang Wenzhong A review of research on text sentiment analysis methods [J]. Computer Engineering and Applications, 2021, 57 (12): 11-24
  3. [3] Zhang Mingquan, Zhou Hui, Cao Jingang Research on dual BERT directed sentiment text classification based on attention mechanism [J]. Journal of Intelligent Systems, 2022, 17 (6): 1220-1227
  4. [4] Wang Chundong, Zhang Hui, Mo Xiuliang, etc A Review of Weibo Sentiment Analysis [J]. Computer Engineering and Science, 2022, 44 (1): 165-175
  5. [5] Yang Shuang, Chen Fen Research on Multi level Sentiment Classification of Weibo Based on SVM Multi feature Fusion [J]. Data Analysis and Knowledge Discovery, 2017, 1 (2): 73-79
  6. [6] Wang Lu, Ma Hongwei, Lv Huanhuan A review of aspect level text sentiment analysis [J]. Computer Applications, 2022, 42 (S2): 1-9
  7. [7] Devlin J,Chang M W,Lee K,et al. BERT: Pre training of Deep Bidirectional Transformers for Language Understanding[PP/OL].arXiv:1810.04805 [cs.CL].https://arxiv.org/abs/1810.04805.
  8. [8] Liu Y H,Ott M,Goyal N,et al. RoBERTa: A Robustly Optimized BERT Pretraining Approach[PP/OL].arXiv:1907.11692 [cs.CL].https://arxiv.org/abs/1907.11692?ref=gptechblog.com.
  9. [9] Cui Y M,Che W X,Liu T,et al. Pre-Training with Whole Word Masking for Chinese BERT[J].IEEE/ACM Transactions on Audio, Speech, and Language Processing,2021,29:3504-3514.
  10. [10] Li Hao, Zhang Jie Emotion analysis of epidemic comments based on RoBERTa WM-RCNN [J]. Computer and Digital Engineering, 2025, 53 (10): 2708-2712227

Funding

Social Science Fund Project of Xinjiang Uygur Autonomous Region (21BTJ070)

About the authors

Wang Jiahui (1992-), female, Han ethnicity, from Hami, Xinjiang, associate professor, master's student, research interests include online public opinion and natural language processing.