Citation
Share
Date
Abstract
With the rise of social media, these platforms have emerged as a crucial source of information for studying people's thoughts and behaviors. By using natural language processing and machine learning techniques, prior studies have explored the language of users living with different mental health conditions. However, these efforts have focused on analyzing conditions in isolation, particularly depression, and have relied on English-language data. The goal of this study is to examine the communications of English- and Spanish-speaking Twitter users through traditional and deep learning algorithms to automatically recognize whether they live with one of nine mental health conditions. To achieve that, we created two datasets in English and Spanish. The “diagnosed” set comprises the timeline of 1,500 users who explicitly reported in one or more of their posts having been diagnosed with one of the following: ADHD, Anxiety, Autism, Bipolar, Depression, Eating disorders, OCD, PTSD, and Schizophrenia. The “control” set comprises the timeline of 1,700 randomly selected users who had not disclosed a diagnosis. We extracted a variety of text features from the collected data, such as n-grams, q-grams, Part-of-speech (POS) tags, topic modeling, Linguistic Inquiry and Word Count (LIWC), and word embeddings, and trained traditional machine learning and deep learning classifiers for two tasks: binary classification, to distinguish between diagnosed and non-diagnosed users, and multiclass classification, to identify the specific diagnosis. The performance of the models was analyzed using 5-fold cross-validation, four different classification metrics (AUC, F1-score, Precision, and Recall), and the Friedman non-parametric test with the Finner post-hoc procedure. Overall, XGBoost and CNN performed the best in the two classification tasks. Employing our collected datasets, in binary classification, we achieved an AUC of 0.835 on the Spanish Twitter dataset using n-grams of words from one to three (UBT) and 0.846 on the English Twitter dataset with a 5-gram characters (C5) model. In multiclass classification, we obtained an AUC of 0.747 and 0.697 in the Spanish and English Twitter datasets, respectively. In the second phase of our research, we introduced a model named BiLEMD for the multiclass classification of mental disorders. Our approach adopts a hierarchical detection strategy, where each base model within our framework leverages diverse textual features. We aim to emulate, to some extent, the step-by-step approach employed in human clinical diagnostics. In clinical practice, professionals first determine the presence or absence of a condition before proceeding to specify its type. Although BiLEMD achieved the highest ranking in both the Spanish and English Twitter datasets, statistical significance differences were not observed. Nevertheless, additional analysis revealed that ensembles, including BiLEMD and Stacking, reduce misclassification within the control class. Moreover, BiLEMD exhibits slightly superior performance in terms of AUC and Recall compared to other classifiers. The development of computer-based methods for recognizing and classifying social media user profiles related to different mental health conditions could enhance the performance of applications aimed at early diagnosis and timely treatment.