Downloads · 30 days
11
18% of all-time downloads
itsLu/mentalbert-v5-flat-8class
mentalbert-v5-flat-8class is a text classification model from itsLu. Use it when you need a label for a piece of text. The card lists the license as apache-2.0.
Single-pass MentalBERT fine-tuned on the V5 mental-health dataset. Predicts one of 8 classes:
Downloads · 30 days
11
18% of all-time downloads
All-time downloads
62
Public
Parameters
109M
438 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors438 MB · 100%
From the Hugging Face model README
Single-pass MentalBERT fine-tuned on the V5 mental-health dataset. Predicts one of 8 classes:
Anxiety, Bipolar, Depression, Directed Aggression, Normal, Personality Disorder, Stress, Suicidal.
| Metric | Value |
|---|---|
| Accuracy | 82.84% |
| F1 macro | 0.8350 |
| F1 weighted | 0.8280 |
| Sui→Dep (missed crises) | 516 |
| Total Dep↔Sui bleed | 1249 |
| ROC AUC (macro) | 0.9638 |
from transformers import pipeline
clf = pipeline("text-classification", model="<YOUR_USERNAME>/mentalbert-v5-flat-8class")
result = clf("I haven't slept in days, I feel like everything is falling apart.")
print(result) # [{'label': 'Stress', 'score': 0.87}]
import requests
HF_TOKEN = "hf_..."
URL = "https://api-inference.huggingface.co/models/<YOUR_USERNAME>/mentalbert-v5-flat-8class"
headers = {"Authorization": f"Bearer {HF_TOKEN}"}
r = requests.post(URL, headers=headers, json={"inputs": "I want to end it all."})
print(r.json()) # [{'label': 'Suicidal', 'score': 0.91}, ...]
For top-k probabilities over all classes, pass {"inputs": text, "parameters": {"top_k": 8}}.
mentalbert-v5-hierarchical-longformer) for safety-critical applications.mental/mental-bert-base-uncasedWeightedRandomSampler + class-weighted CrossEntropy (cap=3.0)