journal article·2025-10-25Open access

A Data-Driven Multi-Granularity Attention Framework for Sentiment Recognition in News and User Reviews

Wenjie Hong, Shaozu Ling, Siyuan Zhang, Yinke Huang, Yiyan Wang, Zhengyang Li, Xiangjun Dong, Yan Zhan

Applied Sciences· Volume 15· Issue 21

Abstract

Sentiment analysis plays a crucial role in domains such as financial news, user reviews, and public opinion monitoring, yet existing approaches face challenges when dealing with long and domain-specific texts due to semantic dilution, insufficient context modeling, and dispersed emotional signals. To address these issues, a multi-granularity attention-based sentiment analysis model built on a transformer backbone is proposed. The framework integrates sentence-level and document-level hierarchical modeling, a different-dimensional embedding strategy, and a cross-granularity contrastive fusion mechanism, thereby achieving unified representation and dynamic alignment of local and global emotional features. Static word embeddings combined with dynamic contextual embeddings enhance both semantic stability and context sensitivity, while the cross-granularity fusion module alleviates sparsity and dispersion of emotional cues in long texts, improving robustness and discriminability. Extensive experiments on multiple benchmark datasets demonstrate the effectiveness of the proposed model. On the Financial Forum Reviews dataset, it achieves an accuracy of 0.932, precision of 0.928, recall of 0.925, F1-score of 0.926, and AUC of 0.951, surpassing state-of-the-art baselines such as BERT and RoBERTa. On the Financial Product User Reviews dataset, the model obtains an accuracy of 0.902, precision of 0.898, recall of 0.894, and AUC of 0.921, showing significant improvements for short-text sentiment tasks. On the Financial News dataset, it achieves an accuracy of 0.874, precision of 0.869, recall of 0.864, and AUC of 0.895, highlighting its strong adaptability to professional and domain-specific texts. Ablation studies further confirm that the multi-granularity transformer structure, the different-dimensional embedding strategy, and the cross-granularity fusion module each contribute critically to overall performance improvements.
Source: crossref · Quality: baseline

Research context

OpenAlex topics: Sentiment Analysis and Opinion Mining · Topic Modeling · Mental Health via Writing

SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.

Affiliations

National School of Development, Peking University, Beijing 100871, China

Artificial Intelligence Research Institute, Tsinghua University, Beijing 100084, China

Funding

National Natural Science Foundation of China

References (44)

Show source-provided references
1. A survey on sentiment analysis methods, applications, and challenges10.1007/s10462-022-10144-1 ↗
2. Analyzing public sentiment on sustainability: A comprehensive review and application of sentiment analysis techniques10.1016/j.nlp.2024.100097 ↗
3. Recent advancements and challenges of NLP-based sentiment analysis: A state-of-the-art review10.1016/j.nlp.2024.100059 ↗
4. Enhancing legal sentiment analysis: A convolutional neural network–long short-term memory document-level model10.3390/make6020041 ↗
5. Denecke, K., and Reichenpfader, D. (2023). Sentiment analysis of clinical narratives: A scoping review. J. Biomed. Inform., 140.10.1016/j.jbi.2023.104336 ↗
6. Designing heterogeneous llm agents for financial sentiment analysis10.1145/3688399 ↗
7. Financial sentiment analysis: Techniques and applications10.1145/3649451 ↗
8. Stock market forecasting using a neural network through fundamental indicators, technical indicators and market sentiment analysis10.1007/s10614-024-10711-4 ↗
9. AI-Based Credit Risk Assessment and Intelligent Matching Mechanism in Supply Chain Finance
10. Harper, C. (2025, October 22). From Black Swans to Early Warnings: Integrating Deep Learning in Systemic Risk Detection Across Global Economies. Available online: https://www.researchgate.net/publication/391902032_From_Black_Swans_to_Early_Warnings_Integrating_Deep_Learning_in_Systemic_Risk_Detection_Across_Global_Economies.
11. Hassan, A., and Mahmood, A. (2017, January 22–24). Deep learning approach for sentiment analysis of short texts. Proceedings of the 2017 3rd International Conference on Control, Automation and Robotics (ICCAR), Nagoya, Japan.10.1109/ICCAR.2017.7942788 ↗
12. Dong, Z., Tang, T., Li, L., and Zhao, W.X. (2023). A survey on long text modeling with transformers. arXiv.
13. Huo, Y., Liu, M., Zheng, J., and He, L. (2024). MGAFN-ISA: Multi-Granularity Attention Fusion Network for Implicit Sentiment Analysis. Electronics, 13.10.3390/electronics13244905 ↗
14. Liu, Y., Wang, J., Long, L., Li, X., Ma, R., Wu, Y., and Chen, X. (2025). A Multi-Level Sentiment Analysis Framework for Financial Texts. arXiv.
15. Sheng, D., and Yuan, J. (2021, January 5–7). An efficient long Chinese text sentiment analysis method using BERT-based models with BiGRU. Proceedings of the 2021 IEEE 24th International Conference on Computer Supported Cooperative Work in Design (CSCWD), Dalian, China.10.1109/CSCWD49262.2021.9437789 ↗
16. Chen, A., Wei, Y., Le, H., and Zhang, Y. (Br. J. Educ. Technol., 2024). Learning by teaching with ChatGPT: The effect of teachable ChatGPT agent on programming education, Br. J. Educ. Technol., early view.10.1111/bjet.70001 ↗
17. Zhang, L., Zhang, Y., and Ma, X. (2021, January 17–19). A new strategy for tuning ReLUs: Self-adaptive linear units (SALUs). Proceedings of the ICMLCA 2021; 2nd International Conference on Machine Learning and Computer Application, Shenyang, China.
18. Perumal Chockalingam, S., and Thambusamy, V. (2023, January 11–13). Enhancing Sentiment Analysis of User Response for COVID-19 Vaccinations Tweets Using SentiWordNet-Adjusted VADER Sentiment Analysis (SAVSA): A Hybrid Approach. Proceedings of the International Conference on Intelligent Systems Design and Applications, Olten, Switzerland.10.1007/978-3-031-64813-7_43 ↗
19. Lyu, S., Ren, X., Du, Y., and Zhao, N. (2023). Detecting depression of Chinese microblog users via text analysis: Combining Linguistic Inquiry Word Count (LIWC) with culture and suicide related lexicons. Front. Psychiatry, 14.10.3389/fpsyt.2023.1121583 ↗
20. Sentiment analysis and fake amazon reviews classification using SVM supervised machine learning model
21. Mishra, P., Patil, S.A., Shehroj, U., Aniyeri, P., and Khan, T.A. (2022, January 15–16). Twitter Sentiment Analysis using Naive Bayes Algorithm. Proceedings of the 2022 3rd International Informatics and Software Engineering Conference (IISEC), Ankara, Turkey.10.1109/IISEC56263.2022.9998252 ↗
22. Improving the Accuracy of Social Media Sentiment Classification with the Combination of Tf-Idf Method and Random Forest Algorithm10.63866/journix.v1i1.2 ↗
23. Kumaragurubaran, T., Pandi, S.S., Naresh, G., and Ragavender, T. (2024, January 24–26). Navigating Public Opinion: Enhancing Sentiment Analysis on Social Media with CNN and SVM. Proceedings of the 2024 5th International Conference for Emerging Technology (INCET), Belgaum, India.10.1109/INCET61516.2024.10592999 ↗
24. Aspect Based Feature Extraction in Sentiment Analysis using Bi-GRU-LSTM Model10.13052/jmm1550-4646.2048 ↗
25. Attention-based Models for Speech Recognition
26. Attention is all you need
27. RMHAN: Random Multi-Hierarchical Attention Network with RAG-LLM-Based Sentiment Analysis Using Text Reviews
28. Cambria, E., Zhang, X., Mao, R., Chen, M., and Kwok, K. (July, January 29). SenticNet 8: Fusing emotion AI and commonsense AI for interpretable, trustworthy, and explainable affective computing. Proceedings of the International Conference on Human-Computer Interaction, Washington DC, USA.
29. Li, Y., Su, Z., Chen, K., and Jiang, K. (July, January 30). Aspect-based Sentiment Analysis via Knowledge Enhancement. Proceedings of the 2024 International Joint Conference on Neural Networks (IJCNN), Yokohama, Japan.10.1109/IJCNN60899.2024.10650800 ↗
30. Yuan, B. (2025). FinBERT-QA: Financial Question Answering with pre-trained BERT Language Models. arXiv.
31. Chen, T., Zhang, Y., Yu, G., Zhang, D., Zeng, L., He, Q., and Ao, X. (2024). EFSA: Towards event-level financial sentiment analysis. arXiv.10.18653/v1/2024.acl-long.402 ↗
32. Machine learning techniques for emotion detection and sentiment analysis: Current state, challenges, and future directions10.1080/0144929X.2022.2156387 ↗
33. Koroteev, M.V. (2021). BERT: A review of applications in natural language processing and understanding. arXiv.
34. Sentiment classification with modified RoBERTa and recurrent neural networks10.1007/s11042-023-16833-5 ↗
35. A review on the attention mechanism of deep learning10.1016/j.neucom.2021.03.091 ↗
36. Datta, S.K., Shaikh, M.A., Srihari, S.N., and Gao, M. (2021, January 27). Soft attention improves skin cancer classification performance. Proceedings of the International Workshop on Interpretability of Machine Intelligence in Medical Image Computing, Strasbourg, France.10.1007/978-3-030-87444-5_2 ↗
37. Hard-attention for scalable image classification
38. Kovalyk, Y., Robinson, K., Langthorne, A., Whitestone, P., and Goldsborough, R. (2024). Dynamic hierarchical attention networks for contextual embedding refinement. TechRxiv.10.36227/techrxiv.173214280.08109027/v1 ↗
39. Integrating Multimodal Data for Enhanced Analysis and Understanding: Techniques for Sentiment Analysis and Cross-Modal Retrieval10.53555/jaz.v45iS4.4144 ↗
40. Khan, S.S., Mondal, P.K., Shaqib, S., Ahmed, N., Prova, N.N.I., and Sattar, A. (2024, January 24–28). Performance Analysis of LSTM and Bi-LSTM Model with Different Optimizers in Bangla Sentiment Analysis. Proceedings of the 2024 15th International Conference on Computing Communication and Networking Technologies (ICCCNT), Kamand, India.10.1109/ICCCNT61001.2024.10726142 ↗
41. Wu, Y., Jin, Z., Shi, C., Liang, P., and Zhan, T. (2024). Research on the application of deep learning-based BERT model in sentiment analysis. arXiv.10.54254/2755-2721/71/2024MA ↗
42. Rahman, M.M., Shiplu, A.I., Watanobe, Y., and Alam, M.A. (IEEE Trans. Emerg. Top. Comput. Intell., 2025). RoBERTa-BiLSTM: A context-aware hybrid model for sentiment analysis, IEEE Trans. Emerg. Top. Comput. Intell., early access.10.1109/TETCI.2025.3572150 ↗
43. Wohlin, C., Runeson, P., Höst, M., Ohlsson, M.C., Regnell, B., and Wesslén, A. (2012). Experimentation in Software Engineering, Springer.10.1007/978-3-642-29044-2 ↗
44. Antony, J. (2023). Design of Experiments for Engineers and Scientists, Elsevier.