Downloads · 30 days
78
12% of all-time downloads
SajjadIslam/multiMentalRoBERTA-6-class
multiMentalRoBERTA-6-class is a text classification model from SajjadIslam. Use it when you need a label for a piece of text. The card lists the license as apache-2.0.
multiMentalRoBERTa 6 class extends the label space with a stress category: Stress, Anxiety, Depression, PTSD, Suicidal, None. Stress is intentionally broad and overlaps with several conditions. In controlled study thi…
Downloads · 30 days
78
12% of all-time downloads
All-time downloads
641
Public
Parameters
355M
1.4 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors1.4 GB · 100%
From the Hugging Face model README
multiMentalRoBERTa 6 class extends the label space with a stress category: Stress, Anxiety, Depression, PTSD, Suicidal, None. Stress is intentionally broad and overlaps with several conditions. In controlled study this setting reached macro F1 of 0.839 with macro recall of 0.843
This model is not a medical device and must not be used for diagnosis or crisis determination without qualified human oversight.
Read the mapping from the saved config.
from transformers import AutoConfig
cfg = AutoConfig.from_pretrained("SajjadIslam/multiMentalRoBERTA-6-class")
print(cfg.id2label)
Data combines curated Reddit corpora and stress resources, with neutral text for contrast. (More details on the paper)
Macro F1: 0.839, Macro Recall: 0.843, Accuracy: 0.879
Stress achieves strong precision and recall but pulls borderline anxiety and PTSD instances
Depression and Suicidal remain closely linked and require human confirmation in safety workflows
from transformers import pipeline
clf = pipeline("text-classification", model="SajjadIslam/multiMentalRoBERTA-6-class", top_k=None, truncation=True)
print(clf("I cannot stop panicking and my heart races at night"))
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
MAX_LENGTH = 512
repo = "SajjadIslam/multiMentalRoBERTA-6-class"
tok = AutoTokenizer.from_pretrained(repo, use_fast=True)
mdl = AutoModelForSequenceClassification.from_pretrained(repo).to(DEVICE).eval()
id2label = {int(k): v for k, v in mdl.config.id2label.items()}
def classify_6(text: str):
enc = tok(text, truncation=True, padding="max_length", max_length=MAX_LENGTH, return_tensors="pt").to(DEVICE)
logits = mdl(**enc).logits
probs = torch.softmax(logits, dim=-1)[0].cpu().numpy()
pid = int(torch.argmax(logits, dim=-1).item())
return {
"predicted_class": id2label[pid],
"confidence": float(probs[pid]),
"probabilities": {id2label[i]: float(probs[i]) for i in range(len(probs))}
}
Use with human review and escalation pathways. Document decision policies, monitor drift, and avoid deployment in settings that could result in harm without professional support. Summary findings and safety notes are discussed in the paper.
If you use this model, please cite:
@inproceedings{islam2025multimentalroberta,
title={multiMentalRoBERTa: A Fine-tuned Multiclass Classifier for Mental Health Disorder},
author={Islam, KM Sajjadul and Fields, John and Madiraju, Praveen},
booktitle={2025 IEEE International Conference on Big Data (BigData)},
pages={3255--3264},
year={2025},
organization={IEEE}
}