--- 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. ```