# Klasyfikacja tekstu bez przykładów (zero-shot)

EN: **Zero-shot text classification** · id `zeroshotclassification` · aliases: zero-shot text classification, zero-shot classification, klasyfikacja zero-shot

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [Język, obraz, audio](https://aiatlasgraph.com/t/modalities.md) › [Język naturalny](https://aiatlasgraph.com/t/nlp.md) › [Klasyfikacja tekstu i analiza sentymentu](https://aiatlasgraph.com/t/textclassification.md) › Klasyfikacja tekstu bez przykładów (zero-shot)

## Description

- PL: Przypisywanie tekstom etykiet niewidzianych w treningu, zwykle przez przeformułowanie klas na hipotezy NLI lub prompt dla LLM.
- EN: Assigning texts labels unseen in training, usually by recasting classes as NLI hypotheses or as an LLM prompt.

## In one sentence

- PL: Wpisujesz własne nazwy kategorii, a model od razu przydziela do nich teksty, bez przygotowanych wcześniej przykładów.
- EN: You type your own category names and the model sorts texts into them right away, with no prepared examples.

## Problem it solves

- PL: Zebranie i opisanie tysięcy przykładów do każdej nowej kategorii trwa tygodnie, a kategorie ciągle się zmieniają.
- EN: Collecting and labelling thousands of examples for every new category takes weeks, and categories keep changing.

## What it does

- PL: Zamienia każdą kategorię w zdanie typu „ten tekst jest o reklamacji” i sprawdza, które najlepiej pasuje.
- EN: It turns each category into a sentence like 'this text is about a complaint' and checks which fits best.

## Everyday example

- PL: Mała firma od razu sortuje maile od klientów na „zwrot”, „faktura” i „pytanie o dostawę”, zmieniając kategorie z dnia na dzień.
- EN: A small shop sorts customer emails into 'return', 'invoice' and 'delivery question' at once, changing categories from day to day.

## This concerns you if you…

- PL: masz teksty do posegregowania, ale brak przykładów
- PL: często zmieniasz listę kategorii
- PL: duży model jest dla ciebie za drogi
- EN: have texts to sort but no labelled examples
- EN: change your category list often
- EN: find a large model too costly

## Keywords

zero-shot text classification · NLI classification · label verbalization · hypothesis template · DeBERTa-v3 · universal classifier · cross-encoder · dynamic label set

## How it works

- PL: W wariancie opartym na NLI model przekształca nazwę klasy w hipotezę, np. „Ten tekst dotyczy sportu”, i ocenia jej wynikanie z tekstu wejściowego. Każda etykieta jest oceniana osobno, dzięki czemu klasy można zmieniać bez ponownego trenowania klasyfikatora.
- EN: In the NLI-based variant, the model turns a class label into a hypothesis such as “This text is about sports” and scores whether it follows from the input text. Each label is evaluated separately, so the class set can change without retraining the classifier.

## Limits

- PL: Wynik zależy od sformułowania etykiety i szablonu hipotezy. Osobne ocenianie każdej klasy zwiększa koszt wraz z liczbą etykiet, a badanie uniwersalnych klasyfikatorów NLI nie ustanawia niezawodności dla dowolnej domeny i języka.
- EN: Results depend on label wording and the hypothesis template. Scoring every class separately increases cost with the number of labels, and the universal NLI-classifier study does not establish reliability for every domain and language.

## Key terms

- PL: **label verbalisation**: Zapisanie kategorii jako zdania, które model może ocenić.
- PL: **universal classifier**: Jeden model obsługujący wiele zadań klasyfikacji bez dotrenowania.
- PL: **few-shot**: Wariant z kilkoma przykładami na klasę.
- EN: **label verbalisation**: Writing a category as a sentence the model can score.
- EN: **universal classifier**: One model handling many classification tasks without retraining.
- EN: **few-shot**: A variant with a handful of examples per class.

## Know first

- [Wnioskowanie z tekstu: czy zdanie wynika z innego (NLI) (Natural language inference (textual entailment))](https://aiatlasgraph.com/t/nli.md)

## Sources

- [Building Efficient Universal Classifiers with Natural Language Inference](<https://arxiv.org/html/2312.17543v2>) `laurer-2023-nli-universal-classifiers` · by Moritz Laurer, Wouter van Atteveldt, Andreu Casas, Kasper Welbers

---

AI Atlas revision 122 (2026-10-30) · HTML: https://aiatlasgraph.com/t/zeroshotclassification · index: https://aiatlasgraph.com/llms.txt · everything: https://aiatlasgraph.com/llms-full.txt · updated 2026-10-30
