Skip to content

Blink

BLINK is an Entity Linking model released by Facebook that uses Wikipedia as the target knowledge base. The process of linking entities to Wikipedia is also known as Wikification.

In a nutshell, BLINK uses a two stages approach for entity linking, based on fine-tuned BERT architectures. In the first stage, BLINK performs retrieval in a dense space defined by a bi-encoder that independently embeds the mention context and the entity descriptions. Each candidate is then examined more carefully with a cross-encoder, that concatenates the mention and entity text. BLINK achieves state-of-the-art results on multiple datasets.

BLINK Overview

The BLINK knowledge base (entity library) is based on the 2019/08/01 Wikipedia dump, so the target entities are Wikipedia entities or articles.

Bases: Linker

Blink linker

Parameters:

Name Type Description Default
index

Index to use to perform the entity linking. One of: - BlinkIndex.FLAT - BlinkIndex.HNSW

FLAT

entities_list: List[str] property

Get list of entities

local_id2wikipedia_id property

Get the Wikipedia ID from the label predicted

download_models()

Download Blink files

load_models()

Load models

local_name2wikipedia_url(label)

Get the Wikipedia URL of the label predicted to perform wikification

Parameters:

Name Type Description Default
label str

Label to get URL of

required

Returns:

Type Description
str

URL of the Wikipedia article

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