ghostai1's picture
Updated status on May 31, 2025
70f893f verified
|
raw
history blame
2.95 kB
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

Hugging Face Space
[Gradio UI]
Model
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

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