File size: 1,188 Bytes
70d2caa |
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 |
---
license: apache-2.0
---
# 🧠 Mental Health Text Classifier
This repository contains an AI-powered tool designed to classify text into one of the following mental health categories:
- **Stress**
- **Anxiety**
- **Depression**
- **Other**
It leverages **OpenAI's GPT-4** for classification using few-shot learning, combined with BM25 for contextual similarity.
## Features
- **User-Friendly Interface:** Easy-to-use Gradio-powered web application.
- **Interactive Classification:** Real-time text input and predictions.
- **Extensibility:** Reusable `MentalHealthClassifier` model for integration into other projects.
## How It Works
1. The user provides a text input (e.g., thoughts or feelings).
2. The tool uses BM25 to retrieve similar examples from the training data.
3. GPT-4 analyzes the input and predicts the best-fitting mental health category.
## Prerequisites
- **Python 3.8+**
- OpenAI API Key (Get one from [OpenAI](https://platform.openai.com/signup/))
- Hugging Face Token (Optional, for dataset access)
## Installation
1. Clone the repository:
```bash
git clone https://github.com/your-username/mental-health-classifier.git
cd mental-health-classifier
|