Generative Artificial Intelligence Chatbot to Diagnose the Severity of Anxiety in Unsch Students Using the Hamilton Anxiety Scale (HAM- A), 2025

Abstract

Anxiety is a prevalent mental health problem among university students, creating the need for scalable and reliable tools for screening, severity classification, and decision support. This pilot study aimed to design, develop, and preliminarily evaluate a generative artificial intelligence chatbot for screening anxiety severity among Engineering students at the Universidad Nacional de San Cristóbal de Huamanga, Peru, during the 2025-II academic semester, using the Hamilton Anxiety Rating Scale (HAM-A). A pilot sample of 50 students was selected through cluster sampling. The chatbot, developed with Flutter and Dart and integrated with a generative language model API, automated HAM-A administration, score calculation, severity classification, result storage, and personalized feedback generation. The system was preliminarily validated by comparing chatbot-generated severity classifications with those assigned by a clinical mental health expert. Agreement was assessed using Cohen’s Kappa coefficient and a confusion matrix, while classification performance was analyzed using class-specific and multiclass metrics. The results showed 46 exact matches out of 50 cases, with an observed agreement of 92.0% and Cohen’s Kappa of κ = 0.8086, indicating almost perfect concordance in this pilot sample. Overall accuracy was 0.9200, with a Weighted F1-score of 0.9032, Macro F1-score of 0.7560, and Balanced Accuracy of 0.7197. The chatbot showed strong performance in moderate anxiety classification and robust identification of severe anxiety cases, with no false negatives in the severe category. However, the mild category showed lower recall, indicating a tendency to classify some mild cases into higher severity levels. These findings suggest that the chatbot has preliminary potential as a first-level screening and decision- support tool for university mental health programs. Nevertheless, due to the pilot nature of the study and the limited sample size, the results should be interpreted cautiously and validated in larger, more diverse, and preferably multicenter samples. The chatbot should be considered a complementary support system, not a substitute for formal clinical diagnosis or professional psychological evaluation.

References

[1] Li W, Zhao Z, Chen D, Peng Y, Lu Z. Prevalence and associated factors of depression and anxiety symptoms among college students: a systematic review and meta-analysis. Journal of Child Psychology and Psychiatry and Allied Disciplines. 2022;63:1222-1230. doi:10.1111/jcpp.13606.

[2] Ahmed I, Hazell CM, Edwards B, Glazebrook C, Davies EB. A systematic review and meta-analysis of studies exploring prevalence of non-specific anxiety in undergraduate university students. BMC Psychiatry. 2023;23:240. doi:10.1186/s12888-023-04645-8.

[3] Tan GXD, Soh XC, Hartanto A, Goh AYH, Majeed NM. Prevalence of anxiety in college and university students: an umbrella review. Journal of Affective Disorders Reports. 2023;14:100658. doi:10.1016/j.jadr.2023.100658.

[4] Riboldi I, et al. Digital mental health interventions for anxiety and depressive symptoms in university students during the COVID-19 pandemic: a systematic review of randomized controlled trials. Revista de Psiquiatría y Salud Mental. 2023;16:47-58.

[5] Palmer CE, et al. Combining artificial intelligence and human support in mental health: digital intervention with comparable effectiveness to human-delivered care. Journal of Medical Internet Research. 2025;27:e69351. doi:10.2196/69351.

[6] Hua Y, et al. Charting the evolution of artificial intelligence mental health chatbots from rule-based systems to large language models: a systematic review. World Psychiatry. 2025;24:383-394. doi:10.1002/wps.21352.

[7] Maier W, Buller R, Philipp M, Heuser I. The Hamilton Anxiety Scale: reliability, validity and sensitivity to change in anxiety and depressive disorders. Journal of Affective Disorders. 1988;14:61-68. doi:10.1016/0165-0327(88)90072-9.

[8] Manole A, Cârciumaru R, Brînzaș R, Manole F. Harnessing AI in anxiety management: a chatbot-based intervention for personalized mental health support. Information. 2024;15:768. doi:10.3390/info15120768.

[9] Zhang Q, Zhang R, Xiong Y, Sui Y, Tong C, Lin FH. Generative AI mental health chatbots as therapeutic tools: systematic review and meta-analysis of their role in reducing mental health issues. Journal of Medical Internet Research. 2025;27:e78238. doi:10.2196/78238.

[10] Mayor E. Chatbots and mental health: a scoping review of reviews. Current Psychology. 2025;44:13619-13640. doi:10.1007/s12144-025-08094-2.

[11] Heinz MV, et al. Randomized trial of a generative AI chatbot for mental health treatment. NEJM AI. 2025;2(4). doi:10.1056/AIoa2400802.

[12] Chen C, et al. Comparison of an AI chatbot with a nurse hotline in reducing anxiety and depression levels in the general population: pilot randomized controlled trial. JMIR Human Factors. 2025;12:e65785. doi:10.2196/65785.

[13] Reyes-Portillo JA, et al. Generative AI-powered mental wellness chatbot for college student mental wellness: open trial. JMIR Formative Research. 2025;9:e71923. doi:10.2196/71923.

[14] Head KR. Minds in crisis: how the AI revolution is impacting mental health. Journal of Mental Health and Clinical Psychology. 2025;9:34-44.

[15] Saraç H, Yüzakı E, Aşçı FH. The potential of AI chatbots as diagnostic tools in mental health: assessment of exercise dependence symptoms. Journal of Technology in Behavioral Science. 2025. doi:10.1007/s41347-025-00567-2.

[16] Wang Y, Wang Y, Crace K, Zhang Y. Understanding attitudes and trust of generative AI chatbots for social anxiety support. In: Proceedings of the CHI Conference on Human Factors in Computing Systems (CHI '25). New York, NY: Association for Computing Machinery; 2025. doi:10.1145/3706598.3714286.

[17] Casu M, Triscari S, Battiato S, Guarnera L, Caponnetto P. AI chatbots for mental health: a scoping review of effectiveness, feasibility, and applications. Applied Sciences. 2024;14:5889. doi:10.3390/app14135889.

[18] Linardon J, Cuijpers P, Carlbring P, Messer M, Fuller-Tyszkiewicz M. The efficacy of app-supported smartphone interventions for mental health problems: a meta-analysis of randomized controlled trials. World Psychiatry. 2019;18:325-336. doi:10.1002/wps.20673.

[19] Inkster B, Sarda S, Subramanian V. An empathy-driven, conversational artificial intelligence agent (Wysa) for digital mental well-being: real-world data evaluation mixed-methods study. JMIR mHealth and uHealth. 2018;6:e12106. doi:10.2196/12106.

[20] Rong G, Mendez A, Bou Assi E, Zhao B, Sawan M. Artificial intelligence in healthcare: review and prediction case studies. Engineering. 2020;6:291-301. doi:10.1016/j.eng.2019.08.015.

[21] Topol EJ. High-performance medicine: the convergence of human and artificial intelligence. Nature Medicine. 2019;25:44-56. doi:10.1038/s41591-018-0300-7.

[22] Torous J, et al. The growing field of digital psychiatry: current evidence and the future of apps, social media, chatbots, and virtual reality. World Psychiatry. 2021;20:318-335. doi:10.1002/wps.20883.

[23] Fulmer R, Joerin A, Gentile B, Lakerink L, Rauws M. Using psychological artificial intelligence (Tess) to relieve symptoms of depression and anxiety: randomized controlled trial. JMIR Mental Health. 2018;5:e64. doi:10.2196/mental.9782.

[24] Fitzpatrick KK, Darcy A, Vierhile M. Delivering cognitive behavior therapy to young adults with symptoms of depression and anxiety using a fully automated conversational agent (Woebot): a randomized controlled trial. JMIR Mental Health. 2017;4:e19. doi:10.2196/mental.7785.

[25] Warrens MJ, de Raadt A, Bosker RJ, Kiers HAL. Weighted Kappa for interobserver agreement and missing data. Machine Learning and Knowledge Extraction. 2025;7:18. doi:10.3390/make7010018.

[26] Hamilton M. The assessment of anxiety states by rating. British Journal of Medical Psychology. 1959;32:50-55.

[27] Kessler RC, et al. Short screening scales to monitor population prevalences and trends in non-specific psychological distress. Psychological Medicine. 2002;32:959-976. doi:10.1017/S0033291702006074.

[28] Miner AS, Milstein A, Hancock JT. Talking to machines about personal mental health problems. JAMA. 2017;318:1217-1218. doi:10.1001/jama.2017.14151.

Authors

  • Hubner Janampa Patilla UNSCH
  • Efraín Porras Flores National University of San Cristóbal de Huamanga UII-FIMGC, Peru
  • Edem Terraza Huamán National University of San Cristóbal de Huamanga, School of Systems Engineering, Peru
  • Christian Lezama Cuellar National University of San Cristóbal de Huamanga, School of Systems Engineering, Peru
  • Lissette Elvira Fernández Jerí National University of San Cristóbal de Huamanga, School of Systems Engineering, Peru
  • Richard Zapata Casaverde National University of San Cristóbal de Huamanga, School of Systems Engineering, Peru
  • Yudith Meneses Conislla National University of San Cristóbal de Huamanga, School of Systems Engineering, Peru

DOI:

https://doi.org/10.31449/inf.v50i15.15218

Keywords:

Artificial Intelligence, Chatbot; Anxiety, HAM-A, Cohen’s Kappa, Confusion Matrix

Downloads

Published

09/09/2026

How to Cite

Janampa Patilla, H., Porras Flores, E., Terraza Huamán, E., Lezama Cuellar, C., Fernández Jerí, L. E., Zapata Casaverde, R., & Meneses Conislla, Y. (2026). Generative Artificial Intelligence Chatbot to Diagnose the Severity of Anxiety in Unsch Students Using the Hamilton Anxiety Scale (HAM- A), 2025. Informatica, 50(15). https://doi.org/10.31449/inf.v50i15.15218