AnchorTokenizer
- class AnchorTokenizer(selection=None, selection_kwargs=None, searcher=None, searcher_kwargs=None)[source]
Bases:
TokenizerTokenize entities by representing them as a bag of anchor entities.
The entities are chosen by shortest path distance.
Initialize the tokenizer.
- Parameters:
selection (
Union[str,AnchorSelection,Type[AnchorSelection],None]) – the anchor node selection strategy.selection_kwargs (
Optional[Mapping[str,Any]]) – additional keyword-based arguments passed to the selection strategysearcher (
Union[str,AnchorSearcher,Type[AnchorSearcher],None]) – the component for searching the closest anchors for each entitysearcher_kwargs (
Optional[Mapping[str,Any]]) – additional keyword-based arguments passed to the searcher
Methods Summary
__call__(mapped_triples, num_tokens, ...)Tokenize the entities contained given the triples.
Methods Documentation