A BERT-based multi-task learning framework for social media opinion mining with risk detection
Abstract This paper proposes a BERT-based multi-task learning framework for social media mining and risk detection. Unlike traditional open-loop architectures, the proposed system establishes a closed-loop feedback mechanism among crawling, analysis, and alerting modules, focusing on high-accuracy negative sentiment detection for social risk detection. A dataset of 4,238 texts is constructed, covering eight topic categories and three sentiment labels. A BERT-based multi-task framework with shared encoder and two task-specific heads jointly optimizes topic classification and sentiment analysis. Training uses AdamW (learning rate 2e-5, batch size 16, max length 128) for three epochs. The multi-task BERT model achieves 97.97% F1 for topic classification and 99.89% F1 for sentiment analysis. Negative sentiment detection reaches 100% accuracy. Compared to single-task models (98.34% and 99.76%), the multi-task model maintains comparable topic performance while improving sentiment analysis. Removing pre-training fine-tuning reduces training time by 7.9% with stable performance. The model performs two tasks in one inference, reducing deployment complexity while enabling reliable negative sentiment detection for social media opinion monitoring.
Authors
- Wei-Wei Liu (ORCID: https://orcid.org/0009-0001-6607-4577)
Institutions
- Education Department of Fujian Province (CN)
Publication Details
- Journal
- Scientific Reports
- Published
- 2026-10-16
- DOI
- https://doi.org/10.1038/s41598-026-76405-z
- Primary Topic
- Sentiment Analysis and Opinion Mining
- Type
- article
- Field-Weighted Citation Impact
- 0.00