Sentiment classification of stock forum text based on a parameter-decoupled ERNIE-Transformer architecture
Abstract To address the challenges of diverse domain-specific terminology, highly colloquial expressions, and limited annotated samples in sentiment analysis of stock forum texts, this study proposes an ERNIE-Transformer sentiment classification model that integrates ERNIE and Transformer architectures. First, a systematic data preprocessing pipeline was developed, including sentiment label annotation, text cleaning, tokenization, stop-word removal, and sequence length normalization, to construct a high-quality classification corpus. Second, the knowledge-enhanced pretrained ERNIE model was employed as a fixed feature extractor to transform the preprocessed texts into high-dimensional dense vector representations, effectively capturing domain-specific semantics and contextual dependencies in Chinese financial texts. Third, a multi-layer stacked Transformer encoder was introduced as a lightweight classifier. Through the multi-head self-attention mechanism, the encoder performs secondary discriminative feature extraction and adaptive weight allocation on the sentence-level embeddings generated by ERNIE, thereby strengthening semantic signals that contribute significantly to classification decisions. Finally, grid search was applied to optimize key hyperparameters, while early stopping and learning rate scheduling strategies were incorporated to improve the model’s generalization capability.Experiments conducted on a dataset of 6,000 investor comments collected from the Eastmoney Stock Forum, consisting of three sentiment categories (positive, neutral, and negative) with an approximate distribution ratio of 35%/30%/35%, demonstrate that the proposed model achieves accuracy, precision, recall, and F1-score values of 92.75%, 89.14%, 87.21%, and 88.12%, respectively. Compared with the ERNIE fine-tuning baseline, the proposed model improves accuracy, precision, recall, and F1-score by 0.17, 0.70, − 0.25, and 0.20% points, respectively. Compared with the BERT-based Transformer baseline, it achieves improvements of 1.67, 3.35, 3.01, and 3.20% points in the four evaluation metrics. The experimental results indicate that the proposed approach achieves high classification accuracy for financial forum text sentiment analysis. Its decoupled architecture provides an efficient and accurate solution for investor sentiment monitoring.
Authors
- Ling Wenchao
- Xiumei Li (ORCID: https://orcid.org/0000-0003-3027-8129)
- Kun Chen (ORCID: https://orcid.org/0009-0005-2975-5495)
- Chen Fei
Institutions
- Dalian Jiaotong University (CN)
Publication Details
- Journal
- Journal of Electrical Systems and Information Technology
- Published
- 2026-09-16
- DOI
- https://doi.org/10.1186/s43067-026-00399-x
- Primary Topic
- Stock Market Forecasting Methods
- Type
- article
- Field-Weighted Citation Impact
- 0.00