GLiClass: Open-Source JEV Knowledgator released GLiClass, an open-source zero-shot sequence classification model inspired by the GLiNER framework that performs classification in a single forward pass and runs approximately 10 times faster than traditional cross-encoder models while achieving comparable performance. The model is installable via pip and supports hierarchical label structures using dot notation, in-context examples through the <> token, custom prompts, and automatic text chunking for long documents. GLiClass is available on GitHub and Hugging Face, with a small-v1.0 model checkpoint and an interactive demo. GLiClass is an efficient, zero-shot sequence classification model inspired by the GLiNER https://github.com/urchade/GLiNER/tree/main framework. It achieves comparable performance to traditional cross-encoder models while being significantly more computationally efficient, offering classification results approximately 10 times faster by performing classification in a single forward pass. 📄 Blog https://medium.com/@knowledgrator/pushing-zero-shot-classification-to-the-limit-696a2403032f • 📢 Discord https://discord.gg/dkyeAgs9DG • 📺 Demo https://huggingface.co/spaces/knowledgator/GLiClass SandBox • 🤗 Available models https://huggingface.co/models?sort=trending&search=gliclass • Install GLiClass easily using pip: pip install gliclass Clone and install directly from GitHub: git clone https://github.com/Knowledgator/GLiClass cd GLiClass python -m venv venv source venv/bin/activate Windows: venv\Scripts\activate pip install -r requirements.txt pip install . Verify your installation: python import gliclass print gliclass. version python from gliclass import GLiClassModel, ZeroShotClassificationPipeline from transformers import AutoTokenizer model = GLiClassModel.from pretrained "knowledgator/gliclass-small-v1.0" tokenizer = AutoTokenizer.from pretrained "knowledgator/gliclass-small-v1.0" pipeline = ZeroShotClassificationPipeline model, tokenizer, classification type='multi-label', device='cuda:0' text = "One day I will see the world " labels = "travel", "dreams", "sport", "science", "politics" results = pipeline text, labels, threshold=0.5 0 for result in results: print f"{result 'label' } = {result 'score' :.3f}" GLiClass now supports hierarchical label structures using dot notation: hierarchical labels = { "sentiment": "positive", "negative", "neutral" , "topic": "product", "service", "shipping" } text = "The product quality is amazing but delivery was slow" results = pipeline text, hierarchical labels, threshold=0.5 0 for result in results: print f"{result 'label' } = {result 'score' :.3f}" Output: sentiment.positive = 0.892 topic.product = 0.921 topic.shipping = 0.763 Get hierarchical output matching your input structure: results = pipeline text, hierarchical labels, return hierarchical=True 0 print results Output: { "sentiment": {"positive": 0.892, "negative": 0.051, "neutral": 0.124}, "topic": {"product": 0.921, "service": 0.153, "shipping": 0.763} } Improve classification accuracy with in-context examples using the <