induwara.lk
induwara.lkAI · Free

Zero-Shot Text Classifier — Free, Server-Side, No API Key

Sort any text into your own custom labels — no training data, no signup, no model download. A distilled BART-MNLI NLI model runs on our server to score how strongly each candidate label fits the input, using the entailment-NLI method introduced by Yin, Hay & Roth (2019).

By Induwara AshinsanaUpdated May 12, 2026
Classify text into your own labelsdistilbart-mnli · server-side
Sources cited
Inference runs server-side. Text is sent once for scoring and not stored.121 / 4,000
urgentnot urgentfollow-up

Pick the single best-fitting label (scores sum to 100%).

Try a preset
Two rankings run in one click: a distilled BART-MNLI classifier (server-side) and a deterministic word-overlap baseline for a transparent cross-check.

What this does

Pick any text and your own set of candidate labels — the tool runs an NLI model (distilled BART fine-tuned on MultiNLI) to score how strongly each label fits the text. No training data, no API key on your side, no upload to a third party. In single-label mode the scores sum to 100 %; in multi-label mode each label is independent.

Method: entailment-NLI per Yin, Hay & Roth (2019). The premise is your text; each candidate label is substituted into the hypothesis template and the model's entailment probability becomes the label score. Full source list in the page footer.

How it works

The page implements the entailment-as-zero-shot-classification recipe first published by Yin, Hay & Roth (2019). The same recipe is the default behind Hugging Face's zero-shot-classification task — and that is the API we call server-side from this page.

1. Build a hypothesis per label

Your text is treated as the premise. For each candidate label L, the tool substitutes the label into the hypothesis template — the default is This text is about {}.. With label urgent, the hypothesis becomes “This text is about urgent.” A purpose-specific template (“This support ticket is {}.”) typically raises accuracy, which is why the field is editable in the Advanced disclosure.

2. Run an NLI head

The (premise, hypothesis) pair is tokenised and passed through valhalla/distilbart-mnli-12-3, a distilled BART encoder-decoder fine-tuned on MultiNLI (Williams, Nangia & Bowman, 2018). The classification head emits three logits per pair: contradiction, neutral, and entailment. The pipeline discards neutral and applies softmax to [contradiction, entailment] to produce the entailment probability — the chance that the hypothesis is entailed by the premise.

3. Aggregate across labels

In single-label mode the per-label entailment probabilities are softmaxed across all labels, so the scores sum to 100 %. In multi-labelmode each label's entailment probability is reported as-is — multiple labels can be high. Pick single-label when the categories are mutually exclusive (news topic, primary intent), multi-label when they overlap (“urgent” AND “billing-related”).

for each label L_i:
  hypothesis_i  = template.replace("{}", L_i)
  [c, n, e]     = NLI(premise = text, hypothesis = hypothesis_i)
  entail_i      = softmax([c, e])[1]      // discard neutral

single-label:  scores = softmax([entail_1, ..., entail_N])
multi-label:   scores = [entail_1, ..., entail_N]

4. Server-side inference & privacy

The model runs server-side on the Hugging Face Inference API. Your text and labels are POSTed to /api/tools/zero-shot, forwarded once to Hugging Face, and the response is returned to your browser. Nothing is written to disk or any database; the route uses cache: "no-store" so there is no edge cache either. Inputs are capped at 4,000 characters and 12 labels to keep latency predictable. A deterministic word-overlap baseline runs alongside the model on every request as a transparent cross-check — when both rankings pick the same top label, the confidence is high; when they disagree, the page surfaces that explicitly.

Worked examples

Support-ticket triage (single-label)

  • Text: "My internet has been down since this morning and I need it fixed immediately, this is unacceptable for a paying customer."
  • Labels: urgent, not urgent, follow-up
  • Template: "This support ticket is {}."
  1. Build 3 hypotheses, one per label
  2. NLI head emits 3 logits per pair; softmax over [contradiction, entailment]
  3. urgent → entailment_prob ≈ 0.95
  4. follow-up → entailment_prob ≈ 0.07
  5. not urgent → entailment_prob ≈ 0.03
  6. Softmax across labels → urgent ≈ 78 %, follow-up ≈ 12 %, not urgent ≈ 10 %
  7. Verdict: top label = urgent at ≥ 70 % confidence

News topic classification (single-label)

  • Text: "The Central Bank of Sri Lanka cut its policy rate by 25 basis points today, citing easing inflation and a stable rupee."
  • Labels: business, sports, entertainment, technology, politics
  • Template: "This news article is about {}."
  1. business → entailment_prob ≈ 0.93
  2. politics → entailment_prob ≈ 0.40
  3. technology → entailment_prob ≈ 0.08
  4. entertainment → entailment_prob ≈ 0.04
  5. sports → entailment_prob ≈ 0.02
  6. Softmax across labels → business ≈ 66 %, politics ≈ 21 %, technology ≈ 6 %, entertainment ≈ 4 %, sports ≈ 3 %
  7. Verdict: top label = business at ≥ 60 % confidence — matches the AG News zero-shot pattern in Yin et al. (2019), Table 3

Comment moderation (multi-label)

  • Text: "Honestly the writing here is sloppy and the facts are wrong. Did anyone fact-check this before publishing?"
  • Labels: spam, genuine criticism, abusive, praise
  • Template: "This comment is {}."
  1. Multi-label mode: each label scored independently
  2. genuine criticism → entailment_prob ≈ 0.86
  3. spam → entailment_prob ≈ 0.08
  4. abusive → entailment_prob ≈ 0.17
  5. praise → entailment_prob ≈ 0.02
  6. No softmax across labels — multiple may be high at once
  7. Verdict: surface for human review as 'genuine criticism', possibly 'abusive' for tone check; not 'spam', not 'praise'

Frequently asked questions

Sources & references

Related tools

Rate this tool
Be the first to rate

Comments & feedback

Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.

Found a misclassification, edge case, or want to suggest a different model?

Email me at [email protected] — most fixes ship within 24 hours.