[Image blocked: image/png]
GLiClass-multitask: Efficient zero-shot and few-shot multi-task model via sequence classification
GLiClass is an efficient zero-shot sequence classification model designed to achieve SoTA performance while being much faster than cross-encoders and LLMs, while preserving strong generalization capabilities.
The model supports text classification with any labels and can be used for the following tasks:
- Topic Classification
- Sentiment Analysis
- Intent Classification
- Reranking
- Hallucination Detection
- Rule-following Verification
- LLM-safety Classification
- Natural Language Inference
✨ What's New in V3
- Hierarchical Labels — Organize labels into groups using dot notation or dictionaries (e.g.,
sentiment.positive, topic.product).
- Few-Shot Examples — Provide in-context examples to boost accuracy on your specific task.
- Label Descriptions — Add natural-language descriptions to labels for more precise classification.
- Task Prompts — Prepend a custom prompt to guide the model's classification behavior.
See the GLiClass library README for full details on these features.
Installation
Quick Start
Task Examples
1. Topic Classification
With hierarchical labels
2. Sentiment Analysis
With a task prompt
3. Intent Classification
With few-shot examples
4. Natural Language Inference
Represent your premise as the text and the hypothesis as a label. The model works best with a single hypothesis at a time.
5. Reranking
Score query–passage relevance by treating passages as texts and the query as the label:
6. Hallucination Detection
Concatenate context, question, and answer into the text field:
7. Rule-following Verification
Include the domain and rules as part of the text:
8. LLM-safety Classification
Benchmarks
F1 scores on zero-shot text classification (no fine-tuning on these datasets):
GLiClass-V1 Multitask:
GLiClass-V3:
Citation