flair.datasets.entity_linking.InMemoryEntityLinkingDictionary#
- class flair.datasets.entity_linking.InMemoryEntityLinkingDictionary(candidates, dataset_name)View on GitHub#
Bases:
EntityLinkingDictionary
- __init__(candidates, dataset_name)View on GitHub#
Initialize the entity linking dictionary.
- Parameters:
candidates (
list
[EntityCandidate
]) – 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__
(candidates, dataset_name)Initialize the entity linking dictionary.
from_state
(state)to_in_memory_dictionary
()to_state
()Attributes
candidates
database_name
Name of the database represented by the dictionary.
text_to_index
- to_state()View on GitHub#
- Return type:
dict
[str
,Any
]
- classmethod from_state(state)View on GitHub#
- Return type: