205 Downloads Updated 1 month ago
ollama run Abyssal/intent-classifier-general:1.5b
A tiny, promptable general intent classifier. You define the intents at prompt time — no retraining — and the model returns the single best-matching intent name.
Pass your intent names as a JSON-schema enum in format. This grammar-constrains decoding so the answer is always one of your intents (never a hallucinated or out-of-list label):
curl http://localhost:11434/api/chat -d '{
"model": "intent-classifier-general:1.5b",
"stream": false,
"options": {"temperature": 0},
"format": {"type": "string", "enum": ["refund", "tracking", "account"]},
"messages": [{"role": "user", "content":
"Candidate intents:\nrefund: wants money back\ntracking: where their order is\naccount: login or profile\n\nUser message: where is my package?\n\nAnswer with exactly one intent name from the list above."
}]
}'
# -> "tracking"
Without the enum, plain ollama run uses free generation and can occasionally answer with a label outside your list on ambiguous phrasings — use the enum for reliable routing.
Base: LoRA fine-tune of Qwen2.5-1.5B-Instruct (Apache-2.0) on ~200k examples from a 10M-row dataset, where each example presents a different set of intents with descriptions. Runs at temperature 0.
Accuracy: ~92% top-1 on held-out data with realistic 4-intent lists when using the enum constraint. Strongest when intents are semantically distinct; expect occasional confusion between near-synonymous intents (e.g. tracking vs shipping address).
| Usage | Free-gen acc | In-list | Enum-constrained acc | In-list |
|---|---|---|---|---|
| In-taxonomy names, gold offered (N=190) | 84.7% | 88.4% | 91.1% | 100% |
| + near-synonym trap (N=73) | 80.8% | 87.7% | 91.8% | 100% |
| Invented / custom names (N=95) | 71.6% | 83.2% | 83.2% | 100% |
| Gold not offered (N=95) | — | 61.1% | — | — |
Good for: routing support tickets, chatbot intent detection, message tagging, triage — fast, local, fully customizable intents.
License: Apache-2.0 (base). ~3.1 GB, fits an 8 GB GPU.