zero-shot-classification · text · multilingual · WASM q8 · 355.0 MB · MIT

mDeBERTa-v3 Multilingual NLI (2.7M Pairs)

Classify text in 100 languages against categories you invent at run time — even cross-lingually (Japanese, Arabic, Hindi, or German text scored against English labels). Fine-tuned from microsoft/mdeberta-v3-base on XNLI plus 2.73M multilingual NLI pairs across 27 languages, running completely offline in a Web Worker.

At a glance

Model (ONNX) Xenova/mDeBERTa-v3-base-xnli-multilingual-nli-2mil7 (upstream: MoritzLaurer/mDeBERTa-v3-base-xnli-multilingual-nli-2mil7)
Task / pipeline zero-shot-classification (multilingual NLI)
Backbone & NLI head microsoft/mdeberta-v3-base (deberta-v2, 12 layers · 12 heads · 768 hidden · disentangled relative attention) · 251,000 SentencePiece vocab · max_position_embeddings: 512 · id2label: {0: entailment, 1: neutral, 2: contradiction}
Training corpus CC100 (100 languages) pretraining + XNLI, multilingual-NLI-26lang-2mil7 (2.73M pairs across 26 non-English languages), MultiNLI, ANLI, FEVER, LingNLI, WANLI
Quantization & size q8 (onnx/model_quantized.onnx 338,679,132 B = 338.68 MB + tokenizer.json 16,316,151 B = 16.32 MB + configs 1,553 B = 355.0 MB first-visit total)
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 — 100-Language Zero-Shot Classifier

Initialise mDeBERTa-v3 Multilingual NLI above to classify text locally on your device.

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

See inside — 3-way NLI logits & 251k SentencePiece pieces

Each candidate label forms a premise-hypothesis pair scored across id2label = {0: entailment, 1: neutral, 2: contradiction}. Below are the exact 3-way probabilities, raw logits, and the SentencePiece subwords emitted by the 251,000-token multilingual vocabulary.

SentencePiece tokens appear after running classification.
Per-label entailment, neutral, and contradiction probabilities and raw logits
Candidate label Entailment (prob / logit) Neutral (prob / logit) Contradiction (prob / logit) 3-way split Pair tokens
Run classification above to inspect raw 3-way NLI logits.

Why it matters

Compared to English-only NLI checkpoints or older MNLI+XNLI runs, mDeBERTa-v3-base-xnli-multilingual-nli-2mil7 adds 2.73 million multilingual NLI pairs across 26 non-English languages (Arabic, Chinese, Hindi, Japanese, Korean, Russian, Spanish, German, French, Turkish, Swahili, and more). One 355 MB browser cache replaces dozens of per-market classifiers.

Use-case ladder

How the API works

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

const classifier = await pipeline(
  "zero-shot-classification",
  "Xenova/mDeBERTa-v3-base-xnli-multilingual-nli-2mil7",
  { device: "wasm", dtype: "q8" },
);

const out = await classifier(
  "新しいソフトウェアのアップデート後、決済ページが読み込めなくなりました。",
  ["technical software bug", "checkout & payment issue", "positive product review"],
  { hypothesis_template: "This text is about {}.", multi_label: true },
);
// → { labels: [...], scores: [...] }

Inspect the worker & NLI math

Show the code · worker.js — runClassification()
Show the code · mdeberta-core.mjs — scoreFromNliLogits()

References