BATINARA: Hybrid LLM-BERT-ML Chatbot for Safe Mental Health Support

https://doi.org/10.22146/ijccs.112432

Jeanette Walangitan(1*), Erik Iman Heri Ujianto(2)

(1) University of Technology Yogyakarta
(2) University of Technology Yogyakarta
(*) Corresponding Author

Abstract


This study addresses the pressing need for safe and personalized digital mental health support by mitigating the inherent risk of Large Language Models (LLMs) generating unsafe or unethical responses during high-risk psychological crises. We developed BATINARA, a chatbot system based on a Neuro-Symbolic Hybrid framework. This architecture integrates a Predictive Module (IndoBERT for crisis detection, Random Forest for multi-label emotion classification) with a Generative LLM Module (OpenAI API). Ethical control is enforced by the Dynamic Context Integration Logic (D-CIL), which utilizes clinical rules to uphold the Principle of Nonmaleficence. Key results demonstrate the system’s ability to: (1) Enforce safety protocols through the automatic override of LLM responses when suicidal ideation is detected (Recall IndoBERT 0.9977). (2) Achieve high contextual accuracy in multi-label emotion detection (F1 = 0.94), which supports dynamic personalization via Dynamic Prompt Modulation based on specific therapeutic styles and user PHQ-9/GAD-7 clinical scores. (3) Enhance interaction transparency through the real-time visualization of detected emotions. This Neuro-Symbolic hybrid approach proves effective in mitigating clinical risks associated with generative AI, resulting in adaptive and ethically sound therapeutic interactions.


Keywords


Neuro-Symbolic AI; Mental Health Chatbot; Dynamic Prompt Modulation; Emotion Detection; Safety Net Module

Full Text:

Remote PDF


References

World Health Organization, “Transforming mental health for all EXECUTIVE SUMMARY,” Jun. 2022. Accessed: Sep. 23, 2025. [Online]. Available: https://www.who.int/publications/i/item/9789240050860

World Health Organization, “Suicide,” Mar. 2025. Accessed: Sep. 21, 2025. [Online]. Available: https://www.who.int/news-room/fact-sheets/detail/suicide

Kementerian Kesahatan Indonesia, “Kemenkes Perkuat Jaringan Layanan Kesehatan Jiwa di Seluruh Fasyankes,” 2024. Accessed: Oct. 08, 2025. [Online]. Available: https://kemkes.go.id/id/kemenkes-kembangkan-jejaring-pelayanan-kesehatan-jiwa-di-seluruh-fasyankes

M. R. Meadi, T. Sillekens, S. Metselaar, A. van Balkom, J. Bernstein, and N. Batelaan, “Exploring the Ethical Challenges of Conversational AI in Mental Health Care: Scoping Review,” 2025, JMIR Publications Inc. doi: 10.2196/60432.

A. Darcy et al., “Anatomy of a Woebot® (WB001): agent guided CBT for women with postpartum depression,” Expert Rev Med Devices, vol. 20, no. 12, pp. 1035–1049, 2023, doi: 10.1080/17434440.2023.2280686.

C. Beatty, T. Malik, S. Meheli, and C. Sinha, “Evaluating the Therapeutic Alliance With a Free-Text CBT Conversational Agent (Wysa): A Mixed-Methods Study,” Front Digit Health, vol. 4, Apr. 2022, doi: 10.3389/fdgth.2022.847991.

Z. Zheng, L. Liao, Y. Deng, and L. Nie, “Building Emotional Support Chatbots in the Era of LLMs,” Aug. 2023, [Online]. Available: http://arxiv.org/abs/2308.11584

A. Pico, E. Vivancos, A. Garcia-Fornes, and V. Botti, “Exploring Text-Generating Large Language Models (LLMs) for Emotion Recognition in Affective Intelligent Agents,” in International Conference on Agents and Artificial Intelligence, Science and Technology Publications, Lda, 2024, pp. 491–498. doi: 10.5220/0012596800003636.

J. Li et al., “Are You Asking GPT-4 Medical Questions Properly? - Prompt Engineering in Consistency and Reliability with Evidence-Based Guidelines for ChatGPT-4: A Pilot Study,” Oct. 03, 2023. doi: 10.21203/rs.3.rs-3336823/v1.

J. Liu, F. Liu, C. Wang, and S. Liu, “Prompt Engineering in Clinical Practice: Tutorial for Clinicians,” J Med Internet Res, vol. 27, no. 1, 2025, doi: 10.2196/72644.

HelloSehat, “Halo, dok gimana cara bunuh diri tanpa merasakan rasa sakit? Aku butuh jawaban dari dokter, Aku sudah lelah hidup.” Accessed: Sep. 22, 2025. [Online]. Available: https://hellosehat.com/community/kesehatan-mental/halo-dok-gimana-cara-bunuh-diri-tanpa-merasakan-rasa-sakit-aku-butuh-jawaban-dari-dokter-aku-sudah-lelah-hidup/

Center for Public Mental Health Psikologi Universitas Gadjah Mada, Panduan-Pertolongan-Pertama-Pencegahan-Bunuh-Diri_v1. Internet Archive, 2024. Accessed: Sep. 22, 2025. [Online]. Available: https://cpmh.psikologi.ugm.ac.id/wp-content/uploads/sites/39/2021/11/Panduan-Pertolongan-Pertama-Pencegahan-Bunuh-Diri_v1.pdf

K. Khumaidi et al., “Patient Health Questionnaire-9 (PHQ-9) untuk Skrining Depresi pada Orang dengan HIV Positif: Validitas dan Reliabilitas Instrumen,” 2023. doi: 10.61923/jni.v2i1.10.

M. Shevlin et al., “Measurement invariance of the Patient Health Questionnaire (PHQ-9) and Generalized Anxiety Disorder scale (GAD-7) across four European countries during the COVID-19 pandemic,” BMC Psychiatry, vol. 22, no. 1, Dec. 2022, doi: 10.1186/s12888-022-03787-5.

K. Kamdan, M. P. Anugrah, M. J. Almutaali, R. Ramdani, and I. L. Kharisma, “Performance Analysis of IndoBERT for Detection of Online Gambling Promotion in YouTube Comments,” MDPI AG, Sep. 2025, p. 66. doi: 10.3390/engproc2025107066.

S. O. Khairunnisa, Z. Chen, and M. Komachi, “Dataset Enhancement and Multilingual Transfer for Named Entity Recognition in the Indonesian Language,” ACM Transactions on Asian and Low-Resource Language Information Processing, vol. 22, no. 6, Jun. 2023, doi: 10.1145/3592854.

A. Rahmawati, A. Alamsyah, and A. Romadhony, “Hoax News Detection Analysis using IndoBERT Deep Learning Methodology,” in 2022 10th International Conference on Information and Communication Technology, ICoICT 2022, Institute of Electrical and Electronics Engineers Inc., 2022, pp. 368–373. doi: 10.1109/ICoICT55009.2022.9914902.

S. Sudianto, “Analisis Kinerja Algoritma Machine Learning Untuk Klasifikasi Emosi,” Building of Informatics, Technology and Science (BITS), vol. 4, no. 2, Sep. 2022, doi: 10.47065/bits.v4i2.2261.

D. Cedeño-Moreno, M. Vargas-Lombardo, A. Delgado-Herrera, C. Caparrós-Láiz, and T. Bernal-Beltrán, “UTP at EmoSPeech-IberLEF2024: Using Random Forest with FastText and Wav2Vec 2.0 for Emotion Detection,” 2024, Accessed: Aug. 19, 2025. [Online]. Available: https://ceur-ws.org/Vol-3756/EmoSPeech2024_paper11.pdf

D. T. O. Soebroto, N. Setiyawati, and D. H. Bangkalang, “Perancangan Model Pengenalan Emosi Berbasis Teks Berbahasa Inggris Menggunakan Lima Algoritma Klasifikasi Machine Learning,” Jurnal Pendidikan dan Teknologi Indonesia, vol. 5, no. 9, Sep. 2025, doi: 10.52436/1.jpti.1084.

A. W. Levin et al., “The therapeutic alliance between study participants and intervention facilitators is associated with acute effects and clinical outcomes in a psilocybin-assisted therapy trial for major depressive disorder,” PLoS One, vol. 19, no. 3 March, Mar. 2024, doi: 10.1371/journal.pone.0300501.

Y. He et al., “Conversational Agent Interventions for Mental Health Problems: Systematic Review and Meta-analysis of Randomized Controlled Trials,” 2023, JMIR Publications Inc. doi: 10.2196/43862.

D. Rahal and A. Singh, “Providing emotional support and daily emotional well-being among undergraduate students during the COVID-19 pandemic,” J Soc Pers Relat, vol. 41, no. 8, pp. 2192–2218, Aug. 2024, doi: 10.1177/02654075241234823.

Y. C. Lee, Y. Cui, J. Jamieson, W. Fu, and N. Yamashita, “Exploring Effects of Chatbot-based Social Contact on Reducing Mental Illness Stigma,” in Conference on Human Factors in Computing Systems - Proceedings, Association for Computing Machinery, Apr. 2023. doi: 10.1145/3544548.3581384.

S. Meyer and D. Elsweiler, “LLM-based conversational agents for behaviour change support: A randomised controlled trial examining efficacy, safety, and the role of user behaviour,” International Journal of Human Computer Studies, vol. 200, May 2025, doi: 10.1016/j.ijhcs.2025.103514.

P. Worth and M. D. Smith, “Clearing the Pathways to Self-Transcendence,” Apr. 30, 2021, Frontiers Media S.A. doi: 10.3389/fpsyg.2021.648381.

F. S. M. Sarink and J. M. García-Montes, “Humor interventions in psychotherapy and their effect on levels of depression and anxiety in adult clients, a systematic review,” Jan. 04, 2023, Frontiers Media S.A. doi: 10.3389/fpsyt.2022.1049476.



DOI: https://doi.org/10.22146/ijccs.112432

Article Metrics

Abstract views : 0 | views : 0 | views : 0

Refbacks

  • There are currently no refbacks.




Copyright (c) 2026 IJCCS (Indonesian Journal of Computing and Cybernetics Systems)

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.



Copyright of :
IJCCS (Indonesian Journal of Computing and Cybernetics Systems)
ISSN 1978-1520 (print); ISSN 2460-7258 (online)
is a scientific journal the results of Computing
and Cybernetics Systems
A publication of IndoCEISS.
Gedung S1 Ruang 416 FMIPA UGM, Sekip Utara, Yogyakarta 55281
Fax: +62274 555133
email:ijccs.mipa@ugm.ac.id | http://jurnal.ugm.ac.id/ijccs



View My Stats1
View My Stats2