Views
No views yet
| Metric | Value |
|---|---|
| Accuracy | 83.51% |
| F1 macro | 0.8396 |
| F1 weighted | 0.8325 |
| Sui->Dep (missed crises) | 181 |
| Dep->Sui (false alarms) | 1075 |
| Total Dep<->Sui bleed | 1256 |
| Suicidal precision | 0.7064 |
text -> Stage 0 (Cardiff RoBERTa, DA gate, full V5)
-> Stage 1A (MentalBERT, Suicidal one-vs-all, full V5 minus DA)
-> Stage 1B (MentalBERT, Normal vs Distress, full V5)
-> Stage 2 (MentalBERT, 5-class distress, full V5)
-> Stage 3 (Longformer, Dep/Sui rescorer, full V5 Dep+Sui)WeightedRandomSampler. V1 stacked sampler-based 50/50 batch balancing
on top of asymmetric class weights — over-correction. V2 uses class weights alone.SUI_BOOST and DEP_SUI_BOOST: 3.0 -> 2.0. Modest safety bias instead of extreme.label_smoothing on Stages 1A and 3: 0.05 -> 0.10. Direct anti-overconfidence regularizer.cssrs=1.00, olid=1.00, kaggle_bpd=0.95, kaggle=0.70, huggingface=0.70, swmh=0.50.1import requests
2ENDPOINT_URL = "https://YOUR-ENDPOINT.endpoints.huggingface.cloud"
3HF_TOKEN = "hf_..."
4headers = {"Authorization": f"Bearer {HF_TOKEN}", "Content-Type": "application/json"}
5
6response = requests.post(
7 ENDPOINT_URL, headers=headers,
8 json={"inputs": "I have been stockpiling pills, just in case I decide it is time."}
9)
10print(response.json())1{
2 "label": "Suicidal",
3 "stage": "s1a",
4 "confidence": 0.87,
5 "scores": { "Suicidal": 0.87, "Other": 0.13 }
6}1{
2 "label": "Suicidal",
3 "stage": "s3",
4 "confidence": 0.74,
5 "rescored": true,
6 "scores": { "Suicidal": 0.74, "Depression": 0.26 }
7}inputs, get a list back.| Field | Type | Description |
|---|---|---|
label | string | One of the 8 classes |
stage | s0 / s1a / s1b / s2 / s3 | Which stage decided |
confidence | float (0-1) | Confidence in the chosen label |
scores | dict | Per-class softmax scores at the deciding stage |
rescored | bool (only when stage=s3) | Stage 3 Longformer overrode Stage 2's Depression call |
Anxiety, Bipolar, Depression, Directed Aggression, Normal, Personality Disorder, Stress, Suicidal.1from huggingface_hub import snapshot_download
2from pipeline import HierarchicalMentalHealthPipeline
3
4path = snapshot_download(repo_id="<YOUR_USERNAME>/mentalbert-v5-hierarchical-longformer")
5pipe = HierarchicalMentalHealthPipeline(path)
6result = pipe("I haven't slept in days, everything feels pointless")
7print(result)s1a and s3 confidence) for crisis-intervention escalation.config.json for full hyperparameters and per-stage validation F1s.