Views
No views yet
itsLu/mentalbert-v6-flat.text → Stage 0 (Cardiff RoBERTa, DA binary)
↓
Stage 1A (MentalBERT, Suicidal binary)
↓
Stage 1B (MentalBERT, Normal vs Distress)
↓
Stage 2 (MentalBERT, 5-class Anxiety/Bipolar/Dep/PD/Stress)
↓
Stage 3 (Longformer, Depression vs Suicidal re-scorer)F1_macro − 0.30·Sui_miss_rate − 0.30·Sui_FP_rate.Sui→Dep ≤ 150 on val, then minimises Dep→Sui.1import requests
2r = requests.post(ENDPOINT_URL,
3 headers={"Authorization": f"Bearer {HF_TOKEN}"},
4 json={"inputs": "I don't see the point anymore.", "mode": "safety"})
5print(r.json())
6# -> {"label": "Suicidal", "exit_stage": "stage1a", "mode": "safety",
7# "stage_probs": {...}}mode is "balanced" (default) or "safety".stage0/ — Cardiff RoBERTa, DA gatestage1a/ — MentalBERT, Suicidal gatestage1b/ — MentalBERT, Normal/Distressstage2/ — MentalBERT, 5-class distressstage3/ — Longformer, Dep/Sui re-scorerconfig.json — thresholds, class order, metricshandler.py — HF Inference Endpoints handler with mode switchingmohamedasem318/mental-health-dataset-extended-v6 — ~89k rows from 7 sources
(cssrs, jigsaw17, civil_comments, kaggle_bpd, kaggle, huggingface, swmh). V6 replaces V5's OLID-sourced Directed Aggression class with Jigsaw 2017 + Civil Comments threat-labelled data — the change targets real-world detection of explicit violent intent (e.g., "I want to kill my friend"), which OLID's Twitter-insult distribution did not cover. Stratified 70/10/20 split,
random_state=42. Per-source reliability constants are recorded in config.json
but were not applied to the loss (plain class-weighted CE only — a prior
attempt with a per-sample-weighted wrapper destabilised Stage 0 training under
fp16/AMP).