zero-shot-classification · text · WASM q8 · 252.95 MB · MIT

DeBERTa-v3-Base MNLI · FEVER · ANLI

A 12-layer, 768-hidden 3-class Natural Language Inference (entailment / neutral / contradiction) cross-encoder trained on 763,913 pairs from MultiNLI, FEVER-NLI, and Adversarial NLI — running zero-shot classification and fact verification locally in WebAssembly.

At a glance

Upstream & ONNX MoritzLaurer/DeBERTa-v3-base-mnli-fever-anli · ONNX: Xenova/DeBERTa-v3-base-mnli-fever-anli (base: microsoft/deberta-v3-base)
Task / pipeline zero-shot-classification (3-class NLI cross-encoder)
Backbone & NLI head deberta-v2 (DebertaV2ForSequenceClassification) · 12 layers · 768 hidden · 12 heads · 3072 intermediate · id2label: {"0":"entailment","1":"neutral","2":"contradiction"}
Tokenizer & context DebertaV2Tokenizer (SentencePiece vocab_type: "spm", vocab_size: 128,100, [CLS]/[SEP], model_max_length: 512)
Training & eval 763,913 pairs across MultiNLI + FEVER-NLI + ANLI · card accuracy: MNLI-m 0.903, FEVER-NLI 0.777, ANLI-all 0.579, ANLI-r3 0.495
Quantization & size q8 (onnx/model_quantized.onnx 244,291,931 B + tokenizer.json 8,656,551 B + configs 1,605 B = 252,950,087 B / 252.95 MB)
Runtime & backend Shared @huggingface/transformers@3.7.5 on WebAssembly (wasm) in a dedicated module Web Worker
License MIT
Web APIs WebAssembly, Web Workers, Cache Storage, File & Clipboard APIs

Run it — 3-Class Zero-Shot Classifier

Initialise DeBERTa-v3-Base MNLI/FEVER/ANLI above to classify text locally on your device.

Backend / dtype–
Latency–
Premise tokens–
Entropy–
NaN count–
Parity max |Δ|–

See inside — raw 3-class entailment, neutral & contradiction logits

Xenova/DeBERTa-v3-base-mnli-fever-anli outputs a 3-element logit vector ordered by id2label = {0: "entailment", 1: "neutral", 2: "contradiction"}. In single-label mode, ZeroShotClassificationPipeline runs softmax() over entailment logits across labels; in multi-label mode it runs softmax([contradiction, entailment])[1] independently per label while preserving the full 3-way distribution below.

Per-label 3-class entailment, neutral, and contradiction probabilities, raw logits, and entailment-vs-contradiction margins
Candidate label Entailment [0] Neutral [1] Contradiction [2] E − C Δ 3-class split Pair tokens
Run classification above to inspect raw 3-class NLI logits.

Why it matters

Training on MNLI (multi-genre entailment), FEVER-NLI (Wikipedia claim verification), and ANLI (adversarial multi-round deduction) gives this 12-layer DeBERTa-v3-base checkpoint strong sensitivity to contradiction, negation, and unstated neutral claims without any fine-tuning.

Use-case ladder

How the API works & source inspection

import { pipeline } from "@huggingface/transformers";

const classifier = await pipeline(
  "zero-shot-classification",
  "Xenova/DeBERTa-v3-base-mnli-fever-anli",
  { device: "wasm", dtype: "q8" },
);

const out = await classifier(
  "Angela Merkel served as Chancellor of Germany and led the CDU.",
  ["politics", "economy", "entertainment", "environment"],
  { hypothesis_template: "This text is about {}.", multi_label: false },
);
Show the code · worker.js — runClassification() (dynamic 3-class id2label pass)
Show the code · deberta-base-nli-core.mjs — scoreFromTriClassNliLogits() (3-class NLI & pipeline math)
Show the code · deberta-base-nli.js — wireFileAndDrop() (full-hitbox upload & capture-phase drop)

References