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