CoolFace
Modelpublic

Horizon-Labs/multilingual-zeroshot-base

sourceHugging Faceapache-2.0updated 2h agoView on Hugging Face
0likes
Model Card

Multilingual Zero-Shot Classifier (base, 308M)

Classify text in 30+ languages into any labels you choose, with no training. Use it with the transformers zero-shot-classification pipeline, like facebook/bart-large-mnli, but multilingual, smaller, and with an 8k-token context window (fine-tuned at up to 1,024 tokens).

  • —Multilingual: the text can be in any of the languages below; labels and the hypothesis template stay in English.
  • —Commercially clean: Apache-2.0, trained only on data that allows commercial use (no XNLI, ANLI or other non-commercial sets). See Training.
  • —Small and fast: 308M parameters, ModernBERT architecture (mmBERT), ONNX included for CPU and the browser.
  • —Honest numbers: all models below were run by us with the same script and templates.

Try it in the browser: Horizon-Labs/multilingual-zeroshot demo.

Part of Horizon Labs' open models (collection). Source code: github.com/horizon-ai-labs/agent-io-guards.

Quick start

python
from transformers import pipeline

clf = pipeline("zero-shot-classification", model="Horizon-Labs/multilingual-zeroshot-base")
clf("Mi pedido llegó roto y quiero que me devuelvan el dinero.",
    candidate_labels=["refund request", "shipping question", "product praise", "account problem"])
# {'labels': ['refund request', ...], 'scores': [...]}

# several labels can apply at once
clf("The camera is great but the battery dies by noon.", ["camera", "battery", "screen", "price"], multi_label=True)

# a task-specific template often helps
clf("¿Me pones una alarma a las siete?", ["set an alarm", "play music", "weather"], hypothesis_template="The user wants to {}.")

Labels: not_entailment (0) and entailment (1). For each candidate label the model scores whether the text entails "This example is {label}." (or your hypothesis_template). Any NLI-style use works too: pass text and text_pair to a text-classification pipeline.

Evaluation

Accuracy, single-label (multi_label=False: the label with the highest entailment score wins). English templates and labels for every language; the same template for every model (e.g. "This text is about {}." for SIB-200). No model saw these datasets' training splits, except where marked. ‡ = trained partly on data with non-commercial licenses (their -c variants are the commercially usable ones). Script: zeroshot/evaluate_zs.py.

§ = label names seen in our synthetic training data. Since v1.1 our training data includes generic label taxonomies (topics, news sections, Q&A question topics, emotions, sentiment) whose label names overlap these benchmarks' label sets; for Yahoo Answers and AG News almost exactly. No benchmark texts were used, but on these rows our models are not zero-shot with respect to the label names, so compare with care. MASSIVE, Banking77 and XNLI label sets were not used.

Multilingual

**this model** (308M)small (141M)bge-m3-zeroshot-v2.0-c (568M)mDeBERTa-v3-base-xnli (278M)xlm-roberta-large-xnli (560M)bge-m3-zeroshot-v2.0 (568M) ‡
MASSIVE intents (60 labels), 16 languages0.4820.4020.4110.3510.4040.611
SIB-200 topics (7 labels), 16 languages §0.8130.7890.7820.6540.5260.837

Per language, mean of MASSIVE and SIB-200:

**this model** (308M)small (141M)bge-m3-zeroshot-v2.0-c (568M)mDeBERTa-v3-base-xnli (278M)xlm-roberta-large-xnli (560M)bge-m3-zeroshot-v2.0 (568M) ‡
English0.6980.6540.5960.5370.5040.752
German0.6460.5950.6070.5270.4720.748
French0.6840.6500.6170.5260.4870.753
Spanish0.6380.6020.5610.4880.4560.742
Portuguese0.6660.6170.5850.4910.4460.713
Russian0.6420.6230.5970.4970.4530.724
Polish0.6880.6420.6400.5330.4860.756
Turkish0.6670.6010.6050.4910.4550.713
Arabic0.6060.5510.5590.4760.4330.681
Hindi0.6150.5410.5890.5110.4590.719
Chinese0.6740.6250.6270.5140.4810.760
Japanese0.7140.6510.6370.5300.4920.752
Korean0.6400.5780.6100.4940.4860.714
Vietnamese0.6130.5630.6050.4780.4900.735
Indonesian0.6690.6090.6250.5200.4830.749
Swahili0.5030.4250.4840.4300.3590.573

English

**this model** (308M)small (141M)bge-m3-zeroshot-v2.0-c (568M)mDeBERTa-v3-base-xnli (278M)xlm-roberta-large-xnli (560M)bge-m3-zeroshot-v2.0 (568M) ‡bart-large-mnli (407M)deberta-v3-base-zeroshot-v2.0 (184M) ‡
AG News (4) §0.8260.8280.7260.6700.5910.8860.6840.884
Yahoo Answers (10) §0.6490.6230.5640.4970.5290.6540.5860.672
Banking77 (77)0.5540.5340.4300.2870.1660.6950.4800.714
Emotion (6) §0.4910.4420.4760.4830.3450.6770.4630.737
SST-2 (2) §0.8750.8370.8650.8440.8200.9050.9220.947
MASSIVE, English only0.5670.5000.4130.3970.4430.6800.5300.710
SIB-200, English only0.8280.8090.7790.6760.5640.8240.7600.745

v1.0 → v1.1

v1.1 adds data with broad, reusable label taxonomies, so it is better on common categories (topics, emotions, sentiment, aspects) — the § rows, where the label names are familiar to it. On label sets it has not seen it stays within about ±0.015 of v1.0 (slightly lower on some). To pin the previous model, load it with revision="v1.0".

v1.0**v1.1 (this version)**
MASSIVE (unseen label set)0.4920.482
Banking77 (unseen label set)0.5680.554
XNLI (balanced acc.)0.8010.799
SIB-200 §0.7980.813
AG News §0.7890.826
Yahoo Answers §0.5030.649
Emotion §0.4660.491
SST-2 §0.8840.875

NLI

**this model** (308M)small (141M)bge-m3-zeroshot-v2.0-c (568M)mDeBERTa-v3-base-xnli (278M)xlm-roberta-large-xnli (560M)bge-m3-zeroshot-v2.0 (568M) ‡
XNLI test, 12 languages (balanced acc.) †0.7990.7600.8250.8450.9920.818

† XNLI is included for reference only: xlm-roberta-large-xnli and mDeBERTa-xnli were trained on XNLI data (the first scores 0.99, which suggests it saw the test sentences). Our models never saw XNLI.

Limitations

  • —English-only models trained with more (partly non-commercial) classification data are better on English topic and emotion benchmarks (e.g. deberta-v3-base-zeroshot-v2.0 on Emotion and Yahoo). If you only need English, compare them on your data.
  • —bge-m3-zeroshot-v2.0 (568M, trained partly on non-commercial data) scores higher on MASSIVE and SIB-200.
  • —Zero-shot accuracy depends a lot on label wording and the template. Use descriptive labels ("request a refund" rather than "refund_req") and try a template that fits your task. The model links explicit wording better than implied categories. Example (small model, multi-label, a gym review not like our training domains): "The machines are always taken after 5pm and half the treadmills are broken, but the coaches really know their stuff. For 60 euros a month I expected cleaner showers." gives equipment 0.99, trainers 0.97, membership cost 0.82, but hygiene only 0.28 and crowding 0.03 (v1.0: trainers 0.56, membership cost 0.58).
  • —Broad labels (e.g. "world news", "education") tend to win over specific ones. Emotions close in meaning (joy / love / surprise) are often confused.
  • —With multi_label=True, scores are independent; tune the threshold on a few examples of your own.
  • —Lower-resource languages (e.g. Swahili) score clearly lower than high-resource ones.
  • —Much of the training data is synthetic (Qwen3.8-27B) or machine-translated.

Training

  • —Backbone: jhu-clsp/mmBERT-base (MIT), sequence-pair classification, bf16, max length 1024.
  • —Data (label = does the text entail the hypothesis):
  • —English NLI: MultiNLI (OANC and CC-BY-SA-3.0 parts), SNLI (CC-BY-SA-4.0), WANLI (CC-BY-4.0).
  • —120k MultiNLI/WANLI pairs machine-translated by Qwen3.8-27B into 24 languages, with native and English hypotheses.
  • —Synthetic zero-shot tasks by Qwen3.8-27B: FineWeb-Edu / FineWeb-2 passages (ODC-BY) labelled by topic, genre, audience, tone and purpose with near-miss wrong labels, and ~90k short texts (requests, reviews, tickets, posts, headlines) over 26 task types, 32 domains and 33 languages, each with an invented label set and hypothesis template.
  • —(v1.1) Generic taxonomies by Qwen3.8-27B: 24k new FineWeb / FineWeb-2 passages labelled for topic, text type, sentiment, audience, purpose and news section; ~130k short texts written for fixed label sets (emotion, sentiment, Q&A question topic, news section, customer-message topic, urgency, formality, spam) without using the label words; ~25k reviews in 8 domains mentioning aspects (e.g. "internet", "food") without naming them.
  • —Not used: XNLI, ANLI, FEVER-NLI, any benchmark above.