Spero: A Chatbot for Mental Health
Languages: Python
Libraries and Tools: langchain, nltk, pandas, gradio, regex, json
Mental health care is often difficult to access—barriers such as cost, stigma, availability of professionals, and the anxiety of seeking help mean many people go without support. With the rise of advanced AI models that can hold natural conversations, there is potential for chatbots to act as a first step or supplement to traditional therapy, providing accessible and immediate support for those who need it.
To explore this, my partner and I developed Spero, a therapeutic chatbot designed to deliver emotionally supportive and contextually relevant conversations. Spero uses a method called Retrieval-Augmented Generation (RAG), which allows the chatbot to pull information from thousands of client-therapist dialogues and use it to generate more grounded, realistic responses. We built the system using a therapy conversation dataset.
For evaluation, we measured how closely Spero’s responses matched real therapist-client transcripts using two well-known metrics:
- BLEU (Bilingual Evaluation Understudy): measures similarity of generated text to reference text by looking at word patterns.
- ROUGE (Recall-Oriented Understudy for Gisting Evaluation): measures how much important content from the reference was retained in the chatbot’s reply.
We also compared the performance of two large language models—OpenAI’s GPT-4o and DeepSeek’s R1-0—to see which one produced more supportive and accurate responses.
While mental health disorders often go underdiagnosed due to cost and limited access to care, projects like Spero highlight how AI can be used to bridge gaps, offering scalable, accessible, and empathetic support that can complement traditional therapy.
The complete report, with detailed code and visualizations, is available here
Here is a video demonstration of the project:
