Using Sentiment Analysis with BERT and SVM for Detect Mental Health Detection on Social Media

Main Article Content

hartono wijaya
M.Fawazi Hadi
Neny Sulistianingsih

Abstract

Mental health is an important aspect of an individual's life that can affect overall quality of life. In the current digital era, social media has become the main platform for individuals to express their thoughts and feelings. The increasing use of social media opens up opportunities for individuals to share personal experiences, but it also creates negative influences on oneself that can affect the mental health of other users. The symptoms experienced by sufferers include fatigue, headaches, and decreased productivity. but if not handled quickly and properly, it can lead to something dangerous for themselves, such as self-harm or suicide. Based on these issues, a system is needed that can quickly determine the diagnosis experienced by the patient. This study aims to develop a sentiment analysis-based system for early detection of mental health indicators using Bidirectional Encoder Representations from Transformers (BERT) and Support Vector Machine (SVM). The dataset, obtained from Kaggle, consists of 62,301 social media posts categorized into anxiety, depression, stress, and normal classes. Preprocessing techniques such as text cleaning, tokenization, and feature extraction with BERT were applied before classification using SVM. Experimental results indicate that the BERT+SVM model achieved an accuracy of 93.49%, outperforming traditional machine learning approaches. Notably, challenges remain in distinguishing normal and anxiety-related content due to semantic overlap. The findings highlight the potential of sentiment analysis in enhancing mental health screening tools. Future research should explore hybrid deep learning architectures and multilingual datasets to improve classification robustness and applicability across different populations. 

Article Details

Section

Articles

References

Abdullah, M., & Negied, N. (2024). Detection and prediction of Future Mental disorder from Social Media Data using Machine Learning, Ensemble Learning, and Large Language Models. IEEE Access, 12(September), 120553–120569. https://doi.org/10.1109/ACCESS.2024.3406469

Abdurrahim, A., & Fudholi, D. H. F. (2024). Mental Health Prediction Model on Social Media Data Using CNN-BiLSTM. Kinetik: Game Technology, Information System, Computer Network, Computing, Electronics, and Control, 4(1). https://doi.org/10.22219/kinetik.v9i1.1849

Azhari, M. A. (2021). Dukungan Sosial bagi Penderita Disfungsional untuk Penguatan Kesehatan Mental: Studi Syarah Hadis dengan Pendekatan Psikologi Islam. Jurnal Riset Agama, 1(2), 308–322. https://doi.org/10.15575/jra.v1i2.14569

Badan Penelitian dan Pengembangan Kesehatan Kemenkes RI. (2018). Hasil Utama Riset Kesehatan Dasar. Kementrian Kesehatan Republik Indonesia, 1–100.

Bello, A., Ng, S. C., & Leung, M. F. (2023). A BERT Framework to Sentiment Analysis of Tweets. Sensors, 23(1). https://doi.org/10.3390/s23010506

Bokolo, B. G., & Liu, Q. (2023). Deep Learning-Based Depression Detection from Social Media: Comparative Evaluation of ML and Transformer Techniques. Electronics (Switzerland), 12(21). https://doi.org/10.3390/electronics12214396

Cha, J., Kim, S., & Park, E. (2022). A lexicon-based approach to examine depression detection in social media: the case of Twitter and university community. Humanities and Social Sciences Communications, 9(1), 1–10. https://doi.org/10.1057/s41599-022-01313-2

Dan, M., Beli, N., Skripsi, N., Memenuhi, U., Persyaratan, S., & Derajat, M. (2024). Pengaruh Komunikasi Media Sosial Terhadap Ekuitas. 10(11), 23–28.

Darmawan, F., Joe, M., Kurniawan, Y. I., & Afuan, L. (2023). Analisis Sentimen Kemungkinan Depresi dan Kecemasan pada Twitter Menggunakan Support Vector Machine. Jurnal Eksplora Informatika, 13(1), 24–36. https://doi.org/10.30864/eksplora.v13i1.854

Fathe, A. S., & Wahyu, N. (2023). Etika Komunikasi dalam Media Sosial Cyberbullyng pada siswa SMP Atlet dance Sport. Jurnal TIKAR, 4(2), 105.

Garcia-Ceja, E., Riegler, M., Nordgreen, T., Jakobsen, P., Oedegaard, K. J., & Tørresen, J. (2018). Mental health monitoring with multimodal sensing and machine learning: A survey. Pervasive and Mobile Computing, 51, 1–26. https://doi.org/10.1016/j.pmcj.2018.09.003

Gupta, V., & Rattan, P. (2023). Improving Twitter Sentiment Analysis Efficiency with SVM-PSO Classification and EFWS Heuristic. Procedia Computer Science, 230, 698–715. https://doi.org/10.1016/j.procs.2023.12.125

Mann, S., Arora, J., Bhatia, M., Sharma, R., & Taragi, R. (2023). Twitter Sentiment Analysis Using Enhanced BERT. Lecture Notes in Electrical Engineering, 959, 263–271. https://doi.org/10.1007/978-981-19-6581-4_21

Mubarok, F. S. (2022). Pemanfaatan New Media Untuk Efektivitas Komunikasi Di Era Pandemi. Jurnal Ilmiah Komunikasi Makna, 10(1), 28. https://doi.org/10.30659/jikm.v10i1.20302

Nijhawan, T., Attigeri, G., & Ananthakrishna, T. (2022). Stress detection using natural language processing and machine learning over social interactions. Journal of Big Data, 9(1). https://doi.org/10.1186/s40537-022-00575-6

Nopi, N. P., Musthafa Haris Munandar, Feri Irawan, & Januardi Rosyidi Lubis. (2022). Sistem Pakar Mendiagnosa Gangguan Mental pada Diri Seseorang Mengunakan Metode Certainty Factor. Journal of Applied Computer Science and Technology, 3(1), 157–162. https://doi.org/10.52158/jacost.v3i1.307

Nugroho, K. S., Akbar, I., Suksmawati, A. N., & Istiadi. (2023). Deteksi Depresi dan Kecemasan Pengguna Twitter Menggunakan Bidirectional LSTM. Ciastech, 287–296. http://arxiv.org/abs/2301.04521

Ogunleye, B., Sharma, H., & Shobayo, O. (2024). Sentiment Informed Sentence BERT-Ensemble Algorithm for Depression Detection. Big Data and Cognitive Computing, 8(9), 112. https://doi.org/10.3390/bdcc8090112

Prakoso, D. A. A., Hermawan, D., & Efendi, A. M. (2023). Analysis of the Effects Using BERT Feature Extraction Method on Case of Sentiment Classification on Twitter Social Media. 2023 1st IEEE International Conference on Smart Technology: Advances in Smart Technology for Sustainable Well-Being, ICE-SMARTec 2023, 54–59. https://doi.org/10.1109/ICE-SMARTECH59237.2023.10461978

Primadhani Tirtopangarsa, A., & Maharani, W. (2021). Sentiment Analysis of Depression Detection on Twitter Social Media Users Using the K-Nearest Neighbor Method Analisis Sentimen Deteksi Depresi pada Pengguna Media Sosial Twitter dengan Menggunakan Metode K-Nearest Neighbor. Semnasif, 1(1), 247–258.

Sankar, P., Palanichamy, N., & Ng, K. (2024). Sentiment Analysis on Twitter Data for Depression Detection. Journal of Logistics, Informatics and Service Science, 11(3), 21–36. https://doi.org/10.33168/jliss.2024.0302

Tiwari, P. K., Sharma, M., Garg, P., Jain, T., Verma, V. K., & Hussain, A. (2021). A Study on Sentiment Analysis of Mental Illness Using Machine Learning Techniques. IOP Conference Series: Materials Science and Engineering, 1099(1), 012043. https://doi.org/10.1088/1757-899x/1099/1/012043

WHO. (2019). Depressive Disorder (Depression). International Immunopharmacology, 67(August 2018). Retrieved from https://www.who.int/news-room/fact-sheets/detail/depression