Skip to content

GLiNER Linker

GLiNER is a Named Entity Recognition (NER) model capable of identifying any entity type using a bidirectional transformer encoder (BERT-like). It provides a practical alternative to traditional NER models, which are limited to predefined entities, and Large Language Models (LLMs) that, despite their flexibility, are costly and large for resource-constrained scenarios.

The GLiNER linker will use the entities specified in the zshot.PipelineConfig, it just uses the names of the entities, it doesn't use the descriptions of the entities.

Bases: Linker

GLINER linker

is_end2end property

GLINER is end2end model

load_models()

Load GLINER model

predict(docs, batch_size=None)

Perform the entity prediction

Parameters:

Name Type Description Default
docs Iterator[Doc]

A list of spacy Document

required
batch_size Optional[Union[int, None]]

The batch size

None

Returns:

Type Description
List[List[Span]]

List Spans for each Document in docs