Klasifikasi Multi-Class Pada Kondisi Kesehatan Mental Berbasis Data Media Sosial Menggunakan Model BERT
Main Article Content
Abstract
Kesehatan mental merupakan kondisi kesejahteraan psikologis yang memungkinkan individu mengelola stres, bekerja secara produktif, dan berinteraksi secara sosial. Peningkatan penggunaan media sosial menghasilkan data teks yang dapat merepresentasikan kondisi emosional dan psikologis pengguna. Berbagai penelitian telah mengembangkan klasifikasi kondisi kesehatan mental berbasis data media sosial menggunakan pendekatan machine learning dan deep learning. Namun, sebagian besar penelitian masih berfokus pada klasifikasi biner atau deteksi satu kondisi mental tertentu, sedangkan pendekatan multi-class untuk membedakan beberapa kondisi kesehatan mental secara bersamaan masih terbatas. Selain itu, kemiripan pola linguistik antar kondisi mental serta penggunaan bahasa informal pada media sosial menjadi tantangan dalam meningkatkan performa klasifikasi teks tidak terstruktur. Oleh karena itu, penelitian ini mengusulkan model Bidirectional Encoder Representations from Transformers (BERT) untuk mengklasifikasikan kondisi kesehatan mental berbasis data media sosial. Model BERT dipilih karena mampu memahami konteks bahasa secara bidirectional melalui mekanisme self-attention sehingga lebih efektif menangkap representasi semantik dibandingkan metode konvensional. Dataset yang digunakan adalah Reddit Mental Health dengan lima kategori, yaitu Stress, Depression, Bipolar Disorder, Personality Disorder, dan Anxiety. Tahapan penelitian meliputi preprocessing teks, tokenisasi menggunakan BERT tokenizer, pembagian data secara stratified, penanganan imbalanced data menggunakan class weighting dan focal loss, serta fine-tuning model. Hasil eksperimen pada 5.957 data menunjukkan bahwa konfigurasi hyperparameter terbaik memperoleh accuracy sebesar 80%, dengan rata-rata precision, recall, dan F1-score masing-masing sebesar 80%. Kategori Stress memperoleh F1-score tertinggi sebesar 87%, sedangkan kategori Depression sebesar 73%. Hasil penelitian menunjukkan bahwa model BERT efektif dalam memahami pola linguistik dan konteks emosional pada data media sosial tidak terstruktur.
Article Details
Section

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.
References
M. M. Hossain, Sanjara, M. S. Hossain, S. Chaki, M. S. Rahman, and A. B. M. S. Ali, “Revolutionizing Mental Health Sentiment Analysis With BERT-Fuse: A Hybrid Deep Learning Model,” IEEE Access, vol. 13, no., pp. 85428–85446, 2025, doi: 10.1109/ACCESS.2025.3568340.
S. Zanwar, D. Wiechmann, Y. Qiao, and E. Kerz, “Exploring Hybrid and Ensemble Models for Multiclass Prediction of Mental Health Status on Social Media,” in Proceedings of the 13th International Workshop on Health Text Mining and Information Analysis (LOUHI), 2022, vol. 1, no., pp. 184–196, doi: 10.18653/v1/2022.louhi-1.21.
K. Zeberga, M. Attique, B. Shah, F. Ali, Y. Z. Jembre, and T.-S. Chung, “A Novel Text Mining Approach for Mental Health Prediction Using Bi-LSTM and BERT Model,” Comput. Intell. Neurosci., vol. 2022, no. 1, pp. 1–18, Mar. 2022, doi: 10.1155/2022/7893775.
M. Kerasiotis, L. Ilias, and D. Askounis, “Depression detection in social media posts using transformer-based models and auxiliary features,” Soc. Netw. Anal. Min., vol. 14, no. 1, p. 196, Sep. 2024, doi: 10.1007/s13278-024-01360-4.
S. Ramesh et al., “BERT based Transformers lead the way in Extraction of Health Information from Social Media,” in Proceedings of the Sixth Social Media Mining for Health (#SMM4H) Workshop and Shared Task, 2021, vol. 50, no. 1, pp. 33–38, doi: 10.18653/v1/2021.smm4h-1.5.
A. Pourkeyvan, R. Safa, and A. Sorourkhah, “Harnessing the Power of Hugging Face Transformers for Predicting Mental Health Disorders in Social Networks,” IEEE Access, vol. 12, pp. 28025–28035, 2024, doi: 10.1109/ACCESS.2024.3366653.
A. N. Sutranggono, Riyanarto Sarno, and Imam Ghozali, “Multi-Class Multi-Level Classification of Mental Health Disorders Based on Textual Data from Social Media,” J. Inf. Commun. Technol., vol. 23, no. 1, pp. 77–104, Jan. 2024, doi: 10.32890/jict2024.23.1.4.
M. Arif, I. Ameer, N. Bölücü, G. Sidorov, A. Gelbukh, and V. Elangovan, “Mental Illness Classification on Social Media Texts Using Deep Learning and Transfer Learning,” Comput. y Sist., vol. 28, no. 2, pp. 451–464, Jun. 2024, doi: 10.13053/CyS-28-2-4873.
U. Naseem, S. Thapa, Q. Zhang, J. Rashid, L. Hu, and M. Nasim, “Temporal Tides of Emotional Resonance: A Novel Approach to Identify Mental Health on Social Media,” in Proceedings of the 11th International Workshop on Natural Language Processing for Social Media, 2024, vol. 11, no. 1, pp. 1–8, doi: 10.18653/v1/2023.socialnlp-1.1.
K. Hasan, J. Saquer, and Y. Zhang, “Mental Multi-class Classification on Social Media: Benchmarking Transformer Architectures against LSTM Models,” in 2025 International Conference on Machine Learning and Applications (ICMLA), Dec. 2025, vol. 1, no., pp. 160–167, doi: 10.1109/ICMLA66185.2025.00027.
L. Ilias, S. Mouzakitis, and D. Askounis, “Calibration of Transformer-Based Models for Identifying Stress and Depression in Social Media,” IEEE Trans. Comput. Soc. Syst., vol. 11, no. 2, pp. 1979–1990, Apr. 2024, doi: 10.1109/TCSS.2023.3283009.
R. Kumar, K. Maharaj, A. Saxena, and P. Bhattacharyya, “Mental Disorder Classification via Temporal Representation of Text,” in Findings of the Association for Computational Linguistics: EMNLP 2024, 2024, vol. 1, no. 1, pp. 10901–10916, doi: 10.18653/v1/2024.findings-emnlp.639.
A. B. S. Rahman, H. T. Ta, L. Najjar, A. Azadmanesh, and A. S. Gönul, “DepressionEmo: A novel dataset for multilabel classification of depression emotions,” J. Affect. Disord., vol. 366, no. 1, pp. 445–458, Dec. 2024, doi: 10.1016/j.jad.2024.08.013.
S. Zanwar, Y. Qiao, D. Wiechmann, and E. Kerz, “SMHD-GER: A Large-Scale Benchmark Dataset for Automatic Mental Health Detection from Social Media in German,” in EACL 2023 - 17th Conference of the European Chapter of the Association for Computational Linguistics, Findings of EACL 2023, 2023, vol. 1, no., p. 1496, doi: 10.18653/v1/2023.findings-eacl.113.
M. Garg, “Multi-class categorization of reasons behind mental disturbance in long texts,” Knowledge-Based Syst., vol. 276, no., p. 110742, Sep. 2023, doi: 10.1016/j.knosys.2023.110742.
I. Sekulic and M. Strube, “Adapting Deep Learning Methods for Mental Health Prediction on Social Media,” in Proceedings of the 5th Workshop on Noisy User-generated Text (W-NUT 2019), 2019, vol. 5, no., pp. 322–327, doi: 10.18653/v1/D19-5542.
M. Syed and M. Narvekar, “A Decision Support System for Predicting Socially Depressed Users Using Bidirectional Encoders Representations from Transformers (BERT),” J. Univ. Shanghai Sci. Technol., vol. 23, no. 3, pp. 209–213, Mar. 2021, doi: 10.51201/jusst12674.
Z. Yang, R. Leonard, H. Tran, R. Driscoll, and C. Davis, “Detection of Suicidal Risk on Social Media: A Hybrid Model,” in Big Data and Cognitive Computing, vol. 8, no. 7, 2026, pp. 38–49.
N. Sutrisno, M. Elveny, A. H. Lubis, R. Syah, H. Hartono, and S. Krisdayanti, “Predicting Burnout in Start-Up Environments: A Multivariate Risk Scoring Approach for Early Managerial Intervention,” Int. J. Eng. Sci. Inf. Technol., vol. 5, no. 4, pp. 506–516, Oct. 2025, doi: 10.52088/ijesty.v5i4.1663.
A. Garlapati, D. R. Krishna, K. Garlapati, and G. Narayanan, “Predicting Employees under Stress for Pre-emptive Remediation using Machine learning Algorithm,” in 2020 International Conference on Recent Trends on Electronics, Information, Communication & Technology (RTEICT), Nov. 2020, vol. 199, no., pp. 315–319, doi: 10.1109/RTEICT49044.2020.9315726.
S. Tyagi, A. Tomar, and M. Mohit, “Prediction of Mental Burnout Using Machine Learning,” Int. J. Sci. Res. Eng. Manag., vol. 09, no. 11, pp. 1–9, Nov. 2025, doi: 10.55041/IJSREM53497.
Y. Guo, X. Dong, M. A. Al-Garadi, A. Sarker, C. Paris, and D. Mollá-Aliod, “Benchmarking of Transformer-Based Pre-Trained Models on Social Media Text Classification Datasets,” Proc. Australas. Lang. Technol. Work., vol. 18, no. 2019, 2020.
Y. Guo and A. Sarker, “SocBERT: A Pretrained Model for Social Media Text,” in The Fourth Workshop on Insights from Negative Results in NLP, 2023, pp. 45–52, doi: 10.18653/v1/2023.insights-1.5.
A. Fatwanto, F. Zamakhsyari, and R. Ndungi, “A Systematic Literature Review of BERT-based Models for Natural Language Processing Tasks,” J. INFOTEL, vol. 16, no. 4, pp. 713–728, Dec. 2024, doi: 10.20895/infotel.v16i4.1206.
O. S. Akintoye, H. M. Sanusi, R. A. Yusuf, and A. A. Odondi, “Early Detection of Adolescent Mental Health Risk Using Transformer Models on Social Media Datasets,” J. Front. Multidiscip. Res., vol. 4, no. 1, pp. 435–445, 2023, doi: 10.54660/.JFMR.2023.4.1.435-445.
R. Martínez-Castaño, A. Htait, L. Azzopardi, and Y. Moshfeghi, “BERT-Based Transformers for Early Detection of Mental Health Illnesses,” in Lecture Notes in Computer Science, vol. 12880 LNCS, no., 2021, pp. 189–200.
A. Raj, Z. Ali, S. Chaudhary, K. K. Bali, and A. Sharma, “Depression Detection Using BERT on Social Media Platforms,” in 2024 IEEE International Conference on Artificial Intelligence in Engineering and Technology (IICAIET), Aug. 2024, vol., no., pp. 228–233, doi: 10.1109/IICAIET62352.2024.10730329.
S. A. Adefemi, A. D. Ojo, A. A. Alabi, A. Tewogbade, and O. Ikotun, “Machine Learning-Based Mental Health Classification System: Design, Implementation, and Evaluation,” Int. J. Res. Innov. Appl. Sci., vol. 11, no. 3, pp. 356–370, 2026, doi: 10.51584/IJRIAS.2026.11030034.