File size: 1,423 Bytes
e3bf319
6b7e476
 
3ef75e6
 
e3bf319
3ef75e6
e3bf319
 
3ef75e6
 
e3bf319
 
6b7e476
 
3ef75e6
6b7e476
3ef75e6
6b7e476
3ef75e6
 
 
 
6b7e476
3ef75e6
6b7e476
3ef75e6
 
 
 
6b7e476
3ef75e6
6b7e476
3ef75e6
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
---
title: Zero-Shot Text Classifier
emoji: 🏷️
colorFrom: blue
colorTo: indigo
sdk: gradio
sdk_version: "5.33.0"
app_file: app.py
pinned: false
license: apache-2.0
short_description: Classify text into any custom categories with Qwen3-0.6B
---

# Zero-Shot Text Classifier

Classify any text into your own custom categories using **Qwen3-0.6B** with zero-shot instruction prompting.

## Features

- **Custom labels**: Define any categories you want
- **Multi-label mode**: Allow multiple labels to apply simultaneously
- **Preset label sets**: Quick-start with Sentiment, Topic, Intent, or Tone presets
- **Fast inference**: ~200ms on GPU via ZeroGPU

## Why Qwen3 over BART-MNLI?

- Qwen3-0.6B is smaller (0.6B vs 0.4B) but more capable due to modern architecture
- Handles multi-label classification natively via instruction prompting
- Supports structured JSON output for downstream integration
- Better accuracy on diverse classification tasks (not limited to NLI-style inference)

## API Usage

```python
from gradio_client import Client

client = Client("xavier-fuentes/text-classifier")
result = client.predict(
    text="The product quality is amazing but shipping was slow",
    candidate_labels="positive, negative, mixed",
    multi_label=False,
    api_name="/run_classification"
)
```

Built by [Xavier Fuentes](https://huggingface.co/xavier-fuentes) @ [AI Enablement Academy](https://enablement.academy)