flair.datasets.entity_linking.EntityLinkingDictionary#
- class flair.datasets.entity_linking.EntityLinkingDictionary(candidates, dataset_name=None)View on GitHub#
Bases:
object
Base class for downloading and reading of dictionaries for entity entity linking.
A dictionary represents all entities of a knowledge base and their associated ids.
- __init__(candidates, dataset_name=None)View on GitHub#
Initialize the entity linking dictionary.
- Parameters:
candidates (
Iterable
[EntityCandidate
]) – A iterable sequence of all Candidates contained in the knowledge base.dataset_name (
Optional
[str
]) – string to prefix concept IDs. To be used for custom dictionaries.
Methods
__init__
(candidates[, dataset_name])Initialize the entity linking dictionary.
Attributes
Name of the database represented by the dictionary.
- property database_name: str#
Name of the database represented by the dictionary.
- property text_to_index: dict[str, list[str]]#
- property candidates: list[EntityCandidate]#
- to_in_memory_dictionary()View on GitHub#
- Return type: