| | --- |
| | title: CPU Only Zero Shot Text Classification |
| | emoji: π |
| | colorFrom: gray |
| | colorTo: purple |
| | sdk: gradio |
| | sdk_version: 5.31.0 |
| | app_file: app.py |
| | pinned: false |
| | license: apache-2.0 |
| | short_description: ' CPU-only Zero-Shot Text Classification' |
| | --- |
| | # π·οΈ Zero-Shot Text Classification |
| | [](https://huggingface.co/spaces/your-username/zero-shot-classifier) |
| | [] |
| | [](https://huggingface.co/facebook/bart-large-mnli) |
| | [](LICENSE) |
| |
|
| | --- |
| |
|
| | ## π Overview |
| | Unlock **zero-shot classification** for any textβno fine-tuning required. |
| | Define your own label set on the fly and see how well each label matches your input, powered by **BART-MNLI** on CPU. |
| |
|
| | > **AI buzzwords:** |
| | > Natural Language Inference β’ Zeroβshot Learning β’ Transformer-based NLP β’ Real-time Inference β’ Edge Deployment β’ Cloud-native Demo |
| |
|
| | --- |
| |
|
| | ## β¨ Features |
| |
|
| | | π Feature | π Description | |
| | |--------------------------------|----------------------------------------------------------------| |
| | | **π Zero-Shot** | Classify into arbitrary categories without task-specific data | |
| | | **β‘ CPU-Only Inference** | Runs on free Hugging Face Spaces (2 vCPU / 16 GB RAM) | |
| | | **ποΈ Single vs. Multi-Label** | Toggle between exclusive or overlapping labels | |
| | | **π¨ Interactive UI** | Gradio Blocks with text input, label list, mode toggle, table | |
| | | **π§ No Training Needed** | Leverages pre-trained BART-MNLI via HF Transformers | |
| | | **βοΈ Instant Deploy** | Commit three filesβSpaces auto-builds & hosts your demo | |
| |
|
| | --- |
| |
|
| | ## ποΈ How It Works |
| |
|
| | 1. **User Input** β Paste any sentence or paragraph. |
| | 2. **Label Definition** β Enter comma-separated candidate labels (e.g. βPositive, Negative, Questionβ). |
| | 3. **Model Inference** β Pipeline computes entailment scores for each label. |
| | 4. **Result Table** β Display each label with its confidence score. |
| |
|
| | All done **locally on the Space**, ensuring **privacy**, **zero API cost**, and **lightning speed**. |
| |
|
| | --- |
| |
|
| | ## π οΈ Local Development |
| |
|
| | ```bash |
| | git clone https://github.com/your-username/zero-shot-classifier.git |
| | cd zero-shot-classifier |
| | python3 -m venv venv && source venv/bin/activate |
| | pip install -r requirements.txt |
| | python app.py |
| | |
| | ## Latest Update |
| | |
| | - Updated BART-MNLI model for better accuracy. - May 29, 2025 π |
| | - Added support for custom label sets. π§ - July 24, 2025 π |
| | - Enhanced Gradio UI responsiveness. - July 23, 2025 π |
| | - Improved multi-label classification support. β‘ - July 22, 2025 π |
| | - Updated BART-MNLI model for better accuracy. β‘ - July 21, 2025 π |
| | - Optimized CPU inference speed. - July 20, 2025 π |
| | - Added support for custom label sets. - July 19, 2025 π |
| | - Enhanced Gradio UI responsiveness. - July 18, 2025 π |
| | - Improved multi-label classification support. - July 17, 2025 π |
| | - Updated BART-MNLI model for better accuracy. - July 16, 2025 π |
| | - Optimized CPU inference speed. ποΈ - July 15, 2025 π |
| | - Added support for custom label sets. - July 11, 2025 π |
| | - Enhanced Gradio UI responsiveness. π§ - July 10, 2025 π |
| | - Improved multi-label classification support. - July 09, 2025 π |
| | - Updated BART-MNLI model for better accuracy. - July 08, 2025 π |
| | - Optimized CPU inference speed. π - July 07, 2025 π |
| | - Added support for custom label sets. - July 06, 2025 π |
| | - Enhanced Gradio UI responsiveness. π·οΈ - July 05, 2025 π |
| | - Improved multi-label classification support. - July 04, 2025 π |
| | - Updated BART-MNLI model for better accuracy. π·οΈ - July 03, 2025 π |
| | - Optimized CPU inference speed. π - July 02, 2025 π |
| | - Added support for custom label sets. - July 01, 2025 π |
| | - Enhanced Gradio UI responsiveness. - June 30, 2025 π |
| | - Improved multi-label classification support. π§ - June 29, 2025 π |
| | - Updated BART-MNLI model for better accuracy. β‘ - June 28, 2025 π |
| | - Optimized CPU inference speed. ποΈ - June 27, 2025 π |
| | - Added support for custom label sets. π·οΈ - June 26, 2025 π |
| | - Enhanced Gradio UI responsiveness. ποΈ - June 25, 2025 π |
| | - Improved multi-label classification support. - June 24, 2025 π |
| | - Updated BART-MNLI model for better accuracy. - June 23, 2025 π |
| | - Optimized CPU inference speed. π - June 22, 2025 π |
| | - Added support for custom label sets. - June 21, 2025 π |
| | - Enhanced Gradio UI responsiveness. - June 20, 2025 π |
| | - Improved multi-label classification support. - June 19, 2025 π |
| | - Updated BART-MNLI model for better accuracy. - June 18, 2025 π |
| | - Optimized CPU inference speed. π§ - June 17, 2025 π |
| | - Added support for custom label sets. β‘ - June 16, 2025 π |
| | - Enhanced Gradio UI responsiveness. - June 15, 2025 π |
| | - Improved multi-label classification support. - June 14, 2025 π |
| | - Updated BART-MNLI model for better accuracy. π§ - June 13, 2025 π |
| | - Optimized CPU inference speed. - June 12, 2025 π |
| | - Added support for custom label sets. - June 11, 2025 π |
| | - Enhanced Gradio UI responsiveness. - June 10, 2025 π |
| | - Improved multi-label classification support. π·οΈ - June 09, 2025 π |
| | - Updated BART-MNLI model for better accuracy. - June 08, 2025 π |
| | - Optimized CPU inference speed. β‘ - June 07, 2025 π |
| | - Added support for custom label sets. - June 06, 2025 π |
| | - Enhanced Gradio UI responsiveness. π - June 05, 2025 π |
| | - Improved multi-label classification support. ποΈ - June 04, 2025 π |
| | - Updated BART-MNLI model for better accuracy. ποΈ - June 03, 2025 π |
| | - Optimized CPU inference speed. β‘ - June 02, 2025 π |
| | - Added support for custom label sets. π§ - June 01, 2025 π |
| | - Enhanced Gradio UI responsiveness. π - May 31, 2025 π |
| | - Improved multi-label classification support. π·οΈ - May 30, 2025 π |
| | |
| | **Website**: https://ghostainews.com/ |
| | **Discord**: https://discord.gg/BfA23aYz |