|
--- |
|
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/) |
|
|