Skip to main content

Intro

GLiFormer is a framework for multitask information extraction, built on GLiNER. It combines a shared encoder with task-specific heads to turn text into entities, classes, relations, structured records, and embeddings. You provide labels and extraction schemas at inference time.

Supported Tasks

GLiFormer tasks: entity recognition, relation extraction, classification, structured extraction, and semantic similarity

TaskInput schemaOutput
Named entity recognitionEntity types, such as person and organizationLabeled mentions with character offsets and confidence scores
Text classificationCandidate classes or named groups of classesClass labels and confidence scores
Joint relation extractionEntity types and relation typesRelations connecting extracted entities
Structured extractionField names or nested Pydantic modelsFlat or nested records as dictionaries and lists
Text embeddingsTexts to encodeVectors for similarity and retrieval

The figure illustrates the framework's task families. For the v1 checkpoints, relation extraction requires both entity and relation labels. See Usage for the exact input and output formats.

Model Architecture

GLiFormer encodes text and task prompts through a shared backbone. Task heads use those representations to score spans, classes, relations, and record fields. The structuring decoder assembles extracted fields and parent–child relationships into nested records.

GLiFormer model architecture with a shared encoder and task-specific prediction heads

The Base v1 and Large v1 checkpoints use a layout-aware DeBERTa encoder and include all five text task heads above. They accept new labels and schemas without changing the model weights; prediction quality depends on the task, domain, and schema wording.

Framework Architecture

GLiFormer configuration, public interface, shared services, task modules, and reusable components

The public GLiFormer factory selects a model wrapper from the checkpoint configuration. Each task has a processor for preparing inputs, a neural head for predictions, and a decoder for producing usable outputs.

The framework includes Text, Layout, Vision, Audio, and Omni variants. Available tasks depend on the heads and modalities trained in a checkpoint. Base v1 and Large v1 have no dedicated vision, audio, or open relation head. Their reported evaluations cover English text; document-layout and embedding benchmark quality are not established by those results.

Next Steps

  • Installation: set up the framework and optional dependencies.
  • Quickstart: load a model and extract your first entities.
  • Usage: run individual tasks, nested schemas, and multitask inference.
  • Pretrained Models: compare Base v1 and Large v1.
  • Training: fine-tune a checkpoint on annotated examples.

Source code: Knowledgator/GLiFormer.