flair.datasets.entity_linking.HunerEntityLinkingDictionary#
- class flair.datasets.entity_linking.HunerEntityLinkingDictionary(path, dataset_name)View on GitHub#
Bases:
EntityLinkingDictionary
Base dictionary with data already in huner format.
Every line in the file must be formatted as follows:
concept_id||concept_name
If multiple concept ids are associated to a given name they have to be separated by a |, e.g.
7157||TP53|tumor protein p53
- __init__(path, dataset_name)View on GitHub#
Initialize the entity linking dictionary.
- Parameters:
candidates – A iterable sequence of all Candidates contained in the knowledge base.
dataset_name (
str
) – string to prefix concept IDs. To be used for custom dictionaries.
Methods
__init__
(path, dataset_name)Initialize the entity linking dictionary.
to_in_memory_dictionary
()Attributes
candidates
database_name
Name of the database represented by the dictionary.
text_to_index