Detecting Stress in Social Media Posts: A Comparative Study of Machine Learning Algorithms and GPT-Based Classification
Detecting Stress in Social Media Posts: A Comparative Study of Machine Learning Algorithms and GPT-Based Classification is an open-access, peer-reviewed research paper by Santosh Bhandari, published in Volume 15, Issue 10 of the International Journal of Advanced Research in Science and Technology (IJARST), a UGC-approved journal (Print ISSN 2319-1783, Online ISSN 2320-1126).
Author
Santosh Bhandari
Abstract
Social media platforms have become a rich source of information about users’ mental well-being, including stress. This study compares a fine-tuned GPT-2 classifier with four traditional machine learning (ML) algorithms—Naïve Bayes, Decision Tree, Logistic Regression and Random Forest—for detecting stress in tweets. The experiments used the mental-health-stress Twitter dataset from Kaggle, which contains 20,001 labeled posts. After pre-processing, the posts were classified as stressed or not stressed, and all models were evaluated using accuracy, precision, recall and F1-score. The GPT-2 classifier achieved the highest accuracy (88.7%) and an F1-score of 0.89, compared with 70–78% accuracy for the traditional algorithms. These results indicate that transformer-based language models capture the contextual cues of stress in short, informal text more effectively than frequency-based classifiers. Such models could support scalable, non-invasive screening tools for mental-health monitoring, although the study is limited by its single dataset, undocumented labelling procedure and single train–test split.
Keywords: Stress Detection, GPT-2, Sentiment Analysis, Machine Learning, Natural Language Processing, Twitter, Social Media
Nijhawan, T., Attigeri, G. and Ananthakrishna, T., 2022. Stress detection using natural language processing and machine learning over social interactions. Journal of Big Data, 9, Article 33. https://doi.org/10.1186/s40537-022-00575-6
Vidal, C. et al., 2024. Chronic stress and lack of social support: Role in adolescent depression and suicide-related behaviors in the context of the COVID-19 pandemic. Journal of Affective Disorders, 365, pp.437-442.
World Health Organization, 2021. Suicide worldwide in 2019: Global Health Estimates. Geneva: World Health Organization.
Gedam, S. and Paul, S., 2021. A review on mental stress detection using wearable sensors and machine learning techniques. IEEE Access, 9, pp.84045-84066. https://doi.org/10.1109/ACCESS.2021.3085502
Can, Y.S., Arnrich, B. and Ersoy, C., 2019. Stress detection in daily life scenarios using smart phones and wearable sensors: A survey. Journal of Biomedical Informatics, 92, Article 103139. https://doi.org/10.1016/j.jbi.2019.103139
Radford, A., Wu, J., Child, R., Luan, D., Amodei, D. and Sutskever, I., 2019. Language models are unsupervised multitask learners. OpenAI Blog, 1(8), p.9.
Li, R. and Liu, Z., 2020. Stress detection using deep neural networks. BMC Medical Informatics and Decision Making, 20(Suppl 11), Article 285. https://doi.org/10.1186/s12911-020-01299-4
Garg, P., Santhosh, J., Dengel, A. and Ishimaru, S., 2021. Stress detection by machine learning and wearable sensors. In: 26th International Conference on Intelligent User Interfaces – Companion (IUI ’21 Companion). New York: ACM.
Inamdar, S., Chapekar, R., Gite, S. and Pradhan, B., 2023. Machine learning driven mental stress detection on Reddit posts using natural language processing. Human-Centric Intelligent Systems, 3(2), pp.80-91. https://doi.org/10.1007/s44230-023-00020-8
Ilias, L., Mouzakitis, S. and Askounis, D., 2023. Calibration of transformer-based models for identifying stress and depression in social media. IEEE Transactions on Computational Social Systems. https://doi.org/10.1109/TCSS.2023.3283009
Ramteke, P. et al., 2023. Comparing conventional machine learning and large-language models for human stress detection using social media posts. In: 2023 2nd International Conference on Futuristic Technologies (INCOFT). IEEE.
Rajput, G. et al., 2025. Contextual stress detection in social media using transformer-based language models. In: 2025 2nd International Conference on Advanced Computing and Emerging Technologies (ACET). IEEE.
DOI
10.62226/ijarst20262836
PAGES : 61-64 | 5 VIEWS | 1 DOWNLOADS
How do you cite this paper?
Santosh Bhandari — “Detecting Stress in Social Media Posts: A Comparative Study of Machine Learning Algorithms and GPT-Based Classification.” International Journal of Advanced Research in Science and Technology (IJARST), Volume 15, Issue 10. DOI: 10.62226/ijarst20262836.
Santosh Bhandari | Detecting Stress in Social Media Posts: A Comparative Study of Machine Learning Algorithms and GPT-Based Classification | DOI : 10.62226/ijarst20262836
Journal Frequency:
ISSN 2320-1126, Monthly
Paper Submission:
Throughout the month
Acceptance Notification:
Within 6 days
Subject Areas:
Engineering, Science & Technology
Publishing Model:
Open Access
Publication Fee:
USD 60 USD 50
Publication Impact Factor:
6.76
Certificate Delivery:
Digital
Publish your research with IJARST and engage with global scientific minds