The field of open-category text classification has evolved significantly with tools that can handle arbitrary categories at inference time without retraining, similar to how GLiNER revolutionized named entity recognition. GLiClass emerges as the most direct successor to GLiNER for text classification, while several other frameworks like SetFit, QZero, and modern zero-shot pipelines offer complementary approaches that share key architectural principles with GLiNER.
GLiClass represents the most faithful adaptation of GLiNER's approach to text classification. Developed by the same team at Knowledgator, it preserves GLiNER's core innovation of bidirectional encoding with parallel classification in a single forward pass, making it approximately 10x faster than traditional cross-encoders.
The tool maintains GLiNER's key architectural components: a bidirectional transformer encoder that jointly processes text and category descriptions, span-based or token-based classification options, and the ability to handle arbitrary categories defined in natural language at inference time. GLiClass extends the original approach with retrieval-augmented classification capabilities, allowing users to provide examples for each category to improve accuracy.
Repository: https://github.com/Knowledgator/GLiClass
The technical implementation uses the same latent space matching approach as GLiNER, where category embeddings and text representations are compared using dot product similarity with sigmoid activation. This enables multi-label classification with configurable thresholds while maintaining compatibility with any transformer model backbone.
SetFit (Sentence Transformer Fine-tuning) emerges as one of the most practical alternatives that shares GLiNER's efficiency goals while taking a different architectural approach. Developed by HuggingFace, SetFit achieves 67x faster inference than traditional zero-shot pipelines while often matching or exceeding their accuracy.
The framework uses a two-stage process: first, it fine-tunes a sentence transformer using contrastive learning on text pairs, then trains a lightweight classification head on the resulting embeddings. Like GLiNER, SetFit operates in a joint embedding space for text and labels, eliminating the need for prompts or verbalizers that plague traditional approaches.
Repository: https://github.com/huggingface/setfit
While SetFit focuses on sentence-level classification rather than GLiNER's span-based approach, it shares the principle of efficient bidirectional encoding and can handle new categories with minimal examples (typically 8-16 per class). The framework particularly excels in multilingual scenarios through its use of multilingual sentence transformers.
QZero represents a significant innovation in training-free classification enhancement, achieving 5%+ improvement on news classification tasks even when used with large language models. The system reformulates queries by retrieving supporting information from Wikipedia before classification, combining both sparse (BM25) and dense (Contriever) retrieval methods.
This approach complements GLiNER's methodology by adding external knowledge without requiring model retraining. QZero's architecture demonstrates how retrieval augmentation can enhance any zero-shot classifier, including those using GLiNER-like bidirectional encoding approaches.
Repository and paper available through recent ACL proceedings (2024)
ModernBERT, released in early 2025, represents the latest evolution in bidirectional encoder architectures that underpin tools like GLiNER. With an 8192 token context length (versus traditional 512 tokens) and architectural improvements including rotary positional embeddings (RoPE) and alternating attention patterns, ModernBERT achieves 2-4x faster processing while maintaining state-of-the-art accuracy.
These architectural advances directly benefit GLiNER-style approaches by enabling processing of longer documents and more efficient parallel span extraction. ModernBERT's training on 2 trillion tokens including web documents, code, and scientific articles provides a stronger foundation for open-vocabulary classification tasks.
Repository: Available on HuggingFace with backward compatibility for BERT-based models
The HuggingFace zero-shot classification pipeline, using models like facebook/bart-large-mnli and MoritzLaurer/mDeBERTa-v3-base-mnli-xnli, offers the most accessible entry point for open-category classification. These models reformulate classification as a Natural Language Inference (NLI) task, determining whether a text entails, contradicts, or is neutral toward category hypotheses.
While less efficient than GLiNER's parallel span processing, these pipelines share the ability to handle arbitrary categories without retraining. Recent models like MoritzLaurer/deberta-v3-large-zeroshot-v1.1-all-33, trained on 33 datasets with 387 classes, demonstrate strong generalization across diverse classification tasks.
Several models directly adopt GLiNER's span-based classification methodology for text classification tasks. SpanNER and similar architectures enumerate all possible text spans up to a length threshold, compute span representations by concatenating start and end token embeddings, and apply feedforward networks for direct span-to-class prediction.
These models address the cascading error problem of sequence labeling while enabling parallel processing of multiple spans, a key efficiency advantage shared with GLiNER. The span-based approach proves particularly effective for tasks requiring fine-grained text analysis or multi-label classification at the sub-sentence level.
Across these tools, several architectural patterns emerge that align with GLiNER's design philosophy. Bidirectional encoders remain the dominant choice, with BERT, DeBERTa, and their variants providing the backbone for most successful approaches. The use of joint embedding spaces for text and labels enables flexible classification without fixed category schemas.
Cross-attention mechanisms between text and label representations appear in multiple architectures, enabling rich interaction between content and categories. Contrastive learning objectives improve generalization to unseen classes, while span-based or attention-based approaches avoid the limitations of traditional token-level classification.
Performance comparisons show that specialized models like GLiClass and SetFit often match or exceed large language models on classification tasks while being orders of magnitude more efficient. This validates GLiNER's approach of using focused architectures rather than general-purpose language models for specific NLP tasks.
The ecosystem provides rich implementation options for practitioners. GLiClass offers native Python integration with pip install gliner and SpaCy compatibility. SetFit integrates seamlessly with the HuggingFace ecosystem, supporting both training and inference pipelines. Zero-shot classifiers work out-of-the-box through the transformers library's pipeline API.
For production deployment, several tools offer ONNX export capabilities and optimized inference engines. GLiNER provides C++ (GLiNER.cpp) and Rust (gline-rs) implementations for high-performance scenarios. These practical considerations make GLiNER-style approaches viable for real-world applications requiring low latency and high throughput.
The landscape of open-category text classification has rapidly evolved to embrace GLiNER's core innovations: efficient bidirectional encoding, flexible category handling, and span-based or embedding-based matching approaches. Tools like GLiClass directly extend GLiNER's methodology to classification, while frameworks like SetFit and QZero offer complementary approaches that share key architectural principles. The consistent trend toward smaller, specialized models that can handle arbitrary categories without retraining validates GLiNER's design philosophy and points toward a future where task-specific architectures outperform general-purpose language models for focused NLP applications.