OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Models

Glirel

GLiREL is a Python relation-extraction model and library that predicts relationships between entities in text, including relation types not seen during training. It accepts candidate labels and can be used directly or as a component in a spaCy pipeline.

Independent OpenViST project profile, based on linked sources.

Glirel — OpenViST project profile in AI Models.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use GLiREL when a text-processing workflow needs to identify relationships between entities using labels that can be specified at inference time.

Who it is for

  • NLP developers building information-extraction workflows
  • Teams that need to identify task-specific relationships between entities in text
  • Python users integrating relation extraction into spaCy

Documented uses

  • Classify entity pairs using relation labels chosen for a particular task.
  • Constrain candidate relationships by the allowed entity types for each head and tail.
  • Add relation extraction to a spaCy text-processing pipeline.
Before you choose

Requirements & limits

  • Direct prediction uses tokenized text, candidate labels and entity spans.
  • The spaCy example places GLiREL after NER and passes relation-label configuration at inference time.
  • The README demonstrates constraints on allowable head and tail entity types.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Set up direct relation prediction

Install GLiREL and prepare a Python workflow that loads a pretrained model for relation prediction.

Before you start

  • Python
  • The GLiREL package, installed with pip
  • spaCy and an English model such as en_core_web_sm, as used in the example

Steps

  1. Install the package with pip install glirel.

  2. Import GLiREL and load the documented pretrained model with GLiREL.from_pretrained.

  3. Use spaCy to tokenize text, then provide the tokens, candidate relation labels and entity spans to predict_relations.

Expected outcome

A Python workflow that returns predicted relations with head and tail entities, labels and scores.

Guide limitations

  • The example supplies entity spans directly; it does not document an end-to-end named-entity recognition setup for this direct workflow.
  • The README example uses an English spaCy model.
Source-based practical guide

Add GLiREL to a spaCy pipeline

Configure a spaCy pipeline to include GLiREL after the named-entity recognition component.

Before you start

  • Python
  • GLiREL and spaCy
  • A spaCy model with an NER component, such as en_core_web_sm

Steps

  1. Load the spaCy model.

  2. Add the GLiREL component to the pipeline after ner.

  3. Pass text and a glirel_labels configuration through nlp.pipe, then read the relations from the document.

Expected outcome

A spaCy document whose relations can be retrieved from its GLiREL relation data.

Guide limitations

  • The README illustrates this with an English pipeline.
  • The example configures relation labels and entity-type constraints; it does not specify a universal label set.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
18 October 2026
Original website title
jackboyla/GLiREL · Official homepage title · retained in its source language