Maintenance Notice

Due to necessary scheduled maintenance, the JMIR Publications website will be unavailable from Wednesday, July 01, 2020 at 8:00 PM to 10:00 PM EST. We apologize in advance for any inconvenience this may cause you.

Who will be affected?

Accepted for/Published in: JMIR AI

Date Submitted: May 31, 2023
Date Accepted: Oct 27, 2023

The final, peer-reviewed published version of this preprint can be found here:

Momentary Depressive Feeling Detection Using X (Formerly Twitter) Data: Contextual Language Approach

Jamali AA, Berger C, Spiteri RJ

Momentary Depressive Feeling Detection Using X (Formerly Twitter) Data: Contextual Language Approach

JMIR AI 2023;2:e49531

DOI: 10.2196/49531

PMID: 38875532

PMCID: 11041470

Momentary Depressive Feeling Detection using X (formerly Twitter) data: A Contextual Language Approach

  • Ali Akbar Jamali; 
  • Corinne Berger; 
  • Raymond J Spiteri

ABSTRACT

Background:

Depression and momentary depressive feelings are major public health concerns that impose a substantial burden on both individuals and society. Early detection of momentary depressive feelings is highly beneficial in reducing this burden and improving the quality of life for affected individuals. Social media like Twitter provide a vast amount of data that can be analyzed for the early detection of momentary depressive feelings and offer valuable insight into individuals’ mental states.

Objective:

The objective of this study was to automate the detection of momentary depressive feelings in tweets using lexicon-based machine learning (ML) algorithms.

Methods:

First, we identified and collected terms expressing momentary depressive feelings and depression, scaled their relevance to depression, and constructed a lexicon. Then, we scraped tweets based on this lexicon and labelled them manually. Finally, we assessed the performance of the BERT, ALBERT, RoBERTa, DistilBERT, BiLSTM, CNN, and ML algorithms in detecting momentary depressive feelings in tweets.

Results:

Our study demonstrates that (pre-trained) lexicon-based transfer learning algorithms such as BERT and DistilBERT outperform traditional ML algorithms. In particular, DistilBERT achieved the best performance in terms of AUC (area under the curve) (96.71%), accuracy (97.4%), sensitivity (97.57%), specificity (97.22%), precision (97.30%), and F1-score (97.44%). DistilBERT obtained an AUC nearly 12 percentage points higher than that of the best-performing traditional ML algorithm, CNN. Our study showed that transfer learning algorithms are highly effective in extracting knowledge from tweets and detecting momentary depressive feelings, highlighting the superiority of these algorithms over traditional ML algorithms.

Conclusions:

Our findings suggest that lexicon-based ML algorithms --- particularly transfer learning algorithms --- are reliable approaches to automate the early detection of momentary depressive feelings and can be used to develop social media monitoring tools for identifying individuals who may be at risk of depression. The implementation of such tools could have significant implications for improving the mental health of affected individuals, as well as for preventing the escalation of depressive feelings to more severe levels. This, in turn, could reduce the burden of depression on society and lead to better overall health outcomes for those affected.


 Citation

Please cite as:

Jamali AA, Berger C, Spiteri RJ

Momentary Depressive Feeling Detection Using X (Formerly Twitter) Data: Contextual Language Approach

JMIR AI 2023;2:e49531

DOI: 10.2196/49531

PMID: 38875532

PMCID: 11041470

Download PDF


Request queued. Please wait while the file is being generated. It may take some time.

© The authors. All rights reserved. This is a privileged document currently under peer-review/community review (or an accepted/rejected manuscript). Authors have provided JMIR Publications with an exclusive license to publish this preprint on it's website for review and ahead-of-print citation purposes only. While the final peer-reviewed paper may be licensed under a cc-by license on publication, at this stage authors and publisher expressively prohibit redistribution of this draft paper other than for review purposes.