Early Mental Health Detection and Emotional States in Teenagers Through Chatbot Systems Using Natural Language Processing (NLP) †
Abstract
1. Introduction
2. Literature Review
2.1. Concept of Early Mental Health Detection
2.2. Approaches to Early Detection
2.3. Challenges in Early Detection
3. Methodology
3.1. Research Design
3.2. Data Collection
3.3. NLP and Machine Learning Techniques
4. Result
4.1. Dataset Overview
4.1.1. Emotion Dataset Overview
4.1.2. Mental Health Dataset Overview
4.2. Model and NLP Techniques
4.2.1. Preprocessing Steps
4.2.2. LSTM Model Architecture
4.2.3. LSTM Sentiment Analysis Model
4.2.4. LSTM Mental Health Classification Model Performance
5. Discussion
6. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Mishra, U. Emotion Detection In Virtual Assistants and Chatbots. Int. Res. J. Mod. Eng. Technol. Sci. 2023, 5, 1107–1112. [Google Scholar] [CrossRef]
- Seoyunion. RedditMentalhealth Sample Dataset (CSV). Available online: https://github.com/seoyunion/RedditMentalhealth/blob/main/reddit_mentalhealth_sample.csv (accessed on 20 June 2025).
- Kanchitank. Text-Emotion-Analysis Dataset. Available online: https://github.com/kanchitank/Text-Emotion-Analysis/tree/master/dataset/data (accessed on 20 June 2025).
- World Health Organization (WHO). Mental Health of Adolescents. 10 October 2024. Available online: https://www.who.int/news-room/fact-sheets/detail/adolescent-mental-health (accessed on 20 June 2025).
- Gomez, A.; Roberts, L. Integrating AI Chatbots with Professional Mental Health Services. Healthc. AI Psychol. 2023, 14, 135–150. [Google Scholar]
- Infant, A.; Indirapriyadharshini, A.; Narmatha, P. Parents and Teenagers Mental Health Suggestions Chatbot Using Cosine Similarity. In E3S Web of Conferences; EDP Sciences: Les Ulis, France, 2024. [Google Scholar] [CrossRef]
- Rajput, A.; Nazlah Al Yamaniyyah, A.; Arabia, S. Natural Language Processing, Sentiment Analysis and Clinical Analytics. In Innovation in Health Informatics; Academic Press: Amsterdam, The Netherlands, 2020. [Google Scholar]
- Singh, A.; Singh, J. Synthesis of Affective Expressions and Artificial Intelligence to Discover Mental Distress in Online Community. Int. J. Ment. Health Addict. 2024, 22, 1921–1946. [Google Scholar] [CrossRef] [PubMed]
- Zygadło, A.; Kozłowski, M.; Janicki, A. Text-Based Emotion Recognition in English and Polish for Therapeutic Chatbot. Appl. Sci. 2021, 11, 10146. [Google Scholar] [CrossRef]
- Kevin, B.; Vikin, B.; Nair, M. Building a Chatbot for Healthcare Using NLP. TechRxiv Prepr. 2023; 1–8. [Google Scholar] [CrossRef]
- Luo, B.; Lau, R.Y.K.; Li, C.; Si, Y.W. A Critical Review of State-of-the-Art Chatbot Designs and Applications. Wiley Interdiscip. Rev. Data Min. Knowl. Discov. 2022, 12, e1434. [Google Scholar] [CrossRef]
- Belser, C.A. Comparison of Natural Language Processing Models for Depression Detection in Chatbot Dialogues. Ph.D. Thesis, Massachusetts Institute of Technology, Cambridge, MA, USA, 2023. [Google Scholar]
- Grové, C. Co-Developing a Mental Health and Well-Being Chatbot with and for Young People. Front. Psychiatry 2021, 11, 606041. [Google Scholar] [CrossRef] [PubMed]
- Kostenius, C.; Lindström, F.; Potts, C.; Pekkari, N. Young Peoples’ Reflections about Using a Chatbot to Promote Their Mental Well-Being in Northern Periphery Areas—A Qualitative Study. Int. J. Circumpolar Health 2024, 83, 2369349. [Google Scholar] [CrossRef] [PubMed]
- Miller, C. Enhancing Accessibility of Mental Health Support through AI. J. Digit. Health Innov. 2021, 17, 80–95. [Google Scholar]
- Telezhenko, D.; Tolstoluzka, O. Development and training of LSTM models for control of virtual distributed systems using TensorFlow and Keras. GoS 2024, 38, 163–168. [Google Scholar] [CrossRef]
- Abdelhalim, E.; Anazodo, K.S.; Gali, N.; Robson, K. A Framework of Diversity, Equity, and Inclusion Safeguards for Chatbots. Bus. Horiz. 2024, 67, 487–498. [Google Scholar] [CrossRef]
- Jain, E.; Rathour, A. Understanding Mental Health through Sentiment Analysis: Using Machine Learning to Analyze Social Media for Emotional Insights. In Proceedings of the 5th International Conference on Data Intelligence and Cognitive Informatics (ICDICI), Tirunelveli, India, 18–20 November 2024; IEEE: Piscataway, NJ, USA, 2024; pp. 782–786. [Google Scholar] [CrossRef]
- European Union. General Data Protection Regulation (GDPR). 2018. Available online: https://eur-lex.europa.eu/eli/reg/2016/679/oj (accessed on 20 June 2025).
- Bilquise, G.; Ibrahim, S.; Shaalan, K. Emotionally Intelligent Chatbots: A Systematic Literature Review. Hum. Behav. Emerg. Technol. 2022, 2022, 9601630. [Google Scholar] [CrossRef]
- Smith, J.; Brown, A. Challenges in NLP-Based Chatbots for Mental Health. J. AI Psychol. 2023, 15, 120–135. [Google Scholar]
- Zhang, J. An Overview of the Application of Sentiment Analysis in Mental Well-Being. Appl. Comput. Eng. 2023, 8, 354–359. [Google Scholar] [CrossRef]
- Lee, K.; Zhang, M. Bias in AI-Based Psychological Assessments. IEEE Trans. Comput. Intell. 2021, 30, 78–90. [Google Scholar]
- Machová, K.; Szabóová, M.; Paralič, J.; Mičko, J. Detection of Emotion by Text Analysis Using Machine Learning. Front. Psychol. 2023, 14, 1190326. [Google Scholar] [CrossRef] [PubMed]
- Casu, M.; Triscari, S.; Battiato, S.; Guarnera, L.; Caponnetto, P. AI Chatbots for Mental Health: A Scoping Review of Effectiveness, Feasibility, and Applications. Appl. Sci. 2024, 14, 5889. [Google Scholar] [CrossRef]
- Joshi, M.L.; Kanoongo, N. Depression Detection Using Emotional Artificial Intelligence and Machine Learning: A Closer Review. Mater. Today Proc. 2022, 58, 217–226. [Google Scholar] [CrossRef]
- Wang, M. Data Representation and Bias in Sentiment Analysis Models. AI Soc. 2022, 18, 112–125. [Google Scholar]
- Sahu, P. Emotional Intelligence in Chatbots: Revolutionizing Human-Machine Interaction. Available online: https://www.researchgate.net/publication/375526296 (accessed on 20 June 2025).
- AlMakinah, R.; Norcini-Pala, A.; Disney, L.; Canbaz, M.A. Enhancing Mental Health Support through Human-AI Collaboration: Toward Secure and Empathetic AI-Enabled Chatbots. arXiv 2024, arXiv:2410.02783. [Google Scholar]
- Ashlin Deepa, R.N.; Karlapati, P.; Mulagondla, M.R.; Amaranayani, P.; Toram, A.P. An Innovative Emotion Recognition and Solution Recommendation Chatbot. In Proceedings of the 8th International Conference on Advanced Computing and Communication Systems (ICACCS), Coimbatore, India, 25–26 March 2022; IEEE: Piscataway, NJ, USA, 2022; pp. 1100–1105. [Google Scholar] [CrossRef]
Column Name | Description |
---|---|
tweet_id | Unique identifier for the tweet. |
sentiment | The emotion class associated with the tweet. |
author | The username of the tweet’s author. |
content | The actual text of the tweet. |
Sentiment Label | Count |
---|---|
Neutral | 8638 |
Worry | 8459 |
Happiness | 5209 |
Sadness | 5165 |
Love | 3842 |
Surprise | 2187 |
Fun | 1776 |
Relief | 1526 |
Hate | 1323 |
Empty | 827 |
Enthusiasm | 759 |
Boredom | 179 |
Anger | 110 |
Sentiment | Sample Text |
---|---|
Happiness | “I just got promoted! Feeling so blessed!” |
Sadness | “I miss my best friend so much. Life feels empty.” |
Worry | “I don’t think I’m prepared for my exam tomorrow.” |
Mental Health Label | Count |
---|---|
Anxiety | 100 |
BPD | 100 |
Autism | 100 |
Bipolar | 100 |
Depression | 100 |
Mental Health General | 100 |
Schizophrenia | 100 |
Mental Health Category | Sample Text |
---|---|
Anxiety | “I constantly feel like something bad is going to happen.” |
Depression | “I don’t feel like getting out of bed anymore.” |
Bipolar | “Some days I feel unstoppable, others I can’t move.” |
Step | Description |
---|---|
Text Cleaning | Removing URLs, mentions, hashtags, punctuation, and numbers. |
Lowercasing | Converting all text to lowercase. |
Tokenization | Splitting sentences into words. |
Padding Sequences | Ensuring input sequences have a fixed length. |
Label Encoding | Converting text labels into numerical format. |
Epoch | Training Accuracy | Training Loss | Validation Accuracy | Validation Loss | Observation |
---|---|---|---|---|---|
1 | 20.79% | 2.1837 | 21.60% | 2.1476 | High loss, low accuracy → model is just starting to learn. |
2 | 21.17% | 2.1498 | 21.60% | 2.1454 | Slight improvement, but still weak generalization. |
3 | 21.08% | 2.1530 | 21.60% | 2.1469 | Accuracy stagnates, indicating slow learning. |
4 | 21.82% | 2.1500 | 21.60% | 2.1463 | Minor improvement, but still very low accuracy. |
5 | 22.14% | 2.1414 | 26.76% | 2.0353 | First major improvement in validation accuracy! |
6 | 27.76% | 2.0068 | 31.33% | 1.9710 | Loss starts dropping significantly. |
7 | 34.53% | 1.8861 | 31.84% | 1.9672 | Model is learning faster. |
8 | 38.57% | 1.8020 | 32.80% | 1.9956 | Training accuracy rises, but validation loss increases slightly (possible overfitting). |
9 | 42.03% | 1.7195 | 32.16% | 2.0459 | Overfitting becomes more noticeable. |
10 | 45.33% | 1.6116 | 31.60% | 2.1114 | Overfitting worsens—model performs well on training data but struggles with validation. |
Epoch | Training Accuracy | Training Loss | Validation Accuracy | Validation Loss | Observations |
---|---|---|---|---|---|
1 | 15.25% | 1.9460 | 16.43% | 1.9372 | Model is starting; very low accuracy and high loss. |
2 | 17.37% | 1.9289 | 17.14% | 1.9299 | Minimal improvement in accuracy; model still struggling. |
3 | 27.92% | 1.8104 | 18.57% | 1.9089 | Model is learning, but validation accuracy remains low. |
4 | 29.18% | 1.7613 | 21.43% | 2.0404 | Training accuracy improves, but validation loss increases, indicating overfitting. |
5 | 32.18% | 1.5674 | 18.57% | 2.0147 | Overfitting begins; model is learning training data but not generalizing well. |
6 | 43.83% | 1.3001 | 24.29% | 2.3427 | Large gap between training and validation accuracy. |
7 | 49.86% | 1.1460 | 18.57% | 2.4553 | Validation accuracy drops; severe overfitting evident. |
8 | 56.42% | 0.9795 | 25.00% | 2.6061 | Model memorizes training data, but validation performance is unstable. |
9 | 63.55% | 0.8486 | 22.14% | 2.6814 | Increasing validation loss confirms generalization issues. |
10 | 66.94% | 0.7217 | 22.86% | 2.8957 | Model continues to overfit; validation accuracy stagnates. |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Kamdan, K.; Fauziyah, N.G.; Fadlullah, M.A.; Hanif, D.A.; Kharisma, I.L. Early Mental Health Detection and Emotional States in Teenagers Through Chatbot Systems Using Natural Language Processing (NLP). Eng. Proc. 2025, 107, 64. https://doi.org/10.3390/engproc2025107064
Kamdan K, Fauziyah NG, Fadlullah MA, Hanif DA, Kharisma IL. Early Mental Health Detection and Emotional States in Teenagers Through Chatbot Systems Using Natural Language Processing (NLP). Engineering Proceedings. 2025; 107(1):64. https://doi.org/10.3390/engproc2025107064
Chicago/Turabian StyleKamdan, Kamdan, Najla Ghaida Fauziyah, Muhammad A. Fadlullah, Dilla A. Hanif, and Ivana Lucia Kharisma. 2025. "Early Mental Health Detection and Emotional States in Teenagers Through Chatbot Systems Using Natural Language Processing (NLP)" Engineering Proceedings 107, no. 1: 64. https://doi.org/10.3390/engproc2025107064
APA StyleKamdan, K., Fauziyah, N. G., Fadlullah, M. A., Hanif, D. A., & Kharisma, I. L. (2025). Early Mental Health Detection and Emotional States in Teenagers Through Chatbot Systems Using Natural Language Processing (NLP). Engineering Proceedings, 107(1), 64. https://doi.org/10.3390/engproc2025107064