token-classification Β· text Β· WASM Β· ~67 MB
General named-entity recognition knows people, places and organizations. This one knows medicine. It labels each span in clinical and biomedical text with one of 40+ domain entity types β a diseaseDisease disorder, a drugMedication, a lab valueLab value, a procedureDiagnostic procedure β that generic NER would miss entirely. Paste a case note and watch it light up. All on your device.
| Model | onnx-community/biomedical-ner-all-ONNX (ONNX of d4data/biomedical-ner-all) |
|---|---|
| Task / pipeline | token-classification |
| Labels | BIO tags over 43 biomedical entity types β Disease_disorder, Sign_symptom, Medication, Dosage, Diagnostic_procedure, Lab_value, Biological_structure, Severity, Age, Sex, Dateβ¦ (trained on the MACCROBAT clinical-case corpus) |
| Architecture | DistilBERT (6 layers, ~65M params) fine-tuned for biomedical NER |
| Quantization | q8 (8-bit) ONNX |
| Backend | WebAssembly (runs anywhere; no WebGPU needed) |
| Download | ~67 MB, cached after first load |
| License | Apache-2.0 |
| Web APIs | WebAssembly, Web Workers β all Baseline widely available |
Type or paste clinical / biomedical text. Entities are highlighted inline a moment after you stop typing; hover a highlight for its exact type and confidence.
The model doesn't see "myocardial infarction" as one thing β it tags each WordPiece token
independently: B-Disease_disorder (begin), I-Disease_disorder (inside),
and so on, across 43 types. We stitch consecutive B-/I- runs into whole entities. Below
are the raw per-token tags and confidences straight from the model, then the mix of entity
groups it found β a one-glance profile of what the text is about.
A generic NER model tells you a note mentions a person and a place. A biomedical one tells you the diagnosis, the drug, the dose, and the lab value β the structured clinical facts a downstream system can actually act on. Doing it in the browser means you can mine or de-identify clinical text without a single byte leaving the device β the difference between "possible" and "compliant" for regulated health data.
A research/education demo β not a medical device, and not for clinical decisions. Model output is probabilistic and will make mistakes; the confidence scores are shown for exactly that reason.
Paste clinical text and see 40+ biomedical entity types highlighted inline with confidences.
Extract a structured problem/medication/finding list, and de-identify Age/Sex/Date/person spans on-device.
Drugβevent radar: scan dense clinical text for a medication and an adverse sign co-occurring.
Tag the entities, then group near-duplicate mentions by meaning with MiniLM embeddings.
Token classification is one pipeline call β only the model id is domain-specific:
import { pipeline } from "@huggingface/transformers";
const ner = await pipeline("token-classification", "onnx-community/biomedical-ner-all-ONNX", { dtype: "q8" });
const out = await ner("started on aspirin 300mg for chest pain");
// β [{ entity: "B-Medication", word: "aspirin", score: 0.99, index: 3 },
// { entity: "B-Dosage", word: "300", score: 0.99, index: 4 },
// { entity: "I-Dosage", word: "##mg", score: 0.99, index: 5 },
// { entity: "B-Sign_symptom", word: "chest", score: 0.99, index: 7 },
// { entity: "I-Sign_symptom", word: "pain", score: 0.99, index: 8 }]
The pipeline returns one BIO-tagged row per WordPiece token, but no character offsets. We map each
token back to its span in the original text (a cursor-walk) so highlights land exactly, then merge
B-/I- runs (and ## sub-word pieces) into whole entities with a pooled
confidence. Because there are 43 fine-grained types, the UI colours them by eight clinically
meaningful groups (condition, anatomy, procedure, medication, measurement, temporal,
person, descriptor) while always showing the exact type. It all runs in a Web Worker so typing
stays smooth.