Downloads ยท 30 days
14
10% of all-time downloads
maitry30/mindsense-bert
mindsense-bert is a text classification model from maitry30. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
Downloads ยท 30 days
14
10% of all-time downloads
All-time downloads
146
Public
Parameters
109M
438 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors438 MB ยท 100%
From the Hugging Face model README
MindSense-BERT is a fine-tuned BERT-based model designed to classify text into 7 mental health categories using real-world Reddit data. It combines state-of-the-art NLP, class imbalance handling, and explainable AI (SHAP) to create a transparent and practical mental health analysis system.
Model Type: Transformer (BERT)
Base Model: bert-base-uncased
Task: Multi-class Text Classification
Classes (7):
Framework: PyTorch + Hugging Face Transformers
Deployment: Streamlit + Hugging Face Hub
Mental health conditions affect 1 in 4 people globally, but early detection is difficult due to stigma and lack of awareness.
This model aims to:
statement (text)status (mental health category)bert-base-uncased1e-516Weak classes identified: Stress, Personality Disorder
Techniques used:
Applied custom class weights
| Model | Accuracy |
|---|---|
| Logistic Regression | ~78% |
| Random Forest | ~74% |
| SVM | ~82% |
| BERT (initial) | ~83% |
| BERT (final) | ~87โ89% |
| Category | F1 Score |
|---|---|
| Normal | 0.91 |
| Depression | 0.89 |
| Anxiety | 0.86 |
| Bipolar | 0.84 |
| PTSD | 0.87 |
| Stress | 0.82 |
| Personality Disorder | 0.80 |
This model integrates SHAP (SHapley Additive Explanations) for transparency:
This improves trust and interpretability โ critical in healthcare AI.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model_name = "maitry30/mindsense-bert"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
text = "I feel completely hopeless and empty."
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
outputs = model(**inputs)
prediction = torch.argmax(outputs.logits, dim=1).item()
print(prediction)
| Input Text | Predicted Class |
|---|---|
| "I feel hopeless and empty" | Depression |
| "I keep having nightmares" | PTSD |
| "My mood swings a lot" | Bipolar |
| "I feel fine today" | Normal |
Maitry
MIT License
โญ If you found this model useful, consider giving the project a star!