natural-language inference · text · WASM · ~91 MB
The built zero-shot classifiers use an NLI model to pin a label on a text. This demo exposes the reasoning itself: give it a premise and a hypothesis, and it decides whether the hypothesis follows from, contradicts, or is neutral to the premise. It's the atomic step behind fact-checking and RAG grounding — does this evidence support the claim? Runs entirely on your device.
| Model | nli-deberta-v3-xsmall — a cross-encoder NLI model (deberta-v3-xsmall) |
|---|---|
| Task | text-classification over a sentence PAIR (natural-language inference) |
| Runtime | transformers.js — tokenized as a pair (tokenizer(premise, { text_pair: hypothesis })), run low-level (the pipeline ignores the pair) |
| Input | a premise sentence + a hypothesis sentence |
| Output | a probability over entailment / neutral / contradiction (softmax of the logits) |
| Quantization | q8 (model_quantized.onnx) — runs on the plain WASM backend, no WebGPU needed |
| Download | ~91 MB, cached after first load (auto-inits on return) |
| License | Apache-2.0 (base cross-encoder/nli-deberta-v3-xsmall, a fine-tune of Apache-2.0 deberta-v3-xsmall) |
| Web APIs | WebAssembly, Web Workers — all Baseline widely available |
A zero-shot classifier runs an NLI model with a fixed hypothesis template ("This example is {label}") to score labels. Here the hypothesis is a free sentence, so you see the raw three-way relationship — the same signal used to check whether a retrieved passage supports a generated answer, or whether two statements contradict. It's a cross-encoder: premise and hypothesis are read together, so subtle disagreements are caught. Everything runs on your device.