-
Model Type: Transformer (BERT)
-
Base Model: bert-base-uncased
-
Task: Multi-class Text Classification
-
Classes (7):
- Normal
- Depression
- Anxiety
- Bipolar
- PTSD
- Stress
- Personality Disorder
-
Framework: PyTorch + Hugging Face Transformers
-
Deployment: Streamlit + Hugging Face Hub
-
Weak classes identified: Stress, Personality Disorder
-
Techniques used:
- Word swap
- Random deletion
- Key phrase duplication
-
Applied custom class weights
This improves trust and interpretability — critical in healthcare AI.
1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3
4model_name = "maitry30/mindsense-bert"
5
6tokenizer = AutoTokenizer.from_pretrained(model_name)
7model = AutoModelForSequenceClassification.from_pretrained(model_name)
8
9text = "I feel completely hopeless and empty."
10
11inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
12outputs = model(**inputs)
13
14prediction = torch.argmax(outputs.logits, dim=1).item()
15print(prediction)