An AI chatbot leveraging LLM and NLP techniques to assess mental health through a conversation based on the 9 PHQ-9 questions, providing empathetic, privacy-focused interactions and evaluations based on user responsesβ scores
Python
2
15 commits
updated May 24, 2025
A conversational AI system designed to assist with preliminary psychological assessments, mental health screening, and personalized well-being support.
Built using Vistral 7B, this chatbot delivers a safe, empathetic, and structured dialogue experience.

This chatbot guides users through the PHQ-9 questionnaire, a standard clinical tool for assessing depression severity. It simulates an empathetic conversation that ensures emotional safety, privacy, and clarity for the user. The chatbot:
| Component | Technology |
|---|---|
| Language Model | Vistral-7B-Chat |
| Backend | Python, FastAPI |
| Frontend | Html, Css |
git clone https://github.com/VinhAlth/chatbot-mental-checkin.git
cd chatbot-mental-checkin
pip install -r requirements.txt
python main.py
Open your browser and visit: http://localhost:8000
your_project/
βββ data copy/ # Temporary folder for copied or backup data
βββ logs/ # Stores application logs (e.g., user sessions, errors)
βββ result/run # Stores model output for each run (e.g., result_001.json)
βββ src/ # Main source code for the system (logic, AI, processing)
β βββ __init__.py
β βββ executive.py # Controls and coordinates chatbot conversation flow
β βββ predict.py # Manage real-time conversation and save results to CSV
β βββ prompts.py # Contains prompts for the LLM (e.g., VistralChatbot), PHQ-9 questions
β βββ utils.py # Utility functions for model loading, conversation handling, etc.
β βββ end.py # Calculates and evaluates scores at the end of a test
βββ static/ # Static files (CSS, JS, images) for the web interface
βββ templates/ # HTML templates
βββ .gitignore
βββ analyse.py # Analyzes user results after completing the questionnaire
βββ main.py # Entry point to run the Flask web application
βββ patient_infor.txt # Temporary storage for patient information during a session
βββ predict.py # Process data from CSV, predict, and save to CSV
βββ readme.md # Project documentation (overview, setup, usage)
βββ requirement.txt # List of required Python packages (install via `pip install -r`)
π€ User: I donβt feel interested in anything these days. π€ Chatbot: Iβm really sorry youβre feeling that way. Itβs okay to feel overwhelmed. Could you tell me how often you've felt like this over the last 2 weeks?
π€ User: Almost every day. π€ Chatbot: Thank you for your honesty. That sounds difficult. I'm here to help you explore how you're feeling, one step at a time.
(β¦ continues through 9 questions)
π€ Chatbot (Final): Based on your responses, it might help to try daily mindfulness or reach out to a trusted person. If this feeling persists, I recommend talking to a mental health professional. Youβre not alone, and support is available π
β οΈ Disclaimer: This chatbot is a research prototype and does not offer professional medical advice. If you're experiencing a mental health crisis, please contact a licensed therapist or local emergency services.
An AI chatbot leveraging LLM and NLP techniques to assess mental health through a conversation based on the 9 PHQ-9 questions, providing empathetic, privacy-focused interactions and evaluations based on user responsesβ scores
Python
2
15 commits
updated May 24, 2025
A conversational AI system designed to assist with preliminary psychological assessments, mental health screening, and personalized well-being support.
Built using Vistral 7B, this chatbot delivers a safe, empathetic, and structured dialogue experience.

This chatbot guides users through the PHQ-9 questionnaire, a standard clinical tool for assessing depression severity. It simulates an empathetic conversation that ensures emotional safety, privacy, and clarity for the user. The chatbot:
| Component | Technology |
|---|---|
| Language Model | Vistral-7B-Chat |
| Backend | Python, FastAPI |
| Frontend | Html, Css |
git clone https://github.com/VinhAlth/chatbot-mental-checkin.git
cd chatbot-mental-checkin
pip install -r requirements.txt
python main.py
Open your browser and visit: http://localhost:8000
your_project/
βββ data copy/ # Temporary folder for copied or backup data
βββ logs/ # Stores application logs (e.g., user sessions, errors)
βββ result/run # Stores model output for each run (e.g., result_001.json)
βββ src/ # Main source code for the system (logic, AI, processing)
β βββ __init__.py
β βββ executive.py # Controls and coordinates chatbot conversation flow
β βββ predict.py # Manage real-time conversation and save results to CSV
β βββ prompts.py # Contains prompts for the LLM (e.g., VistralChatbot), PHQ-9 questions
β βββ utils.py # Utility functions for model loading, conversation handling, etc.
β βββ end.py # Calculates and evaluates scores at the end of a test
βββ static/ # Static files (CSS, JS, images) for the web interface
βββ templates/ # HTML templates
βββ .gitignore
βββ analyse.py # Analyzes user results after completing the questionnaire
βββ main.py # Entry point to run the Flask web application
βββ patient_infor.txt # Temporary storage for patient information during a session
βββ predict.py # Process data from CSV, predict, and save to CSV
βββ readme.md # Project documentation (overview, setup, usage)
βββ requirement.txt # List of required Python packages (install via `pip install -r`)
π€ User: I donβt feel interested in anything these days. π€ Chatbot: Iβm really sorry youβre feeling that way. Itβs okay to feel overwhelmed. Could you tell me how often you've felt like this over the last 2 weeks?
π€ User: Almost every day. π€ Chatbot: Thank you for your honesty. That sounds difficult. I'm here to help you explore how you're feeling, one step at a time.
(β¦ continues through 9 questions)
π€ Chatbot (Final): Based on your responses, it might help to try daily mindfulness or reach out to a trusted person. If this feeling persists, I recommend talking to a mental health professional. Youβre not alone, and support is available π
β οΈ Disclaimer: This chatbot is a research prototype and does not offer professional medical advice. If you're experiencing a mental health crisis, please contact a licensed therapist or local emergency services.