Skip to content
Open access

An Explainable Multi-Class Mental Health Classification Framework from Twitter Posts Using NLP and Machine Learning

Aug 2026 · International Journal of Innovative Science & Technology · 0 citations · 12 references

Abstract

Social media and digital platforms have changed the landscape of mental health discourses, making platforms such as Twitter key for individuals to discuss their mental health and find solace. Although these platforms provide important linguistic insights for different mental health disorders, most current computational models focus on classification accuracy in detriment of model transparency. This "black box" makes it challenging to adopt this concept in the clinic where mental health professionals need explainable systems in order to be able to trust the computational results and validate automated decision-support systems. In this paper, we present an explainable NLP and machine learning-based multi-class mental health classification system to recognize and classify multiple mental health disorders from Twitter posts. Our proposed approach is based on n-gram TF-IDF vectorization coupled with classical machine learning models such as Support Vector Machine, Random Forest, Decision Tree, Logistic Regression, XGBoost and Naive Bayes, and combines classification with model explainability (SHAP/LIME) with the aim of uncovering linguistic patterns associated with specific mental health conditions. This framework aims to address this challenge by not only measuring predictive precision but also interpretability, paving the way for a scalable approach to identifying mental health concerns in digital environments early in their onset. The overall accuracy of the proposed Linear SVM model was 86.5%, macro precision 85.9%, macro recall 85.2%, and macro F1-score 85.5%. The framework also exhibited excellent class-wise performance with an accuracy of 94.0% for the Control (Neutral) class and 87.2% for the Depression class. The results indicate that the proposed explainable framework could accurately classify the posts on Twitter as belonging to any or all of the major mental health categories, and the classification could be interpreted clinically.

Read PDF

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.