Detecting anxiety and depression from social media text by applying machine learning methods

2025

Closed access Metadata (CSL-JSON)
DOI 10.53364/24138614_2025_37_2_20
Data confidence 70 medium
How this score is calculated

It is built from checkable properties of the record itself: whether the article has a DOI, how many independent sources confirmed its data, whether the required fields are filled in, and how recent the latest confirmation is. Disagreement between sources and a missing identifier lower it. A value of 80 or above means the record was published without further checking; 60 to 79 means it is published at reduced confidence, with a manual check advisable. A record verified by an editor by hand is never pushed below 90 by a recalculation. This scores our data about the article, not the article itself.

Abstract

The detection of anxiety and depression through social media texts has emerged as a critical research focus, driven by the growing prevalence of mental health challenges and the widespread sharing of personal and emotional experiences on online platforms. The availability of large-scale, user-generated content provides an opportunity to develop automated systems for early detection and intervention. In this study, the effectiveness of three widely used machine learning models—Logistic Regression, Support Vector Machine (SVM), and Random Forest—is assessed using key evaluation metrics such as precision, recall, F1-score, and overall accuracy. Among the tested models, Random Forest demonstrates superior performance, consistently achieving a recall of 0.91 and an F1-score of 0.93 when identifying individuals likely experiencing anxiety and depression. These results suggest its robustness and reliability in real-world applications. SVM also performs well, with a strong balance between precision and recall, and reaches a high overall accuracy of 98%. On the other hand, Logistic Regression, although computationally efficient and simple to implement, shows limitations in detecting positive cases, with a relatively low recall of 0.59. The results of this comparative analysis highlight the potential of advanced machine learning algorithms in supporting mental health screening and emphasize the importance of model selection in building effective and scalable detection tools.