scdong commited on
Commit
4e7a5e8
Β·
verified Β·
1 Parent(s): c24ae11

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +65 -62
README.md CHANGED
@@ -1,106 +1,109 @@
1
- # 🧠 Mental Health Counselor Assistant
2
-
3
- A privacy-friendly, intelligent assistant designed to help mental health professionals explore **response suggestions** based on patient input. Built with `XGBoost` for intent classification and `Mistral-7B` for natural language generation, this app helps support clinical conversations with empathy and structure β€” while keeping you in full control.
4
-
5
  ---
6
-
7
- ## βœ… Problem Statement
8
-
9
- Mental health counselors are tasked with responding to a wide range of complex emotions and situations. In high-pressure or uncertain moments, this tool helps:
10
-
11
- - Predict the **intent** behind a patient's message (advice-seeking, validation, informational, or inquisitive)
12
- - Generate a supportive, **AI-assisted counselor response**
13
- - Log conversations for review and learning
14
- - Preserve privacy with local inference β€” built for **HIPAA-aware workflows**
15
-
 
 
 
 
 
 
 
16
  ---
17
 
18
- ## ✨ Features
19
 
20
- - πŸ” **Intent Prediction** β€” XGBoost classifier trained on annotated mental health dialogue
21
- - πŸ’¬ **Response Generation** β€” LLM-backed replies using quantized [Mistral-7B](https://mistral.ai/news/announcing-mistral-7b/)
22
- - 🧠 **Multi-turn Memory** β€” Maintains up to 6 rounds of conversation
23
- - βœ… **Export to JSON + CSV** β€” With timestamps for traceability
24
- - 🧰 **HIPAA-conscious Design** β€” No third-party API calls required; all runs locally
25
 
26
  ---
27
 
28
- ## πŸ–ΌοΈ App Preview
29
 
30
- ![counselor assistant demo](demo/demo.gif)
 
 
 
 
 
31
 
32
  ---
33
 
34
  ## πŸš€ How to Run
35
 
36
- ### πŸ”§ Local (with Mistral-7B)
37
 
38
- > 🧩 You must download a quantized `.gguf` model file from Hugging Face or TheBloke, e.g.:
39
- >
40
- > `/Users/yourname/models/mistral/mistral-7b-instruct-v0.1.Q4_K_M.gguf`
 
 
41
 
42
- ```bash
43
- git clone https://github.com/yourname/mental-health-chatbot.git
44
- cd mental-health-chatbot
45
- pip install -r requirements.txt
46
- streamlit run app_local.py
47
- ```
 
 
 
 
48
 
49
  ---
50
 
51
- ### 🐳 Docker (Recommended)
52
 
53
- ```bash
54
- docker build -t counselor-assistant .
55
- docker run -p 8501:8501 counselor-assistant
56
- ```
 
57
 
58
  ---
59
 
60
- ## πŸ“ Project Structure
61
 
62
  ```
63
- mental-health-chatbot/
64
  β”‚
65
- β”œβ”€β”€ app_local.py # Streamlit app (uses llama-cpp + XGBoost)
66
  β”œβ”€β”€ requirements.txt
67
  β”œβ”€β”€ Dockerfile
68
- β”œβ”€β”€ demo/ # Optional: screenshots or .gif
69
- β”œβ”€β”€ dataset/
 
70
  β”‚ └── Kaggle_Mental_Health_Conversations_train.csv
71
  β”œβ”€β”€ models/
72
  β”‚ └── mistral-7b-instruct-v0.1.Q4_K_M.gguf
73
- β”œβ”€β”€ README.md
74
- └── LICENSE
 
 
 
75
  ```
76
 
77
  ---
78
 
79
- ## πŸ“Œ Design Decisions
80
-
81
- - 🧠 Used `TfidfVectorizer` + `XGBoost` as a **lightweight, interpretable** classifier
82
- - πŸ”’ LLM inference handled locally with `llama-cpp-python` β€” no external data leaks
83
- - πŸ“¦ Docker support to simulate realistic deployment and improve portability
84
- - 🎯 Optimized for educational and prototyping use in **clinician settings**
85
-
86
- ---
87
-
88
- ## πŸ“ Future Improvements
89
 
90
- - Add long-form audio transcription support
91
- - Integrate feedback loop for model tuning
92
- - Auto-summary of sessions
93
- - Hugging Face Space version (hosted with opt-in privacy tradeoffs)
94
 
95
  ---
96
 
97
- ## πŸ‘©β€βš•οΈ A Note to Reviewers
98
 
99
- This project was developed for an interview to showcase how **AI and empathy** can work hand-in-hand to support mental health professionals. Thank you for reviewing, and I hope it sparks a great conversation about the intersection of tech and care. πŸ’™
100
 
101
  ---
102
 
103
- ## πŸ“„ License
104
 
105
- MIT β€” free to use and modify, but please be thoughtful in healthcare applications.
106
 
 
 
 
 
 
1
  ---
2
+ title: Counselor Assistant
3
+ emoji: 🧠
4
+ colorFrom: purple
5
+ colorTo: blue
6
+ sdk: streamlit
7
+ sdk_version: "1.32.2"
8
+ app_file: app.py
9
+ pinned: false
10
+ ---
11
+ title: Counselor Assistant
12
+ emoji: 🧠
13
+ colorFrom: purple
14
+ colorTo: blue
15
+ sdk: streamlit
16
+ sdk_version: "1.32.2"
17
+ app_file: app.py
18
+ pinned: false
19
  ---
20
 
21
+ # 🧠 Counselor Assistant - AI Support for Mental Health Conversations
22
 
23
+ This Streamlit app helps **mental health counselors** explore supportive language and therapeutic approaches for responding to patient concerns. It leverages a **machine learning classifier** (XGBoost) to detect intent and a **quantized Mistral-7B model** to generate helpful replies.
 
 
 
 
24
 
25
  ---
26
 
27
+ ## βœ… Features
28
 
29
+ - **ML-Based Intent Prediction**: Uses TF-IDF + XGBoost to detect if the message needs validation, advice, information, or follow-up.
30
+ - **Mistral-7B Counselor Response**: LLM-powered suggestion using your local model (gguf) or Hugging Face-hosted model.
31
+ - **Multi-turn Memory**: Keeps context from recent messages.
32
+ - **Word Count + Guidance**: Shows word count to help user compose inputs.
33
+ - **Conversation Export**: Save to `.csv` or `.json` for recordkeeping.
34
+ - **Interview-Ready Design**: Friendly UI, emoji icons, prompt examples, and reset options.
35
 
36
  ---
37
 
38
  ## πŸš€ How to Run
39
 
40
+ ### πŸ§ͺ Locally (with your own Mistral model)
41
 
42
+ 1. Clone the repo:
43
+ ```bash
44
+ git clone https://github.com/your-username/mental_health_chatbot.git
45
+ cd mental_health_chatbot
46
+ ```
47
 
48
+ 2. Place your **gguf model** under `models/`:
49
+ ```
50
+ models/mistral-7b-instruct-v0.1.Q4_K_M.gguf
51
+ ```
52
+
53
+ 3. Create and activate a virtual environment:
54
+ ```bash
55
+ pip install -r requirements.txt
56
+ streamlit run app.py
57
+ ```
58
 
59
  ---
60
 
61
+ ### 🌐 Deploy on Hugging Face Spaces
62
 
63
+ - βœ… Use this repo
64
+ - βœ… Upload your model or switch to a hosted one like `google/flan-t5-base`
65
+ - βœ… Add a `Space` on [Hugging Face](https://huggingface.co/spaces)
66
+
67
+ > You can modify `generate_llm_response()` to use Hugging Face's `pipeline` if GPU is not needed.
68
 
69
  ---
70
 
71
+ ## πŸ“ Folder Structure
72
 
73
  ```
74
+ mental_health_chatbot/
75
  β”‚
76
+ β”œβ”€β”€ app.py
77
  β”œβ”€β”€ requirements.txt
78
  β”œβ”€β”€ Dockerfile
79
+ β”œβ”€β”€ README.md
80
+ β”œβ”€β”€ LICENSE
81
+ β”œβ”€β”€ data/
82
  β”‚ └── Kaggle_Mental_Health_Conversations_train.csv
83
  β”œβ”€β”€ models/
84
  β”‚ └── mistral-7b-instruct-v0.1.Q4_K_M.gguf
85
+ β”œβ”€β”€ utils/
86
+ β”‚ └── helper_functions.py
87
+ └── static/
88
+ └── images/
89
+ └── demo.gif
90
  ```
91
 
92
  ---
93
 
94
+ ## πŸ“Έ Screenshot / Demo
 
 
 
 
 
 
 
 
 
95
 
96
+ ![demo](static/images/demo.gif)
 
 
 
97
 
98
  ---
99
 
100
+ ## πŸ‘©β€πŸ’» Why I Built This
101
 
102
+ Mental health professionals often face emotionally complex conversations. This assistant offers **non-binding, thoughtful suggestions** to aid their decision-making β€” not to replace them, but to **support their professional judgment**.
103
 
104
  ---
105
 
106
+ ## πŸ“œ License
107
 
108
+ MIT License β€” see [`LICENSE`](./LICENSE)
109