metadata
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
๐ 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
- User Input โ Paste any sentence or paragraph.
- Label Definition โ Enter comma-separated candidate labels (e.g. โPositive, Negative, Questionโ).
- Model Inference โ Pipeline computes entailment scores for each label.
- 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
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 ๐
- Enhanced Gradio UI responsiveness. ๐ - May 31, 2025 ๐
- Improved multi-label classification support. ๐ท๏ธ - May 30, 2025 ๐
**Website**: https://ghostainews.com/
**Discord**: https://discord.gg/BfA23aYz