Skip to main content

Mental Healthcare Chatbot Using Sequence-to-Sequence Learning and BiLSTM

  • Conference paper
  • First Online:
Brain Informatics (BI 2021)

Abstract

Mental health is an important aspect of an individual’s well-being which still continues to remain unaddressed. With the rise of the COVID-19 pandemic, mental health has far continued to decline, especially amongst the younger generation. The aim of this research is to raise awareness about mental health while simultaneously working towards removing the societal stigma surrounding it. Thus, in this paper, we have created an integrated chatbot that is specifically geared towards mentally ill individuals. The chatbot responds empathetically which is built using a Sequence-to-Sequence (Seq2Seq) encoder-decoder architecture. The encoder uses Bi-directional Long Short Term Memory (BiLSTM). To compare the performance, we used Beam Search and Greedy Search. We found Beam Search decoder performs much better, providing empathetic responses to the user with greater precision in terms of BLEU score.

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 89.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 119.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

References

  1. Adiba, F.I., Islam, T., Kaiser, M.S., Mahmud, M., Rahman, M.A.: Effect of corpora on classification of fake news using Naive Bayes classifier. Int. J. Autom. AI Mach. Learn. Canada 1, 80–92 (2020)

    Google Scholar 

  2. Andrade, L.H., Alonso, J.: Barriers to mental health treatment: results from the who world mental health (WMH) surveys. Psychol. Med. 44(06), 15 (2013). https://doi.org/10.1017/S0033291713001943

    Article  Google Scholar 

  3. Bahdanau, D., Cho, K., Bengio, Y.: Neural machine translation by jointly learning to align and translate. arXiv 1409, 15, September 2014

    Google Scholar 

  4. Brownlee, J.: A gentle introduction to calculating the bleu score for text in python. https://machinelearningmastery.com/calculate-bleu-score-for-text-python/

  5. Brownlee, J.: How to implement a beam search decoder for natural language processing. https://machinelearningmastery.com/beam-search-decoder-natural-language-processing/

  6. Cho, K., et al.: Learning phrase representations using RNN encoder-decoder for statistical machine translation. arXiv, p. 15, June 2014. https://doi.org/10.3115/v1/D14-1179

  7. Inkster, B., Sarda, S., Subramanian, V.: A real-world mixed methods data evaluation of an empathy-driven, conversational artificial intelligence agent for digital mental wellbeing. JMIR Mhealth Uhealth 6, 14 (2018). https://doi.org/10.2196/12106

    Article  Google Scholar 

  8. Lintz, N.: Sequence modeling with neural networks (part 2): Attention models. https://indico.io/blog/sequence-modeling-neural-networks-part2-attention-models/

  9. Mahmud, M., Kaiser, M.S., McGinnity, T.M., Hussain, A.: Deep learning in mining biological data. Cogn. Comput. 13(1), 1–33 (2020). https://doi.org/10.1007/s12559-020-09773-x

    Article  Google Scholar 

  10. Mahmud, M., et al.: A brain-inspired trust management model to assure security in a cloud based IoT framework for neuroscience applications. Cogn. Comput. 10, 864–873 (2018)

    Article  Google Scholar 

  11. Morgan, C., Webb, R.T.: Incidence, clinical management, and mortality risk following self harm among children and adolescents: cohort study in primary care. BMJ Clin. Res. 359, 9 (2017). https://doi.org/10.1136/bmj.j4351

    Article  Google Scholar 

  12. Nasrin, F., Ahmed, N.I., Rahman, M.A.: Auditory attention state decoding for the quiet and hypothetical environment: a comparison between BLSTM and SVM. In: Proceedings of TCCE, Advances in Intelligent Systems and Computing (2020)

    Google Scholar 

  13. Noor, M.B.T., Zenia, N.Z., Kaiser, M.S., Mamun, S.A., Mahmud, M.: Application of deep learning in detecting neurological disorders from magnetic resonance images: a survey on the detection of Alzheimer’s disease, Parkinson’s disease and schizophrenia. Brain Inform. 7(1), 1–21 (2020). https://doi.org/10.1186/s40708-020-00112-2

    Article  Google Scholar 

  14. Olah, C.: Understanding LSTM networks. http://colah.github.io/posts/2015-08-Understanding-LSTMs/

  15. Palasundram, K., Sharef, N.M., Nasharuddin, N.A., Kasmiran, K.A., Azman, A.: Sequence to sequence model performance for education chatbot. Int. J. Emerg. Technol. Learn. (iJET) 14(24), 56 (2019). https://doi.org/10.3991/ijet.v14i24.12187

    Article  Google Scholar 

  16. Papers with Code: Bidirectional LSTM. https://paperswithcode.com/method/bilstm

  17. Papers with Code: Long short-term memory. https://paperswithcode.com/method/lstm

  18. Prabhavalkar, N.: Mental health FAQ. https://www.kaggle.com/narendrageek/mental-health-faq-for-chatbot

  19. Prakash, A.V., Das, S.: Intelligent conversational agents in mental healthcare services: a thematic analysis of user perceptions. Pacific Asia J. Assoc. Inf. Syst. 12, 34 (2020). https://doi.org/10.17705/1pais.12201

  20. Prakash, K.B., Nagapawan, Y., Kalyani, N.L., Kumar, V.P.: Chatterbot implementation using transfer learning and LSTM encoder-decoder architecture. Int. J. Emerg. Trends Eng. Res. 8, 7 (2020). https://doi.org/10.30534/ijeter/2020/35852020

  21. Rahman, M.A.: Gaussian process in computational biology: covariance functions for transcriptomics. Ph.D. thesis, University of Sheffield (2018)

    Google Scholar 

  22. Rober, P., Ellliott, R., Buysse, A., Loots, G., Corte, K.D.: Positioning in the therapist’s inner conversation: a dialogical model based on a grounded theory analysis of therapist reflections. J. Marital Fam. Ther. 34(3), 16 (2008). https://doi.org/10.1111/j.1752-0606.2008.00080.x

    Article  Google Scholar 

  23. Sadik, R., Reza, M.L., Noman, A.A., Mamun, S.A., Kaiser, M.S., Rahman, M.A.: Covid-19 pandemic: a comparative prediction using machine learning. Int. J. Autom. AI Mach. Learn. Canada 1, 1–16 (2020)

    Google Scholar 

  24. Sak, H., Senior, A., Beaufays, F.: Long short-term memory based recurrent neural network architectures for large vocabulary speech recognition. In: Proceedings of the Annual Conference of the International Speech Communication Association, Interspeech, p. 5, February 2014

    Google Scholar 

  25. Yin, J., Chen, Z., Zhou, K., Yu, C.: A deep learning based chatbot for campus psychological therapy. arXiv 8, 31, October 2019

    Google Scholar 

  26. Yin, W., Kann, K., Yu, M., Schütze, H.: Comparative study of CNN and RNN for natural language processing. arXiv p. 7, February 2017

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Afsana Binte Rakib .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2021 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Rakib, A.B., Rumky, E.A., Ashraf, A.J., Hillas, M.M., Rahman, M.A. (2021). Mental Healthcare Chatbot Using Sequence-to-Sequence Learning and BiLSTM. In: Mahmud, M., Kaiser, M.S., Vassanelli, S., Dai, Q., Zhong, N. (eds) Brain Informatics. BI 2021. Lecture Notes in Computer Science(), vol 12960. Springer, Cham. https://doi.org/10.1007/978-3-030-86993-9_34

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-86993-9_34

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-86992-2

  • Online ISBN: 978-3-030-86993-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics