feature-extraction · biomedical entity linking · 110.79 MB WASM q8 · Apache-2.0

SapBERT-from-PubMedBERT-fulltext — 768-d UMLS Entity Linker

A 109.5M-parameter, 12-layer PubMedBERT encoder self-aligned on 4M+ UMLS 2020AA biomedical concepts so medical synonyms (myocardial infarction ↔ heart attack, Glucophage ↔ metformin) converge in 768-d [CLS] vector space in 110.79 MB (q8 CPU WASM via shared ../../lib/webai.js on @huggingface/transformers@3.7.5).

Model Card & Runtime Contract

Task & Pooling
feature-extraction · pooling: "cls" · normalize: true
Backend & Quant
WASM · q8 (110.08 MB ONNX + 0.71 MB tok/cfg = 110.79 MB)
Architecture
bert (12L · 12H · 768-d · 3,072 FFN · 109.5M params · 30,522 lowercase WordPiece)
Seq Window & License
512 max_pos (25 card entity window) · Apache-2.0
[CLS] Self-Alignment Contract (NOT Mean Pooling): Per the upstream cambridgeltl/SapBERT-from-PubMedBERT-fulltext card, SapBERT takes the [CLS] token embedding of the last hidden layer (model(**toks)[0][:,0,:]) with PubMedBERT fulltext lowercase WordPiece ([PAD]=0, [UNK]=1, [CLS]=2, [SEP]=3, [MASK]=4).

Load & Cache Status

Live Biomedical Synonym Linker & Similarity Matrix

Drop, paste, or upload a .txt, .md, .csv, or .json list of biomedical terms.

Ranked Biomedical Similarity

Load the model to embed and rank all entity candidates locally.

    2D PCA UMLS Semantic Constellation

    Diamond marks the query mention; dashed rays connect top-3 closest UMLS matches.

    See Inside the Model (768-d [CLS] Tensor & PubMedBERT WordPiece)

    768-d [CLS] Sparkline & Distribution

    Run inference to inspect live 768-d coordinate min, max, mean, std, and L2 norm.

    Pairwise Cosine Heatmap (All Terms)

    Live PubMedBERT Fulltext WordPiece Inspection

    Inspects real PubMedBERT uncased IDs ([PAD]=0, [UNK]=1, [CLS]=2, [SEP]=3, [MASK]=4) and ## subword roots.

    Per-term PubMedBERT WordPiece count, subword count, [UNK] count, L2 norm, and cosine
    ID Tokens ## Subwords [UNK] Window Norm Cosine
    Awaiting live inference…

    Why It Matters

    Show the Code (Exact Worker & [CLS] Pooling Pipeline)

    Show the code: Off-main-thread feature-extraction + [CLS] pooling (worker.js)
    Show the code: FIFO SapBertEngine lifecycle & dispose client (sapbert-client.js)