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

Curated presets

Prepare DeBERTa-v3-Small NLI above to run live zero-shot inference.

Top Label —
Top Score —
Pipeline Latency —
Labels Scored —
NaN Count —
Backend wasm · q8

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.

Zero-Shot Candidate Probabilities

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

6 · How the API Works (Show the Code)

Inspect the exact off-main-thread Web Worker and pure NLI math helpers driving this page.

</> Show the code · worker.js pipeline + dynamic id2label + epoch guards
</> Show the code · nli-core.mjs pure Node-testable domain logic