Views
No views yet
Calibrated, safety-aware mental health text classifier with abstention.
Post-hoc upgrade toitsLu/mentalbert-v5-source-aware— encoder weights are unchanged.
ABSTAIN rather than a low-confidence guess.SourceAwareMentalBERT (frozen):
bert: mental/mental-bert-base-uncased
cls_head: nn.Linear(768, 8) ← loaded from itsLu/mentalbert-v5-source-aware
Post-hoc stack (this repo):
Per-class temperature T ∈ ℝ⁸ ← calibration.pt
Asymmetric safety margin ← decision_thresholds.json
Abstention threshold ← decision_thresholds.jsonmohamedasem318/mental-health-dataset-extended-v5random_state=42).| Run | Coverage | Acc (covered) | F1 Macro | Sui→Dep | Dep→Sui | Total Bleed |
|---|---|---|---|---|---|---|
| v1 (deployed) | 100.0% | 83.23% | 0.8381 | 544 | 715 | 1,259 |
| v2 (this) | 89.8% | 87.48% | 0.8763 | 354 | 553 | 907 |
1from huggingface_hub import hf_hub_download
2import runpy, sys
3
4# Download inference.py and run it in your environment
5path = hf_hub_download(repo_id='itsLu/mentalbert-v5-quick-vibe-v2', filename='inference.py')
6
7# Or: import directly once the file is on your path
8# from inference import predict
9# result = predict("I feel hopeless and empty.")
10# print(result)
11# {
12# 'label': 'Depression',
13# 'confidence': 0.72,
14# 'all_probs': {...},
15# # 'abstained': False, 'safety_flipped': False
16# }| File | Description |
|---|---|
calibration.pt | Per-class temperature tensors |
decision_thresholds.json | abstain_thresh, dep_sui_margin, metrics |
inference.py | Self-contained load + predict script |
1@misc{mentalbert-quickvibe-v2,
2 author = {Mohamed Asem},
3 title = {MentalBERT Quick Vibe v2: Calibrated Safety-Aware Mental Health Classifier},
4 year = {2025},
5 url = {https://huggingface.co/itsLu/mentalbert-v5-quick-vibe-v2}
6}