File size: 1,465 Bytes
069c519 aa5c944 069c519 aa5c944 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
---
title: Zero Short Text Classification
emoji: π
colorFrom: red
colorTo: blue
sdk: gradio
sdk_version: 5.34.1
app_file: app.py
pinned: false
license: mit
short_description: Zero-shot classification means no training data is needed.
---
# π Zero-Shot Text Classification with BART and XLM-RoBERTa
This Hugging Face Space is inspired by the article:
π [Zero-Shot Text Classification with BART and XLM-RoBERTa β C# Corner](https://www.c-sharpcorner.com/article/zero-shot-text-classification-with-bart-and-xlm-roberta/)
## π‘ What this app does:
- Takes any raw text input.
- Accepts user-defined labels (comma-separated).
- Uses Hugging Face's `pipeline("zero-shot-classification")` to predict the most relevant label(s) using:
- **facebook/bart-large-mnli** or
- **joeddav/xlm-roberta-large-xnli**
## π¦ Models Supported
- `facebook/bart-large-mnli` (English only)
- `joeddav/xlm-roberta-large-xnli` (Multilingual)
## β
Use Cases
- Categorizing feedback, support tickets, news headlines, etc.
- Works without any custom training β zero-shot!
## π How it Works
The model is prompted with your text and list of labels. It computes the probability of each label being appropriate, and returns scores.
---
Read the full article here:
π [https://www.c-sharpcorner.com/article/zero-shot-text-classification-with-bart-and-xlm-roberta/](https://www.c-sharpcorner.com/article/zero-shot-text-classification-with-bart-and-xlm-roberta/)
|