Linker
The linker will link the detected entities to a existing set of labels. Some of the linkers, however, are end-to-end, i.e. they don't need the mentions extractor, as they detect and link the entities at the same time.
There are 5 linkers available currently, 3 of them are end-to-end and 2 are not.
Bases: ABC
Linker define a standard interface for entity linking. A Linker may relay on existing
extracted mentions or perform end-2-end extraction
entities: List[Entity]
property
link(docs, batch_size=None)
Perform the entity linking. Call the predict function and add entities to the Spacy Docs
Parameters:
Returns:
predict(docs, batch_size=None)
abstractmethod
Perform the entity prediction
Parameters:
Returns:
Type |
Description |
List[List[Span]]
|
List Spans for each Document in docs
|
set_device(device)
Set the device to use
Parameters:
Name |
Type |
Description |
Default |
device |
Union[str, device]
|
|
required
|
Returns:
set_kg(entities)
Set entities that linker can use
Parameters:
Name |
Type |
Description |
Default |
entities |
Iterator[Entity]
|
|
required
|