zero-shot-classification · text · WASM q8 · 172.44 MB · Apache-2.0
DeBERTa-v3-Small NLI
Classify any text against labels you invent on the fly — zero training, zero servers. Microsoft’s 6-layer DeBERTa-v3-Small cross-encoder fine-tuned on MNLI & SNLI scores entailment, neutral, and contradiction locally in WebAssembly (~70–130 ms per pair, ~350 ms for 5 labels).
1 · Load DeBERTa-v3-Small NLI (172.44 MB q8 WASM)
2 · Interactive Zero-Shot Classifier & Premise-Hypothesis Lab
Prepare DeBERTa-v3-Small NLI above to run live zero-shot inference.
3 · See Inside: Zero-Shot Scores & Raw 3-Way NLI Premise-Hypothesis Logits
Zero-shot classification works by converting every candidate label into a natural-language
hypothesis via hypothesis_template and asking DeBERTa-v3 whether the input
premise entails or contradicts it. Below, the right-hand table reads
pipe.model.config.id2label dynamically (0: contradiction,
1: entailment, 2: neutral) — never assuming label index order.
Raw 3-Way NLI Probabilities (Entail · Neutral · Contradict)
| Candidate Label | Generated Hypothesis | Zero-Shot | Entail | Neutral | Contradict | NLI Verdict |
|---|---|---|---|---|---|---|
| Run inference to inspect exact per-hypothesis NLI distributions. | ||||||
4 · Why DeBERTa-v3-Small Matters
Zero-Training Triage
Ship ticket routing, moderation, or document tagging on day one — add or rename tags in JSON without collecting labeled training sets or fine-tuning a classifier.
True Cross-Attention
Unlike bi-encoder embeddings, DeBERTa-v3’s disentangled relative attention attends across premise and hypothesis tokens jointly, catching negation flips and role swaps.
Private & Cost-Free at Scale
Runs locally in WebAssembly at ~70–130 ms per hypothesis pair (~350 ms for 5 labels) with Apache-2.0 weights — sensitive GDPR records, support CSVs, and compliance clauses never leave the browser tab.
5 · At a Glance & Use-Case Ladder
| Upstream model |
cross-encoder/nli-deberta-v3-small
|
|---|---|
| Browser ONNX repo |
Xenova/nli-deberta-v3-small
|
| Pipeline task | zero-shot-classification (NLI cross-encoder: entailment / contradiction / neutral) |
| Architecture | DebertaV2ForSequenceClassification · 6 layers · 12 heads · 768 hidden · 128,100 vocab · 512 max tokens |
| Runtime & Backend | @huggingface/transformers@3.7.5 · CPU WASM (no WebGPU required) |
| Quantisation & Size | q8 · 172.44 MB (onnx/model_quantized.onnx + 8.66 MB tokenizer.json) |
Dynamic id2label |
0: contradiction · 1: entailment · 2: neutral (verified live from config) |
| License | Apache-2.0 |
Compare single-label softmax against multi-label sigmoid side by side and probe how 3 hypothesis templates shift scores.
Practical · CSV / Support-Queue Bulk Auto-Tagger →Paste or upload multi-row queues, set a confidence threshold routing low-confidence rows to Needs Human Review, and export formula-safe CSV/JSON.
Wild · Fact-Checking & Contradiction Stress-Tester →Duel DeBERTa-v3 on negation flips, numerical contradictions, paraphrases, and entity swaps with an interactive robustness scorecard.
Multi-model · MiniLM 24-Tag Shortlist → DeBERTa NLI →Embed a 24-category taxonomy with all-MiniLM-L6-v2 (~20 ms) to shortlist Top-5, then verify with DeBERTa-v3 NLI (4.8× faster than 24 NLI passes).
6 · How the API Works (Show the Code)
Inspect the exact off-main-thread Web Worker and pure NLI math helpers driving this page.