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

DeBERTa-v3-XSmall Zero-Shot (33 Datasets)

Classify any ticket, review, alert, or policy clause against custom English labels on your device — built specifically for edge and in-browser transformers.js with a fast 22M-parameter backbone trained across 33 NLI & classification datasets.

At a glance

Model (HF & ONNX) MoritzLaurer/deberta-v3-xsmall-zeroshot-v1.1-all-33 (base: microsoft/deberta-v3-xsmall)
Task / pipeline zero-shot-classification (2-class NLI cross-encoder)
Backbone & NLI head deberta-v2 (DebertaV2ForSequenceClassification) · 12 layers · 384 hidden · 6 heads · 22M backbone + 128M vocab params · id2label: {0: "entailment", 1: "not_entailment"}
Tokenizer & context DebertaV2Tokenizer (SentencePiece vocab_type: "spm", 128,100 vocab, [CLS]/[SEP], model_max_length: 512)
Quantization & size q8 (onnx/model_quantized.onnx 87,246,195 B + tokenizer.json 8,656,646 B + configs 1,597 B = 95,904,438 B / 95.9 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 — 2-Class Zero-Shot Classifier

Initialise DeBERTa-v3-XSmall Zero-Shot above to classify text locally on your device.

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

See inside — raw 2-class entailment vs not_entailment logits

Unlike 3-class MNLI models (entailment / neutral / contradiction), MoritzLaurer/deberta-v3-xsmall-zeroshot-v1.1-all-33 collapses neutral and contradiction into a single binary id2label = {0: "entailment", 1: "not_entailment"} head. Transformers.js ZeroShotClassificationPipeline maps entailment_id = 0 and contradiction_id = 1 via label2id['not_entailment'] automatically.

Per-label entailment and not_entailment probabilities, raw logits, and logit margins
Candidate label Entailment (prob / logit) Not-entailment (prob / logit) Logit Δ 2-class split Pair tokens
Run classification above to inspect raw 2-class NLI logits.

Why it matters

Full-size NLI cross-encoders often exceed 170–350 MB. By pairing DeBERTa-v3-xsmall's 22M-parameter disentangled-attention backbone with 33 diverse zero-shot training datasets and a binary entailment head, this 95.9 MB q8 package delivers fast edge classification with zero retraining.

Use-case ladder

How the API works & source inspection

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

const classifier = await pipeline(
  "zero-shot-classification",
  "MoritzLaurer/deberta-v3-xsmall-zeroshot-v1.1-all-33",
  { device: "wasm", dtype: "q8" },
);

const out = await classifier(
  "My annual invoice charged twice after downgrading on Tuesday.",
  ["billing dispute", "shipping delay", "bug report"],
  { hypothesis_template: "This customer support message is about {}.", multi_label: false },
);
Show the code · worker.js — runClassification() (dynamic 2-class id2label pass)
Show the code · deberta-zs-core.mjs — scoreFromBinaryNliLogits() (exact single- & multi-label math)
Show the code · deberta-zs.js — wireFileAndDrop() (full-hitbox upload & capture-phase drop)

References