Mental Health Sentiment Analysis: Exploring an Optimized BERT with Deep Encodings

Authors

  • Abdul Rehman Cadet College Hasanabdal, Attock, Pakistan
  • Muzamil Ahmed Department of Computer Science, Namal University Mianwali, Pakistan
  • Hikmat Ullah Khan Department of Information Technology, University of Sargodha, Sargodha, Pakistan
  • Amal Bukhari Department of Information Systems and Technology, College of Computer Science and Engineering, University of Jeddah, Saudi Arabia
  • Ali Daud Faculty of Resilience, Rabdan Academy, Abu Dhabi, United Arab Emirates
  • Hussain Dawood School of Computing, Skyline University College, University City Sharjah, UAE
Volume: 15 | Issue: 5 | Pages: 26242-26248 | October 2025 | https://doi.org/10.48084/etasr.10469

Abstract

Deep learning technologies have significantly advanced the field of Natural Language Processing (NLP) in the recent past. A promising line of research in the existing study of text sentiment is the analysis of medical texts, which can potentially find numerous uses in medical diagnosis. However, sentiment analysis in the medical field remains challenging due to the complexity of medical language and context-aware interpretation of domain-specific ontologies. This paper focuses on the medical field and uses deep encoding techniques such as Fast-Text, Word2Vec, along with BERT and RoBERTa at the output layer for sentiment detection. The analysis specifically targets seven key mental health classes: Anxiety, Bipolar, Depression, Normal, Personality Disorder, Stress, and Suicidal. Text data were preprocessed using text cleaning, stop word elimination, and lemmatization to enhance the quality of the input data and improve the effectiveness of models. Experiments were carried out on a mental health dataset to analyze performance after the integration of deep encoding with diverse deep learning models. Based on the results, transformer-based models outperformed various other networks, achieving more than 95% accuracy. This study provides a basis for the selection of appropriate models in achieving accurate sentiment analysis within the medical field and is useful for research on designing efficient model frameworks.

Keywords:

sentiment analysis, medical text, deep learning, natural language processing, transformer models

Downloads

Download data is not yet available.

Author Biography

Ali Daud, Faculty of Resilience, Rabdan Academy, Abu Dhabi, United Arab Emirates

 

 

 

References

M. Mahyoob, J. Algaraady, M. Alrahiali, and A. Alblwi, "Sentiment Analysis of Public Tweets Towards the Emergence of SARS-CoV-2 Omicron Variant: A Social Media Analytics Framework," Engineering, Technology & Applied Science Research, vol. 12, no. 3, pp. 8525–8531, Jun. 2022.

M. K. Myee, R. D. C. Rebekah, T. Deepa, G. D. Zion, and K. Lokesh, "Detection of Depression in Social Media Posts using Emotional Intensity Analysis," Engineering, Technology & Applied Science Research, vol. 14, no. 5, pp. 16207–16211, Oct. 2024.

Y. Abdelwahab, M. Kholief, and A. A. H. Sedky, "Justifying Arabic Text Sentiment Analysis Using Explainable AI (XAI): LASIK Surgeries Case Study," Information, vol. 13, no. 11, Nov. 2022, Art. no. 536.

J. K. Lin, T. W. Chien, Y. T. Yeh, S. Y. C. Ho, and W. Chou, "Using sentiment analysis to identify similarities and differences in research topics and medical subject headings (MeSH terms) between Medicine (Baltimore) and the Journal of the Formosan Medical Association (JFMA) in 2020: A bibliometric study," Medicine, vol. 101, no. 11, Mar. 2022, Art. no. e29029.

D. B. Fogel, "On the Growing Opportunity to Use Sentiment Analysis to Support Artificial Intelligence Applications in Healthcare," Psychology and Behavioral Science International Journal, vol. 10, no. 2, pp. 1–3, Jan. 2019.

T. Abbas et al., "IoMT-Based Healthcare Systems: A Review," Computer Systems Science and Engineering, vol. 48, no. 4, 2024.

R. Alharbey, J. I. Kim, A. Daud, M. Song, A. A. Alshdadi, and M. K. Hayat, "Indexing important drugs from medical literature," Scientometrics, vol. 127, no. 5, pp. 2661–2681, May 2022.

H. Huang, A. A. Zavareh, and M. B. Mustafa, "Sentiment Analysis in E-Commerce Platforms: A Review of Current Techniques and Future Directions," IEEE Access, vol. 11, pp. 90367–90382, 2023.

Z. Yang, D. Yang, C. Dyer, X. He, A. Smola, and E. Hovy, "Hierarchical Attention Networks for Document Classification," in Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, San Diego, CA, USA, 2016.

S. Xiong, H. Lv, W. Zhao, and D. Ji, "Towards Twitter sentiment classification by multi-level sentiment-enriched word embeddings," Neurocomputing, vol. 275, pp. 2459–2466, Jan. 2018.

J. Yu, J. Jiang, and R. Xia, "Global Inference for Aspect and Opinion Terms Co-Extraction Based on Multi-Task Neural Networks," IEEE/ACM Transactions on Audio, Speech, and Language Processing, vol. 27, no. 1, pp. 168–177, Jan. 2019.

Z. Yuan, S. Wu, F. Wu, J. Liu, and Y. Huang, "Domain attention model for multi-domain sentiment classification," Knowledge-Based Systems, vol. 155, pp. 1–10, Sep. 2018.

Y. Wang, M. Huang, X. Zhu, and L. Zhao, "Attention-based LSTM for Aspect-level Sentiment Classification," in Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, Austin, TX, USA, 2016.

I. Masood, Y. Wang, A. Daud, N. R. Aljohani, and H. Dawood, "Towards Smart Healthcare: Patient Data Privacy and Security in Sensor‐Cloud Infrastructure," Wireless Communications and Mobile Computing, vol. 2018, no. 1, Jan. 2018.

P. Dumbach, L. Schwinn, T. Löhr, P. L. Do, and B. M. Eskofier, "Artificial intelligence trend analysis on healthcare podcasts using topic modeling and sentiment analysis: a data-driven approach," Evolutionary Intelligence, vol. 17, no. 4, pp. 2145–2166, Aug. 2024.

N. Ouerhani, A. Maalel, and H. Ben Ghézala, "SMAD: SMart assistant during and after a medical emergency case based on deep learning sentiment analysis: The pandemic COVID-19 case," Cluster Computing, vol. 25, no. 5, pp. 3671–3681, Oct. 2022.

H. Grissette and E. H. Nfaoui, "Deep associative learning approach for bio-medical sentiment analysis utilizing unsupervised representation from large-scale patients’ narratives," Personal and Ubiquitous Computing, vol. 27, no. 6, pp. 2055–2069, Dec. 2023.

M. C. Martinis, C. Zucco, and M. Cannataro, "An Italian lexicon-based sentiment analysis approach for medical applications," in Proceedings of the 13th ACM International Conference on Bioinformatics, Computational Biology and Health Informatics, Northbrook, IL, USA, Aug. 2022, pp. 1–4.

K. Denecke and Y. Deng, "Sentiment analysis in medical settings: New opportunities and challenges," Artificial Intelligence in Medicine, vol. 64, no. 1, pp. 17–27, May 2015.

D. C. Edara, L. P. Vanukuri, V. Sistla, and V. K. K. Kolli, "Sentiment analysis and text categorization of cancer medical records with LSTM," Journal of Ambient Intelligence and Humanized Computing, vol. 14, no. 5, pp. 5309–5325, May 2023.

Y. Zhao, L. Zhang, C. Zeng, W. Lu, Y. Chen, and T. Fan, "Construction of an aspect-level sentiment analysis model for online medical reviews," Information Processing & Management, vol. 60, no. 6, Nov. 2023, Art. no. 103513.

P. Kaur, A. K. Malhi, and H. S. Pannu, "Sentiment analysis of linguistic cues to assist medical image classification," Multimedia Tools and Applications, vol. 83, no. 10, pp. 30847–30866, Sep. 2023.

S. M. Jiménez-Zafra, M. T. Martín-Valdivia, M. D. Molina-González, and L. A. Ureña-López, "How do we talk about doctors and drugs? Sentiment analysis in forums expressing opinions for medical domain," Artificial Intelligence in Medicine, vol. 93, pp. 50–57, Jan. 2019.

S. Sarkar, "Sentiment Analysis for Mental Health." Kaggle, [Online]. Available: https://www.kaggle.com/datasets/suchintikasarkar/sentiment-analysis-for-mental-health.

Downloads

How to Cite

[1]
A. Rehman, M. Ahmed, H. U. Khan, A. Bukhari, A. Daud, and H. Dawood, “Mental Health Sentiment Analysis: Exploring an Optimized BERT with Deep Encodings”, Eng. Technol. Appl. Sci. Res., vol. 15, no. 5, pp. 26242–26248, Oct. 2025.

Metrics

Abstract Views: 93
PDF Downloads: 59

Metrics Information