Fix docstring and docs.

This commit is contained in:
Raphael Mitsch 2023-03-01 15:09:24 +01:00
parent 257bca3959
commit 9bd498cdae
2 changed files with 8 additions and 8 deletions

View File

@ -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__)

View File

@ -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"}