token-classification · biomedical NER · WASM q8 · 336.51 MB · apache-2.0

OpenMed DiseaseDetect BioMed 335M — in-browser disease entity extraction

A 24-layer BERT-Large encoder (BertForTokenClassification) fine-tuned on the BC5CDR-Disease corpus to tag B-DISEASE, I-DISEASE, and O across clinical notes and PubMed abstracts — running locally on your device in WebAssembly with live BIO span merging and raw 3-class logit inspection.

Research & Synthetic Data Notice: For biomedical research and education only — not a medical device and not for clinical diagnosis. Built-in EHR examples are 100% synthetic; uploaded text never leaves your browser tab.

At a glance

Model identity, architecture, exact byte sizes, and runtime details
Upstream model OpenMed/OpenMed-NER-DiseaseDetect-BioMed-335M
Browser ONNX build onnx-community/OpenMed-NER-DiseaseDetect-BioMed-335M-ONNX · onnx/model_quantized.onnx
Task / pipeline token-classification with { ignore_labels: [] } · id2label: {"0":"O","1":"B-DISEASE","2":"I-DISEASE"}
Architecture BertForTokenClassification (24 layers · 16 heads · 1024 hidden · 4096 FFN · max_position_embeddings: 512)
Tokenizer & vocab BertTokenizer (do_lower_case: true) · config.json vocab_size: 30,522 · tokenizer.json 28,895 WordPiece tokens
BC5CDR_DISEASE card eval F1 0.9005 · Precision 0.8887 · Recall 0.9126 · Accuracy 0.9838 (1,500 PubMed abstracts, 5,818 entities)
Quantization & exact bytes q8 · 336.51 MB (335,827,631 B ONNX + 679,168 B tokenizer.json + 2,988 B configs = 336,509,787 B)
Runtime & backend Shared @huggingface/transformers@3.7.5 via ../../lib/webai.js on WebAssembly (wasm) in a module Web Worker
License apache-2.0

Interactive disease entity extraction lab

Prepare the model above to extract disease spans.

Backend · dtype–
Latency–
WordPiece tokens–
Disease spans–
BIO tags (B / I)–
NaN count–

Extracted DISEASE spans

Run extraction to highlight detected disease mentions.

See inside: WordPiece BIO tags & raw 3-class logits

The 24-layer uncased BERT-Large head outputs three logits per WordPiece token: O, B-DISEASE, and I-DISEASE. Inspecting both the merged WordPiece strip and the raw per-token logit/probability table reveals how subword continuations (##) assemble into complete disease spans.

Per-token WordPiece BIO predictions, softmax probabilities, and raw 3-class logits
# WordPiece BIO Tag Top Score O prob (logit) B-DISEASE prob (logit) I-DISEASE prob (logit)
Run extraction to inspect per-token probabilities and logits.

Why it matters

Running a 335M biomedical disease extractor directly inside the visitor's browser unlocks private literature curation, pharmacovigilance screening, and pre-ingestion EHR tagging without transmitting clinical text over the network.

Use-case ladder

How it works

Show the code — off-main-thread BIO inference, raw logits, and 512-token truncation check
Show the code — BIO span merging, orphan-I repair, and confidence thresholding
Show the code — CSS Custom Highlight API term focus with TreeWalker

References