Automatic Detection and Prediction of Psychiatric Hospitalizations From Social Media Posts (2021)

Abstract: We address the problem of predicting psychiatric hospitalizations using linguistic features drawn from social media posts. We formulate this novel task and develop an approach to automatically extract time spans of self-reported psychiatric hospitalizations. Using this dataset, we build predictive models of psychiatric hospitalization, comparing feature sets, user vs. post classification, and comparing model performance using a varying time window of posts. Our best model achieves an F1 of .718 using 7 days of posts. Our results suggest that this is a useful framework for collecting hospitalization data, and that social media data can be leveraged to predict acute psychiatric crises before they occur, potentially saving lives and improving outcomes for individuals with mental illness.

## introduction every year, approximately 1% of adults in the united states are hospitalized for psychiatric reasons, including increased suicidality and psychosis @xcite . with the global covid-19 pandemic, hospitalizations due to suicidality are projected to increase substantially @xcite , and there is already evidence of the adverse impact of the pandemic on the mental health of individuals around the world @xcite . psychiatric hospitalizations typically result from crises among individuals struggling with suicidality and mental illness. the present study aims to predict psychiatric hospitalization due to increased suicidality or a psychotic break before it occurs. there are several motivations for this research goal. improving our ability to better predict psychiatric hospitalization helps enable the identification of early warning signs of these crises before they fully develop. early detection and prediction of acute psychiatric crises is essential for lowering mortality rates and improving overall outcomes for individuals suffering with mental illness. further, psychiatric hospitalizations place a tremendous burden on limited hospital resources, and involve steep costs for patients as well as taxpayers @xcite . typically, prediction of psychiatric hospitalization has relied on rich and personalized clinical information for a particular patient. this requirement has limited the size of available datasets, and has also limited the possibility of reaching and helping potential patients who do not have a welldocumented psychiatric medical history. in this work we circumvent this limitation by leveraging social media data to train and evaluate predictive models of psychiatric hospitalization. this is a necessary step towards the ultimate goal of predicting behavioral and cognitive changes that often lead to hospitalization. there is a rich literature of computer scientists, psychologists, and psychiatrists taking advantage of the vast amount of social media data -which includes language data of posts and comments, as well as meta-information such as preferences, engagement patterns, and group membership -to gain insights about mental states and behaviors of people with psychiatric disorders. building on this successful line of research, we detect engagement patterns combined with selfdisclosures to identify potential periods of psychiatric hospitalization. we compile a dataset of these periods, or time spans, along with the posts preceding those periods, and conduct machine learning experiments to automatically predict whether a post precedes a hospitalization or not. our results suggest that this is a potentially useful approach for predicting psychiatric hospitalizations before they occur. this can enable clinicians to mitigate and hopefully prevent a psychotic break or suicide attempt, helping to save patients' lives and improve outcomes. the rest of this paper is organized as follows: section 2 reviews related work and section 3 describes our novel data collection approach. section 4 presents our experiments to predict psychiatric hospitalizations, and section 5 provides analyses of the data and the learned models to gain further insights about the dataset and our results. we conclude in section 6 and discuss ideas for future work. ## related work research over the past decade has supported and validated the use of computational linguistics techniques applied to social media data for predicting and detecting mental illness across a broad range of psychiatric conditions @xcite . to date, linguistic indicators of psychopathology have been identified for a wide range of psychiatric conditions @xcite @xcite @xcite . recent work has also looked at detecting and predicting suicidality using linguistic features from social media posts @xcite @xcite . while the majority of past research has compared specific psychiatric conditions with healthy control groups, more recent work has begun analyzing and identifying unique differences and discriminators among psychiatric conditions @xcite @xcite . as this area progresses, we have begun to investigate whether this technology can be used beyond detection of mental illness for detecting severity of symptomatology and prediction of acute psychiatric episodes that result in hospitalization. this would benefit patients by alerting clinicians to worsening symptoms, allowing for early intervention care and potential mitigation. relatedly, advancements in machine learning techniques have led to the development of advanced models for predicting psychiatric crises such as increased suicidality and psychotic episodes using a multimodal approach based on clinical data @xcite . however, to date, these studies have relied exclusively on clinical data and medical data. to our knowledge, this is the first study to leverage a large dataset of publicly available social media posts for predicting psychiatric hospitalization. ## data collection in this section we describe the pipeline components of our dataset construction process, in the order in which they are applied. ## prediction of psychiatric hospitalization having collected a dataset of proposed hospitalization spans and preceding posts, we use our collected dataset to build predictive models of psychiatric hospitalizations. we experiment with two different task formulations: post-level prediction and user-level prediction. post-level prediction involves a binary classification for each post, determining whether the post is followed by valid hospitalization span or not. user-level prediction classifies a group of posts from a user in a given time window to predict whether the user will be hospitalized. in order to train classification models, we first need to select negative samples as a control group for our experiments. we describe our methods of pairing negative samples in subsection 4.1. we experiment with three set of features: unigram, bigram foot_1 and liwc @xcite features. we perform hyper-parameter grid search to optimize performance. for all features we use the naive-bayes classifier, as it has been found to perform well on small datasets @xcite . we pre-process the text by lower-casing all input posts and, following the guidelines of @xcite , we de-identify posts by anonymizing urls and replacing usernames with randomly generated strings. ## lexical analysis figure 3 shows the list of most predictive words for the unigram model. we see that many words correspond to time duration (e.g. "week", "month"), ## conclusion and future work we present a novel social media data collection method for identifying hospitalization time spans and design a novel classification task for predicting psychiatric hospitalizations. we experiment with multiple linguistic feature sets and task formulations, including user-level and post-level classification, as well as varying the time window of posts used. our results suggest that this is a useful framework for collecting data related to psychiatric hospitalization, and that social media data can be leveraged to predict psychiatric crises before they occur. in our ongoing and future work, we plan to conduct further analysis of the language of pre-hospitalization posts to gain insights about linguistic patterns and changes that occur as the user experiences a psychiatric crisis. we also plan to improve the data collection process to achieve better precision and to expand to a larger scale. we hope that an improved understanding of the linguistic cues that precede psychiatric hospitalizations, as well as improvements in automatic prediction of hospitalizations, will enable interventions that can potentially save lives and improve outcomes for individuals with mental illness.