Views
No views yet
topic classification, sentiment analysis and as a reranker in RAG pipelines.pip install gliclass1from gliclass import GLiClassModel, ZeroShotClassificationPipeline
2from transformers import AutoTokenizer
3
4model = GLiClassModel.from_pretrained("knowledgator/gliclass-base-v1.0-init")
5tokenizer = AutoTokenizer.from_pretrained("knowledgator/gliclass-base-v1.0-init")
6
7pipeline = ZeroShotClassificationPipeline(model, tokenizer, classification_type='multi-label', device='cuda:0')
8
9text = "One day I will see the world!"
10labels = ["travel", "dreams", "sport", "science", "politics"]
11results = pipeline(text, labels, threshold=0.5)[0] #because we have one text
12
13for result in results:
14 print(result["label"], "=>", result["score"])| Model | IMDB | AG_NEWS | Emotions |
|---|---|---|---|
| gliclass-large-v1.0 (438 M) | 0.9404 | 0.7516 | 0.4874 |
| gliclass-base-v1.0 (186 M) | 0.8650 | 0.6837 | 0.4749 |
| gliclass-small-v1.0 (144 M) | 0.8650 | 0.6805 | 0.4664 |
| Bart-large-mnli (407 M) | 0.89 | 0.6887 | 0.3765 |
| Deberta-base-v3 (184 M) | 0.85 | 0.6455 | 0.5095 |
| Comprehendo (184M) | 0.90 | 0.7982 | 0.5660 |
| SetFit BAAI/bge-small-en-v1.5 (33.4M) | 0.86 | 0.5636 | 0.5754 |
1@misc{stepanov2025gliclassgeneralistlightweightmodel,
2 title={GLiClass: Generalist Lightweight Model for Sequence Classification Tasks},
3 author={Ihor Stepanov and Mykhailo Shtopko and Dmytro Vodianytskyi and Oleksandr Lukashov and Alexander Yavorskyi and Mykyta Yaroshenko},
4 year={2025},
5 eprint={2508.07662},
6 archivePrefix={arXiv},
7 primaryClass={cs.LG},
8 url={https://arxiv.org/abs/2508.07662},
9}