Expand description
Encoder abstraction for GLiNER and span matching models.
§Design
GLiNER separates the encoder (BERT/RoBERTa/ModernBERT) from the span matching head. This module provides abstractions for:
- Encoder: Transforms text to embeddings
- SpanMatcher: Takes embeddings + entity type embeddings and computes similarity
§Available Encoders
| Model | Context | Notes |
|---|---|---|
| BERT | 512 | Classic, widely supported |
| RoBERTa | 512 | Similar interface, different pretraining |
| DeBERTa | 512 | Alternative attention formulation |
| ModernBERT | 8192 | Long-context encoder |
§GLiNER Models by Encoder
| Model ID | Base Encoder | Mode |
|---|---|---|
onnx-community/gliner_small-v2.1 | DeBERTa-v3-small | Span |
onnx-community/gliner_medium-v2.1 | DeBERTa-v3-base | Span |
onnx-community/gliner_large-v2.1 | DeBERTa-v3-large | Span |
knowledgator/modern-gliner-bi-large-v1.0 | ModernBERT-large | Span |
knowledgator/gliner-multitask-v1.0 | DeBERTa-v3-base | Token |
Structs§
- GLiNER
Model - Known GLiNER model variants.
Enums§
- Encoder
Type - Known encoder architectures.
- Model
Size - Model size category.
Statics§
- GLINER_
MODELS - Catalog of known GLiNER models.