Spaces:
Sleeping
Sleeping
File size: 3,188 Bytes
5421d6e d8294c6 5421d6e fe336db 2f1982d fe336db bd30f7c fe336db 2f1982d fe336db 2f1982d fe336db 2f1982d fe336db 2f1982d fe336db 2f1982d fe336db bd30f7c fe336db 2f1982d fe336db 2f1982d fe336db 2f1982d bd30f7c 2f1982d fe336db 2f1982d fe336db 2f1982d fe336db 2f1982d bd30f7c fe336db 2f1982d fe336db bd30f7c fe336db bd30f7c fe336db 4e7a5e8 2f1982d fe336db bd30f7c fe336db bd30f7c 2f1982d bd30f7c 2f1982d bd30f7c 4e7a5e8 bd30f7c 2f1982d d8294c6 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
---
title: Mental Health Counselor Assistant
emoji: π§
colorFrom: indigo
colorTo: green
sdk: streamlit
sdk_version: 1.44.1
app_file: app.py
pinned: false
license: mit
---
# π§ Mental Health Counselor Assistant
**Mental Health Counselor Assistant** is an AI-powered Streamlit application hosted on [Hugging Face Spaces](https://huggingface.co/spaces/scdong/mental_health_chatbot). It assists mental health professionals by classifying user inputs and generating supportive counselor-style responses using large language models (LLMs) like **Flan-T5** and **Mistral-7B**.
---
## β‘ Quick Start
The app uses `google/flan-t5-base` for fast, low-latency response generation.
> π `app.py` is optimized for **speed**, using only `/flan-t5-base`.
> While the results may not be as expressive as other models, it loads and responds much faster.
> For higher quality but slower results, try the other two apps included.
---
## π¦ Project Structure
```
mental_health_chatbot/
βββ app.py # Fast demo with Flan-T5 only (used on Hugging Face)
βββ app_use_Mistral-7B.py # Local LLM with quantized Mistral-7B via llama.cpp
βββ app_with_FlanT5_FlanAlpacaGPT4_FlanUL2.py # Hosted Hugging Face models (slower, richer output)
βββ requirements.txt
βββ Dockerfile
βββ README.md
βββ LICENSE
βββ dataset/
β βββ Kaggle_Mental_Health_Conversations_train.csv
βββ utils/
β βββ helper_functions.py
βββ notebooks/
β βββ Flan-T5_on_Kaggle_Dataset.ipynb
β βββ Mistral-7B_on_Kaggle_Dataset.ipynb
β βββ ML_on_Kaggle_Dataset.ipynb
βββ log/
βββ chat_log_2025-04-11_05-31-25.csv
```
---
## π‘ Features
- π **Intent Classification** (XGBoost):
Tags inputs as `advice`, `validation`, `information`, or `question`.
- π€ **LLM-Based Suggestion Generation**
Choose from:
- `google/flan-t5-base` (fastest)
- `declare-lab/flan-alpaca-gpt4-xl`
- `google/flan-ul2`
- `mistralai/Mistral-7B-Instruct-v0.1` (local only)
- πΎ **Session Logging**
Automatically saves conversation history to CSV in `/log`.
---
## π Run Locally (Optional)
```bash
git clone https://huggingface.co/spaces/scdong/mental_health_chatbot
cd mental_health_chatbot
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
streamlit run app.py
```
For the Mistral or full-model version:
```bash
streamlit run app_use_Mistral-7B.py
# or
streamlit run app_with_FlanT5_FlanAlpacaGPT4_FlanUL2.py
```
---
## π Dataset
This project uses:
- π§Ύ `Kaggle_Mental_Health_Conversations_train.csv`
A labeled dataset of user statements and counselor responses used for training and testing classification.
---
## π§ββοΈ Intended Use
This tool is designed for:
- Mental health professionals exploring AI assistance
- NLP researchers and students
- Developers building mental health chatbot prototypes
> β οΈ **Not a substitute for professional mental health advice.**
---
## π License
This project is licensed under the **MIT License**.
See the `LICENSE` file for more details.
``` |