Keywords:-

Keywords: Mental Health, Transformer Models, BERT, Deep Learning, Natural Language Processing (NLP), Text Classification, Psychological Assessment, Machine Learning, Mental Health Detection, Digital Health.

Article Content:-

Abstract

Mental health disorders remain a major global concern, and many cases continue to go unreported because people hesitate to share their struggles or lack access to proper diagnosis. With advancements in natural language processing (NLP), text-based analysis has become a powerful way to detect signs of mental distress. In this research, a transformer-based model-specifically BERT was used to predict whether individuals are likely to seek mental health treatment based on their survey responses. The Mental Health Dataset includes demographic details, stress levels, coping patterns, and family history, all of which were merged into a single text format and processed using BERT’s tokenizer to capture deeper meaning. The model was trained in PyTorch using the AdamW optimizer with a linear learning rate schedule to support steady improvement. After four training epochs, the model achieved 95% accuracy, along with precision, recall, and F1-scores above 0.94. A confusion matrix further showed that the predicted and actual labels were closely aligned, reflecting strong reliability. Overall, the findings indicate that transformer models are highly effective at recognizing language patterns linked to mental health. This approach provides a scalable and data-driven way to identify potential risks early and can be integrated into digital health platforms to support timely help and better clinical decision-making.

References:-

References

Calvo, R. A., Milne, D. N., Hussain, M. S., & Christensen, H. (2017). Natural language processing in mental health applications using non-clinical texts. Natural Language Engineering, 23(5), 649–685. https://doi.org/10.1017/S1351324916000383

Chancellor, S., Birnbaum, M. L., Caine, E. D., Silenzio, V. M. B., & De Choudhury, M. (2019). A taxonomy of ethical tensions in inferring mental health states from social media. Proceedings of the 2019 Conference on Fairness, Accountability, and Transparency (FAT19)*, 79–88. https://doi.org/10.1145/3287560.3287587

Coppersmith, G., Dredze, M., Harman, C., Hollingshead, K., & Mitchell, M. (2016). CLPsych 2015 shared task: Depression and PTSD on Twitter. Proceedings of the 2nd Workshop on Computational Linguistics and Clinical

Psychology, 31–39.

Devlin, J., Chang, M.-W., Lee, K., & Toutanova, K. (2018). BERT: Pre-training of deep bidirectional transformers for language understanding [Preprint]. arXiv. https://arxiv.org/abs/1810.04805

Ghosh, S., Anwar, S., & Chakraborty, S. (2021). Mental health detection from social media using BERT-based models. Journal of Computational Social Science, 4(2), 469–489. https://doi.org/10.1007/s42001-021-00122-8

Lin, H., Jia, J., Guo, Q., Xue, Y., Li, Q., Huang, J., Cai, L., & Feng, L. (2020). Psychological stress detection from cross-media microblog data using deep learning. IEEE Transactions on Knowledge and Data Engineering, 32(10), 1985–1998. https://doi.org/10.1109/TKDE.2019.2911466

Matero, M., Idnani, A., Son, Y., Giorgi, S., Vu, H., Zamani, M., & Schwartz, H. A. (2019). Suicide risk assessment with multi-level dual-context language and BERT. Proceedings of the 6th Workshop on Computational Linguistics and Clinical Psychology, 39–44.

Orabi, A. H., Buddhitha, P., Orabi, M. H., & Inkpen, D. (2018). Deep learning for depression detection of Twitter users. Proceedings of the Fifth Workshop on Computational Linguistics and Clinical Psychology, 88–97.

Patel, V., Saxena, S., Lund, C., Thornicroft, G., Baingana, F., Bolton, P., & Unützer, J. (2018). The Lancet Commission on global mental health and sustainable development. The Lancet, 392(10157), 1553–1598. https://doi.org/10.1016/S0140-6736(18)31612-X

Resnik, P., Garron, A., & Resnik, R. (2015). Using topic modeling to improve prediction of neuroticism and depression from Twitter data. Proceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP), 1348–1353.

Downloads

Citation Tools

How to Cite
Patil, S., & Shinde, V. (2026). Decoding Minds through Machines: A Transformer-Driven Deep Learning Framework for Mental Health Text Classification. International Journal Of Mathematics And Computer Research, 14(03), 201-206. https://doi.org/10.47191/ijmcr/v14iSPC3.39