dsuram/distilbert-mentalhealth-classifier
๐ง DistilBERT Mental Health Classifier
This model is a fine-tuned version of `distilbert-base-uncased` for mental health condition classification. It is trained on a custom dataset containing user statements labeled with categories such as depression, anxiety, PTSD, and more.
๐ง Use Case
This model is designed for:
Early detection of mental health symptoms in user conversations
Clinical research on NLP-based diagnostic support
AI assistants that provide empathetic triage or support
๐งช Performance
The model shows significant improvements after fine-tuning:
โ These results indicate that fine-tuning with a high-quality mental health dataset enables DistilBERT to make informed predictions from free-form user input.
๐ Dataset
The model was fine-tuned on FilteredCombinedData.csv, a curated dataset of 42,000+ statements labeled across multiple mental health categories. Each sample includes:
statement โ a natural language user message
label โ a mental health condition such as "Depression", "Anxiety", or "Healthy"
๐๏ธ Prompt Format (used during fine-tuning)
text Copy Edit
Instruction:
Classify the mental health condition in the following statement.
Input: {text}
Response: {label} This instruction format aligns the classifier with instruction-tuned language models.
๐ง Labels Covered
The model classifies input statements into the following mental health categories (example):
- Anxiety
- Depression
- PTSD
- OCD
- Bipolar Disorder
- ADHD
- Healthy
- Others (as labeled in dataset)
โ๏ธ Training Configuration
- Base Model:
distilbert-base-uncased - Epochs: 3
- Total Steps: ~36,500
- Batch Size: 16
- Max Length: 512
- Quantization: None
- Learning Rate: 2e-5
- Optimizer: AdamW
- Evaluation: Accuracy, Weighted F1
๐ Model Files
pytorch_model.binโ fine-tuned model weightstokenizer_config.json,vocab.txt, etc. โ tokenizer filesconfig.jsonโ architecture and label mappingREADME.mdโ this file
๐ License
This model is licensed under the MIT License โ free for personal, academic, and commercial use with attribution.
๐ Author
Developed by Dileep Reddy Suram ๐ For multimodal clinical AI assistant research and PhD preparation ๐ Hugging Face Profile
๐ Citation
If you use this model, please cite:
๐ฆ How to Use (Quick Start)
from transformers import pipeline
classifier = pipeline("text-classification", model="dsuram/distilbert-mentalhealth-classifier")
classifier("I feel anxious all the time and can't concentrate.")
---
๐งช Inference (Advanced)
You can also use the tokenizer + model directly:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
#### Load model and tokenizer
model = AutoModelForSequenceClassification.from_pretrained("dsuram/distilbert-mentalhealth-classifier")
tokenizer = AutoTokenizer.from_pretrained("dsuram/distilbert-mentalhealth-classifier")
# Input text
text = "I feel lost, hopeless, and don't see a way out."
# Tokenize and predict
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
outputs = model(**inputs)
logits = outputs.logits
predicted_class_id = torch.argmax(logits, dim=1).item()
# Map to label
label_map = model.config.id2label
print(f"Predicted label: {label_map[predicted_class_id]}")
---
