Views
No views yet
topic classification, sentiment analysis and as a reranker in RAG pipelines.pip install gliclasstransformers package version than llm2vec requires, so install it manually:pip install transformers==4.44.11from gliclass import GLiClassModel, ZeroShotClassificationPipeline
2from transformers import AutoTokenizer
3
4model = GLiClassModel.from_pretrained("knowledgator/gliclass-qwen-0.5B-v1.0")
5tokenizer = AutoTokenizer.from_pretrained("knowledgator/gliclass-qwen-0.5B-v1.0")
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"])
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}