From b398cca5cc50ef1f51b79505990b53c83287cf63 Mon Sep 17 00:00:00 2001 From: Raphael Mitsch Date: Fri, 4 Nov 2022 12:46:03 +0100 Subject: [PATCH] Replace leftover Generator typing with Iterator. --- spacy/kb/kb.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacy/kb/kb.pyx b/spacy/kb/kb.pyx index 2e99ea493..b2ff80834 100644 --- a/spacy/kb/kb.pyx +++ b/spacy/kb/kb.pyx @@ -1,7 +1,7 @@ # cython: infer_types=True, profile=True from pathlib import Path -from typing import Iterable, Tuple, Union, Generator +from typing import Iterable, Tuple, Union, Iterator from cymem.cymem cimport Pool from .candidate import Candidate @@ -30,7 +30,7 @@ cdef class KnowledgeBase: self.entity_vector_length = entity_vector_length self.mem = Pool() - def get_candidates_all(self, mentions: Generator[Iterable[Span]]) -> Generator[Iterable[Iterable[Candidate]]]: + def get_candidates_all(self, mentions: Iterator[Iterable[Span]]) -> Iterator[Iterable[Iterable[Candidate]]]: """ Return candidate entities for specified texts. Each candidate defines the entity, the original alias, and the prior probability of that alias resolving to that entity.