Year: 2026
Type: article
Abstract: The Coronavirus Disease 2019 pandemic caused widespread psychological distress and changed the way people express that distress online. This study examined suicidal ideation among Kenyan users of the social media platform X, formerly Twitter, during and after the pandemic, and developed a deep learning model to detect such expressions in real time. A complete enumeration of publicly available posts that contained any of twenty distress-related keywords, originated from users located in Kenya, and were published between 1 January 2020 and 31 July 2021 returned 6,651 posts. After cleaning and polarity-based labelling, 6,265 posts were retained and split into 5,012 training and 1,253 test posts. Weekly post counts were tested for a monotonic trend using the Mann-Kendall test. A Long Short-Term Memory network was trained to classify the posts and compared with logistic regression, a naive Bayes classifier and a random forest, using accuracy, recall and AUC-ROC. Differences between classifiers were assessed using pairwise McNemar tests. Posting volume rose sharply between late February and April 2020, reaching a maximum of 165 posts in the week beginning 6 April 2020, and a second peak of 127 posts followed the renewed restrictions of March 2021. Across the whole period the Mann-Kendall test confirmed a significant declining trend (Z = −5.64, τ = −0.44, slope = −0.75 posts per week, p<0.001). On the held-out test set, LSTM achieved an accuracy of 92.1%, an F1-score of 94.4% and an area under the curve of 94.5%. It achieved the highest accuracy and F1-score of the four classifiers, compared to traditional models. The area under the curve was highest for the random forest at 96.4%, followed by logistic regression at 95.7%. The pairwise tests confirmed that every difference between models was significant (p<0.001). The model was deployed as a web application that screens several platforms at once and returns a single risk profile. The findings show that social media text carries measurable signals of population mental health, and that deep learning can support, though not replace, professional clinical judgement.
Institutions: Technical University of Mombasa, Rongo University
Language: English
Topic: Mental Health via Writing
Subfield: Social Psychology
Field: Psychology
Domain: Social Sciences
Open Access status: diamond
OpenAlex ID: W7204440566
