epfl-llm/guidelines
Viewer β’ Updated β’ 38k β’ 2.48k β’ 167
Official release of the Doc-Glasses BioClinical ModernBERT multi-task triage classifier and autoregressive question micro-decoder, optimized for heads-up-display (HUD) edge devices and sub-100ms emergency consultation triage.
thomas-sounack/BioClinical-ModernBERT-baseCARDIOVASCULAR, RESPIRATORY, GASTROINTESTINAL, NEUROLOGICAL, MUSCULOSKELETAL, DERMATOLOGIC, GENITOURINARY, ENDOCRINE_METABOLIC, PEDIATRIC, OBSTETRICS_GYNECOLOGY, PSYCHIATRIC, INFECTIOUS, HEMATOLOGY_ONCOLOGY, OPHTHALMICHIGH (Immediate resuscitation / Emergent), MED (Urgent), LOW (Routine / Non-urgent)import torch
from transformers import AutoTokenizer
from clinical_multihead_model import DocGlassesMultiHeadModel
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model_id = "thomas-sounack/BioClinical-ModernBERT-base"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = DocGlassesMultiHeadModel(
model_name=model_id,
num_urgency=3,
num_organs=14,
use_generative_question=True,
attn_implementation="sdpa"
).to(device)
# Load checkpoint from Hugging Face Hub
from huggingface_hub import hf_hub_download
ckpt_path = hf_hub_download(repo_id="Gowtham25/Doc-Glasses-BioClinical-ModernBERT", filename="doc_glasses_bioclinical_best.pt")
model.load_state_dict(torch.load(ckpt_path, map_location=device))
model.eval()
# Run real-time turn inference
dialogue = "Doctor: What happened? Patient: Sudden severe tearing pain in my back radiating between shoulder blades."
tokens = tokenizer(dialogue, return_tensors="pt").to(device)
with torch.no_grad():
out = model(tokens["input_ids"], attention_mask=tokens["attention_mask"])
organ_idx = out["organ_logits"].argmax(dim=-1).item()
urg_idx = out["urgency_logits"].argmax(dim=-1).item()
rf_idx = out["red_flag_logits"].argmax(dim=-1).item()
print("Organ:", organ_idx, "Urgency:", urg_idx, "Red Flag:", bool(rf_idx == 1))
| Benchmark Scenario | Organ Domain | Acuity | Red Flag | Latency | Pass $\le 100$ms |
|---|---|---|---|---|---|
| Gastroenteritis (6-turn) | GASTROINTESTINAL |
LOW |
False |
88 ms | PASS |
| Aortic Dissection | CARDIOVASCULAR |
HIGH |
True |
66 ms | PASS |
| Tension Pneumothorax | RESPIRATORY |
HIGH |
True |
59 ms | PASS |
| Diabetic Ketoacidosis | ENDOCRINE_METABOLIC |
HIGH |
True |
68 ms | PASS |
| Pediatric Intussusception | PEDIATRIC |
HIGH |
True |
77 ms | PASS |
| Acute Glaucoma | OPHTHALMIC |
HIGH |
True |
75 ms | PASS |
For full deployment and evaluation scripts, see G-Docglasses/clinical-pipeline-research.