From c8691a27d6471dd68772912ac8071d9eb5a43edb Mon Sep 17 00:00:00 2001 From: Raphael Mitsch Date: Tue, 30 Jan 2024 22:14:07 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Madeesh Kannan --- website/docs/api/entitylinker.mdx | 12 ++++++------ website/docs/api/inmemorylookupkb.mdx | 3 +-- website/docs/api/kb.mdx | 4 ++-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/website/docs/api/entitylinker.mdx b/website/docs/api/entitylinker.mdx index 28dea51dd..225d62f40 100644 --- a/website/docs/api/entitylinker.mdx +++ b/website/docs/api/entitylinker.mdx @@ -55,13 +55,13 @@ architectures and their arguments and hyperparameters. | Setting | Description | | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `labels_discard` | NER labels that will automatically get a "NIL" prediction. Defaults to `[]`. ~~Iterable[str]~~ | -| `n_sents` | The number of neighbouring sentences to take into account. Defaults to 0. ~~int~~ | -| `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~~ | +| `labels_discard` | NER labels that will automatically get an "NIL" prediction. Defaults to `[]`. ~~Iterable[str]~~ | +| `n_sents` | The number of neighbouring sentences to take into account. Defaults to `0`. ~~int~~ | +| `incl_prior` | Whether prior probabilities from the KB are included in the model. Defaults to `True`. ~~bool~~ | +| `incl_context` | Whether the local context is included 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~~ | | `entity_vector_length` | Size of encoding vectors in the KB. Defaults to `64`. ~~int~~ | -| `use_gold_ents` | Whether to copy entities from the gold docs or not. Defaults to `True`. If `False`, entities must be set in the training data or by an annotating component in the pipeline. ~~int~~ | +| `use_gold_ents` | Whether entities are copied from the gold docs. Defaults to `True`. If `False`, entities must be set in the training data or by an annotating component in the pipeline. ~~int~~ | | `get_candidates` | Function that retrieves plausible candidates per entity mention in a given `Iterator[SpanGroup]`. Defaults to [CandidateGenerator](/api/architectures#CandidateGenerator). ~~Callable[[KnowledgeBase, Iterator[SpanGroup]], Iterator[Iterable[Iterable[Candidate]]]]~~ | | `generate_empty_kb` 3.6 | Function that generates an empty `KnowledgeBase` object. Defaults to [`spacy.EmptyKB.v2`](/api/architectures#EmptyKB), which generates an empty [`InMemoryLookupKB`](/api/inmemorylookupkb). ~~Callable[[Vocab, int], KnowledgeBase]~~ | | `overwrite` 3.2 | Whether existing annotation is overwritten. Defaults to `True`. ~~bool~~ | diff --git a/website/docs/api/inmemorylookupkb.mdx b/website/docs/api/inmemorylookupkb.mdx index f6d7d2314..fec6e35c0 100644 --- a/website/docs/api/inmemorylookupkb.mdx +++ b/website/docs/api/inmemorylookupkb.mdx @@ -158,8 +158,7 @@ Get a list of all aliases in the knowledge base. Given textual mentions for an arbitrary number of documents as input, retrieve a list of candidate entities of type [`InMemoryCandidate`](/api/kb#candidate) for each mention. The [`EntityLinker`](/api/entitylinker) component passes a -generator yielding all mentions to retreive candidates for as -[`SpanGroup`](/api/spangroup)) per document. The decision of how to batch +generator that yields mentions as [`SpanGroup`](/api/spangroup))s per document. The decision of how to batch candidate retrieval lookups over multiple documents is left up to the implementation of `KnowledgeBase.get_candidates()`. diff --git a/website/docs/api/kb.mdx b/website/docs/api/kb.mdx index 141876591..c69fc32ea 100644 --- a/website/docs/api/kb.mdx +++ b/website/docs/api/kb.mdx @@ -63,8 +63,8 @@ The length of the fixed-size entity vectors in the knowledge base. Given textual mentions for an arbitrary number of documents as input, retrieve a list of candidate entities of type [`Candidate`](/api/kb#candidate) for each mention. The [`EntityLinker`](/api/entitylinker) component passes a generator -yielding all mentions to retreive candidates for as -[`SpanGroup`](/api/spangroup)) per document. The decision of how to batch +that yields mentions as [`SpanGroup`](/api/spangroup))s per document. +The decision of how to batch candidate retrieval lookups over multiple documents is left up to the implementation of `KnowledgeBase.get_candidates()`.