Zero-Shot Classification
Zero-shot classification sorts text into labels it was never explicitly trained on.
Inputs
Input
The battery drains in two hours. — labels: hardware, billing, shipping
Zero-Shot Classification Model
Output
Output
- hardware0.91
- billing0.05
- shipping0.04
About Zero-Shot Classification
Zero-shot classification sorts text into labels it was never explicitly trained on. Browse zero-shot classification models on HubClone to compare checkpoints, or open a Space to try one in the browser.
Use Cases
Ticket routing
Send messages to the right team using label names only.
Quick prototyping
Try a classifier before collecting training data.
Inference
The Transformers pipeline API runs zero-shot classification models in a few lines. Replace <model-id> with any model listed on this page.
from transformers import pipeline
pipe = pipeline("zero-shot-classification", model="<model-id>")
pipe("The battery drains in two hours. — labels: hardware, billing, shipping")Useful Resources
Want to dig deeper into the topic? Great! Here is a hand-picked list of resources we found helpful.
Documentation
- Zero-Shot Classification task guide
- Pipelines reference
Notebooks
- Fine-tuning a zero-shot classification model