From 2dfd91958523e4279c23accccd3435fc474a19a7 Mon Sep 17 00:00:00 2001 From: svlandeg Date: Wed, 19 Aug 2020 14:52:49 +0200 Subject: [PATCH] add kb_loader and get_candidates back to EL API --- website/docs/api/architectures.md | 2 +- website/docs/api/entitylinker.md | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/website/docs/api/architectures.md b/website/docs/api/architectures.md index 446e6c7c3..da1a64068 100644 --- a/website/docs/api/architectures.md +++ b/website/docs/api/architectures.md @@ -622,7 +622,7 @@ others, but may not be as accurate, especially if texts are short. An [`EntityLinker`](/api/entitylinker) component disambiguates textual mentions (tagged as named entities) to unique identifiers, grounding the named entities -into the "real world". This requires 3 main component +into the "real world". This requires 3 main components: - A [`KnowledgeBase`](/api/kb) (KB) holding the unique identifiers, potential synonyms and prior probabilities. diff --git a/website/docs/api/entitylinker.md b/website/docs/api/entitylinker.md index a1bc52199..8b3875f9d 100644 --- a/website/docs/api/entitylinker.md +++ b/website/docs/api/entitylinker.md @@ -40,13 +40,14 @@ architectures and their arguments and hyperparameters. > nlp.add_pipe("entity_linker", config=config) > ``` -| Setting | Description | -| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `labels_discard` | NER labels that will automatically get a "NIL" prediction. Defaults to `[]`. ~~Iterable[str]~~ | -| `incl_prior` | Whether or not to include prior probabilities from the KB in the model. Defaults to `True`. ~~bool~~ | -| `incl_context` | Whether or not to include the local context in the model. Defaults to `True`. ~~bool~~ | -| `model` | The [`Model`](https://thinc.ai/docs/api-model) powering the pipeline component. Defaults to [EntityLinker](/api/architectures#EntityLinker). ~~Model~~ | -| `kb` | The [`KnowledgeBase`](/api/kb). Defaults to [EmptyKB](/api/architectures#EmptyKB), a function returning an empty `KnowledgeBase` with an `entity_vector_length` of `64`. ~~KnowledgeBase~~ | +| Setting | Description | +| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `labels_discard` | NER labels that will automatically get a "NIL" prediction. Defaults to `[]`. ~~Iterable[str]~~ | +| `incl_prior` | Whether or not to include prior probabilities from the KB in the model. Defaults to `True`. ~~bool~~ | +| `incl_context` | Whether or not to include the local context in the model. Defaults to `True`. ~~bool~~ | +| `model` | The [`Model`](https://thinc.ai/docs/api-model) powering the pipeline component. Defaults to [EntityLinker](/api/architectures#EntityLinker). ~~Model~~ | +| `kb_loader` | Function that creates a [`KnowledgeBase`](/api/kb) from a `Vocab` instance. Defaults to [EmptyKB](/api/architectures#EmptyKB), a function returning an empty `KnowledgeBase` with an `entity_vector_length` of `64`. ~~Callable[[Vocab], KnowledgeBase]~~ | +| `get_candidates` | Function that generates plausible candidates for a given `Span` object. Defaults to [CandidateGenerator](/api/architectures#CandidateGenerator), a function looking up exact, case-dependent aliases in the KB. ~~Callable[[KnowledgeBase, Span], Iterable[Candidate]]~~ | ```python https://github.com/explosion/spaCy/blob/develop/spacy/pipeline/entity_linker.py