Skip to main content

Using Social Media as a Mood Detector

|

Advanced technology can plumb user-generated content for clues to poor mental health

Colourful balls with faces depicting a range of emotions
iStock/Puttachat Kumkrong

It’s not your imagination: Hanging out on social networking sites can be bad news for your mental health. Studies have identified a strong association between online platforms like Facebook and Reddit and increased risk of depression, anxiety and psychological distress, particularly among adolescents. One could make the case that they should require a warning label: “Scrolling these pages may lead to low self-esteem.”

Yet, a new field of research is trying to turn the vulnerability of the Facebooks and Reddits of the world into an asset. While the steady stream of user-generated status updates and posts may be a stepping stone to depression, studies now suggest it can also act as a diagnostic aid for mental health practitioners.

For anyone investigating the markers of mental health, the textual content of social media updates is a gold mine of data on individuals’ emotions and behaviours. Using artificial intelligence tools such as natural language processing (NLP) and machine learning models, researchers can conduct linguistic and sentiment analysis of social media content to uncover patterns that may otherwise be missed. 

The results have been promising, as connections are made between certain words or phrases and an individual’s state of mind, says Guang Li, Distinguished Research and Teaching Fellow of Management Analytics at Smith School of Business. Predictive markers in social media data have been identified for addiction, post-traumatic stress disorder and suicidal ideation.  

While they are powerful new tools to detect depression within social media content, Li says that NLP and machine learning, when used in isolation, have shortcomings. For one, affective patterns—the shifting emotions that shape behaviour—may not show up in the linguistic fragments that are the basis of NLP and machine learning studies. Similarly, AI-based tools may overlook personality traits as well as how users influence each other within online social groups.

Building a better mood radar

Li and colleague Xingwei Yang (Ted Rogers School of Management) wanted to see if they could overcome these shortcomings. Their goal was to use NLP and machine learning to develop a better way to detect the mental well-being of social media users that integrated psychological patterns, contextual information and, crucially, social interactions.

“Our study aimed for early-stage detection and initial screening to identify individuals at risk of getting depression,” says Li. “We wanted to see if we could narrow down those needing closer observation or follow-up.”

The Pain Behind the Silence
Readers Also Enjoyed The Pain Behind the Silence

Li and Yang started with a particularly rich dataset that was created in 2013 for a study of user personality in online social networks. The dataset contained 197,230 Facebook status updates from 1,047 users and their network connections. It included the results from a questionnaire completed by each user on how often they felt lonely or sad or had restless sleep over the course of one week as well as information on their personality features.

With data in hand, the processing work began. First, using NLP, they extracted emotion-tinged words from social media status updates: text conveying surprise, anger, joy, fear, trust, sadness, anticipation or disgust. They also extracted text of each user’s posts relating to social interaction in their online network in a bid to understand how interactions between individuals with and without depression influence each other.

Finally, Li and Yang applied machine learning models to analyze the mental states of users within social media environments.

Their results were promising—and a significant step up from the Linguistic Inquiry and Word Count (LIWC) baseline, the widely used tool for analyzing text in mental health research. By combining language use, personality traits and social interaction patterns, their framework improved detection accuracy by about six percentage points and overall balance by about 10 percentage points compared to LIWC.

Li says the framework she and Yang developed has the potential to expedite the diagnostic process and provide timely referral services to individuals at high risk. She says it is designed to complement, not replace, clinical diagnoses. In practice, Li says, mental health practitioners could use the tool to monitor publicly shared social media content (with consent) to detect potential signs of depression earlier. “This could guide practitioners toward asking the right questions during consultations or identifying at-risk individuals who might otherwise be overlooked,” she says.

For now, the framework remains a research tool. The next steps involve improving robustness, validating it with larger and more diverse datasets and exploring collaboration with healthcare practitioners to test how it could be integrated into clinical settings. The long-term goal, Li says, is to bridge research and practice by creating tools that can support professional mental health care.

“With an improved understanding of users’ mental states reflected in the psychological and contextual aspects,” she says, “clinicians can more easily detect significant changes in users’ emotional, psychological and mental health states.”