From 51c485da09ef7e87d714725cfa31ab8523a6c1c9 Mon Sep 17 00:00:00 2001 From: Raphael Mitsch Date: Wed, 14 Dec 2022 11:53:39 +0100 Subject: [PATCH] Fix candidate retrieval interface. --- spacy/kb/kb.pyx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/spacy/kb/kb.pyx b/spacy/kb/kb.pyx index 12156590d..b72378323 100644 --- a/spacy/kb/kb.pyx +++ b/spacy/kb/kb.pyx @@ -41,16 +41,15 @@ cdef class KnowledgeBase: RETURNS (Iterator[Iterable[Iterable[Candidate]]]): Identified candidates per document. """ for doc in docs: - yield [self.get_candidates(ent_span, doc) for ent_span in doc.ents] + yield [self.get_candidates(ent_span) for ent_span in doc.ents] - def get_candidates(self, mention: Span, doc: Optional[Doc] = None) -> Iterable[Candidate]: + def get_candidates(self, mention: Span) -> Iterable[Candidate]: """ Return candidate entities for specified text. Each candidate defines the entity, the original alias, 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. Note that doc is not utilized for further context in this implementation. mention (Span): Mention for which to get candidates. - doc (Optional[Doc]): Doc to use for context. RETURNS (Iterable[Candidate]): Identified candidates. """ raise NotImplementedError(