Use Candidate output type for toy generators in the test suite to mimick best practices

This commit is contained in:
Sofie Van Landeghem 2023-03-19 23:27:20 +01:00 committed by GitHub
parent faede7155c
commit 9e71adc074
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -510,13 +510,13 @@ def test_el_pipe_configuration(nlp):
@registry.misc("spacy.LowercaseCandidateGenerator.v1")
def create_candidates() -> Callable[
[InMemoryLookupKB, "Span"], Iterable[InMemoryCandidate]
[InMemoryLookupKB, "Span"], Iterable[Candidate]
]:
return get_lowercased_candidates
@registry.misc("spacy.LowercaseCandidateBatchGenerator.v1")
def create_candidates_batch() -> Callable[
[InMemoryLookupKB, Iterable["Span"]], Iterable[Iterable[InMemoryCandidate]]
[InMemoryLookupKB, Iterable["Span"]], Iterable[Iterable[Candidate]]
]:
return get_lowercased_candidates_batch