Skip to content

ReLiK Linker

ReLiK is a lightweight and fast model for Entity Linking and Relation Extraction. It is composed of two main components: a retriever and a reader. The retriever is responsible for retrieving relevant documents from a large collection, while the reader is responsible for extracting entities and relations from the retrieved documents.

In Zshot, we created a linker to use ReLiK, and it works both providing entities or without providing entities, and with descriptions.

This is an end-to-end model, so there is no need to use a mentions extractor before.

The ReLiK linker will use the entities specified in the zshot.PipelineConfig, if any.

Bases: Linker

Relik linker

is_end2end property

relik is end2end

load_models()

Load relik 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