This paper presents a web-based mental health chatbot powered by a fine-tuned BERT (Bidirectional Encoder Representations from Transformers) model designed to classify the severity of depression in user input. The application utilises Flask for the backend and integrates a BERT model to categorise user messages into four emotional states: none, mild, moderate, or severe. It enhances its functionality with a set of positive keyword heuristics and confidence-based rule handling to make more nuanced predictions when the model's confidence is low. To promote mental well-being, the Chatbot provides personalised suggestions and actionable content such as breathing exercises, games, or mental health support links based on the detected emotional level. Additionally, the application employs Google’s Gemini language model to generate empathetic and context-aware responses, ensuring the user feels heard and supported. This fusion of machine learning, natural language processing, and mental health awareness creates an accessible and supportive tool aimed at promoting emotional wellness through intelligent interaction.
Bose et al. (Mon,) studied this question.