Skip to main content

Module encoder

Module encoder 

Source
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:

  1. Encoder: Transforms text to embeddings
  2. SpanMatcher: Takes embeddings + entity type embeddings and computes similarity

§Available Encoders

ModelContextNotes
BERT512Classic, widely supported
RoBERTa512Similar interface, different pretraining
DeBERTa512Alternative attention formulation
ModernBERT8192Long-context encoder

§GLiNER Models by Encoder

Model IDBase EncoderMode
onnx-community/gliner_small-v2.1DeBERTa-v3-smallSpan
onnx-community/gliner_medium-v2.1DeBERTa-v3-baseSpan
onnx-community/gliner_large-v2.1DeBERTa-v3-largeSpan
knowledgator/modern-gliner-bi-large-v1.0ModernBERT-largeSpan
knowledgator/gliner-multitask-v1.0DeBERTa-v3-baseToken

Structs§

GLiNERModel
Known GLiNER model variants.

Enums§

EncoderType
Known encoder architectures.
ModelSize
Model size category.

Statics§

GLINER_MODELS
Catalog of known GLiNER models.