At a glance
| Model | onnx-community/gliner_small-v2.1 (GLiNER small v2.1) — a single deberta-v3-small span encoder |
|---|---|
| Task | token-classification (zero-shot / open-vocabulary NER) — run via raw ONNX Runtime Web (see note below) |
| Runtime | onnxruntime-web 1.21 (transformers.js has no GLiNER pipeline) + a transformers.js tokenizer |
| Input | text + a list of entity types, encoded as <<ENT>> type … <<SEP>> words with span indices |
| Output | a relevance score per (word-span × type); sigmoid + greedy non-overlapping (or nested) selection → tagged spans |
| Quantization | q8 (model_quantized.onnx) — runs on the plain WASM backend, no WebGPU needed |
| Download | ~183 MB, cached after first load (auto-inits on return) |
| License | Apache-2.0 (GLiNER) — the weights stay Apache-2.0 wherever converted |
| Web APIs | WebAssembly, Web Workers — all Baseline widely available |
Extract
Why raw ONNX Runtime Web?
transformers.js has no GLiNER pipeline, so we run the ONNX graph directly with onnxruntime-web and
tokenize with a transformers.js tokenizer. The preprocessing and span decoding faithfully reimplement
the MIT-licensed gliner
library — build the <<ENT>>…<<SEP>> prompt, enumerate candidate
spans, score each against each type, then greedily keep the highest-scoring non-overlapping ones. It
was proven correct against known sentences before shipping. Everything runs on your device.
Use-case ladder
Basics · Custom Entity Schema & Span-Score Inspector
Define arbitrary entity types with chips and custom input, scrub the confidence threshold (0.15–0.90) and switch Flat vs Nested span resolution live without losing raw detections, and inspect the exact ONNX span code.
Practical · Unstructured Document-to-JSON Record Extractor
Paste resumes, invoices, clinical notes, or support tickets (or load a local .txt/.md file), run chunked multi-paragraph GLiNER extraction, filter extracted fields, and export structured .json or .csv.
Wild · Live Concept-Graph & Entity Constellation
Turn any article or biography into a live high-DPI Canvas 2D force-directed knowledge graph wired to sentence co-occurrence — click or keyboard-select any entity to highlight every sentence mentioning it.
Multi-model · Aspect-Based Entity Sentiment Studio (GLiNER → DistilBERT SST-2)
Chain GLiNER Small v2.1 (~183 MB) with DistilBERT SST-2 (~67 MB) in isolated Web Workers to discover custom entities and score POSITIVE / NEGATIVE sentiment per mentioning sentence.