mirror of
https://github.com/explosion/spaCy.git
synced 2025-07-11 00:32:40 +03:00
Fix mypy error.
This commit is contained in:
parent
c187b13d2b
commit
9391de674b
|
@ -138,9 +138,9 @@ def get_candidates(kb: KnowledgeBase, mention: Span) -> Iterable[Candidate]:
|
||||||
mention (Span): Entity mention.
|
mention (Span): Entity mention.
|
||||||
RETURNS (Iterable[Candidate]): Identified candidates for specified mention.
|
RETURNS (Iterable[Candidate]): Identified candidates for specified mention.
|
||||||
"""
|
"""
|
||||||
return next(
|
cands_per_doc = next(get_candidates_v2(kb, iter([SpanGroup(mention.doc, spans=[mention])])))
|
||||||
next(get_candidates_v2(kb, iter([SpanGroup(mention.doc, spans=[mention])])))[0] # type: ignore[index]
|
assert isinstance(cands_per_doc, list)
|
||||||
)
|
return next(cands_per_doc[0])
|
||||||
|
|
||||||
|
|
||||||
def get_candidates_v2(
|
def get_candidates_v2(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user