Skip to main content

Detecting Depression in Tweets Using Natural Language Processing and Deep Learning

  • Conference paper
  • First Online:
Information and Communication Technology for Competitive Strategies (ICTCS 2021)

Part of the book series: Lecture Notes in Networks and Systems ((LNNS,volume 400))

Abstract

COVID-19 has caused physical, emotional, and psychological distress for people. Due to COVID-19 norms, people were restricted to their homes and could not interact with other people, due to which they turned to social media to express their state of mind. In this paper, we implemented a system using TensorFlow, which consists of multilayer perceptron (MLP), convolutional neural networks (CNN), and long short-term memory (LSTM), which works on preprocessing, semantic information on our manually extracted dataset using Twint scraper. The models were used for classifying tweets, based upon whether they indicate depressive behavior or not. We experimented for different optimizer algorithms and their related hyperparameters for all the models. The highest accuracy was achieved by MLP using sentence embeddings, which gave an accuracy of 94% over 50 epochs, closely followed by the other two.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 189.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 249.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

References

  1. World Health Organization. Depression. https://www.who.int/news-room/fact-sheets/detail/depression. Accessed 28 June 2021

  2. You are what you tweet—towards data science, medium. https://towardsdatascience.com/you-are-what-you-tweet-7e23fb84f4ed. Accessed 27 June 2021

  3. World happiness report 2021. https://worldhappiness.report/ed/2021/. Accessed 24 June 2021

  4. 200 million tweets per day. https://blog.twitter.com/en_us/a/2011/200-million-tweets-per-day. Accessed 30 June 2021

  5. Monitoring tweets for depression to detect at-risk users. https://ruor.uottawa.ca/bitstream/10393/36030/1/Jamil_Zunaira_2017_thesis.pdf. Accessed 29 June 2021

  6. Depressive moods of users portrayed in Twitter. https://nyuscholars.nyu.edu/ws/portalfiles/portal/90894123/depressive_moods_kdd.pdf. Accessed 28 June 2021

  7. AlSagri H, Ykhlef M (2020) Machine learning-based approach for depression detection in Twitter using content and activity features. IEICE Trans Inf Syst E103.D(8):1825–1832. https://doi.org/10.1587/transinf.2020EDP7023

  8. Islam MR, Kabir MA, Ahmed A, Kamal ARM, Wang H, Ulhaq A (2018) Depression detection from social network data using machine learning techniques. Health Inf Sci Syst 6. https://doi.org/10.1007/2Fs13755-018-0046-0

  9. Detecting depression through tweets. https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1184/reports/6879557.pdf. Accessed 28 June 2021

  10. Orabi AH, Buddhitha P, Orabi MH, Inkpen D (2018) Deep learning for depression detection of Twitter users. Int J Comput Linguist Appl 88–97. https://doi.org/10.18653/v1/W18-0609

  11. Wen S. Detecting depression from tweets with neural language processing. J Phys Conf Ser 1792. https://doi.org/10.1088/1742-6596/1792/1/012058

  12. Maigrot C, Bringay S, Azé J (2016) Concept drift vs suicide: how one can help prevent the other? Int J Comput Linguist Appl

    Google Scholar 

  13. Hochreiter S, Schmidhuber J (1997) Long short-term memory. Neural Comput 1735–1780. https://doi.org/10.1162/neco.1997.9.8.1735

  14. Kim Y (2014) Convolutional neural networks for sentence classification. In: Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), pp 1746–1751. https://doi.org/10.3115/v1/D14-1181

  15. Pennington J, Socher R, Manning C (2014) Global vectors for word representation. In: Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), pp 1532–1543. https://doi.org/10.3115/v1/D14-1162

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Abhishek Kuber .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2023 The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd.

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Kuber, A., Kulthe, S., Kosamkar, P. (2023). Detecting Depression in Tweets Using Natural Language Processing and Deep Learning. In: Joshi, A., Mahmud, M., Ragel, R.G. (eds) Information and Communication Technology for Competitive Strategies (ICTCS 2021). Lecture Notes in Networks and Systems, vol 400. Springer, Singapore. https://doi.org/10.1007/978-981-19-0095-2_43

Download citation

  • DOI: https://doi.org/10.1007/978-981-19-0095-2_43

  • Published:

  • Publisher Name: Springer, Singapore

  • Print ISBN: 978-981-19-0094-5

  • Online ISBN: 978-981-19-0095-2

  • eBook Packages: EngineeringEngineering (R0)

Publish with us

Policies and ethics