From 9bd498cdaeb8bcf6ea49e8d401bf17d3f00c5e3d Mon Sep 17 00:00:00 2001 From: Raphael Mitsch Date: Wed, 1 Mar 2023 15:09:24 +0100 Subject: [PATCH] Fix docstring and docs. --- spacy/kb/kb.pyx | 4 ++-- website/docs/api/kb.mdx | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/spacy/kb/kb.pyx b/spacy/kb/kb.pyx index 6dae19205..ce4bc0138 100644 --- a/spacy/kb/kb.pyx +++ b/spacy/kb/kb.pyx @@ -36,7 +36,7 @@ cdef class KnowledgeBase: and the prior probability of that alias resolving to that entity. If no candidate is found for a given text, an empty list is returned. mentions (Iterable[Span]): Mentions for which to get candidates. - RETURNS (Iterable[Iterable[InMemoryCandidate]]): Identified candidates. + RETURNS (Iterable[Iterable[Candidate]]): Identified candidates. """ return [self.get_candidates(span) for span in mentions] @@ -46,7 +46,7 @@ cdef class KnowledgeBase: and the prior probability of that alias resolving to that entity. If the no candidate is found for a given text, an empty list is returned. mention (Span): Mention for which to get candidates. - RETURNS (Iterable[InMemoryCandidate]): Identified candidates. + RETURNS (Iterable[Candidate]): Identified candidates. """ raise NotImplementedError( Errors.E1045.format(parent="KnowledgeBase", method="get_candidates", name=self.__name__) diff --git a/website/docs/api/kb.mdx b/website/docs/api/kb.mdx index 9107233fa..5c5abaef9 100644 --- a/website/docs/api/kb.mdx +++ b/website/docs/api/kb.mdx @@ -9,8 +9,8 @@ version: 2.2 --- The `KnowledgeBase` object is an abstract class providing a method to generate -[`InMemoryCandidate`](/api/kb#candidate) objects, which are plausible external -identifiers given a certain textual mention. Each such `InMemoryCandidate` holds +[`Candidate`](/api/kb#candidate) objects, which are plausible external +identifiers given a certain textual mention. Each such `Candidate` holds information from the relevant KB entities, such as its frequency in text and possible aliases. Each entity in the knowledge base also has a pretrained entity vector of a fixed size. @@ -72,10 +72,10 @@ of type [`Candidate`](/api/kb#candidate). > candidates = kb.get_candidates(doc[0:2]) > ``` -| Name | Description | -| ----------- | ---------------------------------------------------------------------------- | -| `mention` | The textual mention or alias. ~~Span~~ | -| **RETURNS** | An iterable of relevant `Candidate` objects. ~~Iterable[InMemoryCandidate]~~ | +| Name | Description | +| ----------- | -------------------------------------------------------------------- | +| `mention` | The textual mention or alias. ~~Span~~ | +| **RETURNS** | An iterable of relevant `Candidate` objects. ~~Iterable[Candidate]~~ | ## KnowledgeBase.get_candidates_batch {id="get_candidates_batch",tag="method"}