From 0b32a949f1412f23caa7bea5034142da5c9a90d9 Mon Sep 17 00:00:00 2001 From: Lj Miranda Date: Tue, 29 Nov 2022 11:14:43 +0800 Subject: [PATCH] Remove mypy ignore and typecast labels to list --- spacy/pipeline/spancat_exclusive.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacy/pipeline/spancat_exclusive.py b/spacy/pipeline/spancat_exclusive.py index 5c9953718..b3b33c04e 100644 --- a/spacy/pipeline/spancat_exclusive.py +++ b/spacy/pipeline/spancat_exclusive.py @@ -191,7 +191,7 @@ class Exclusive_SpanCategorizer(SpanCategorizer): DOCS: https://spacy.io/api/spancatcategorizer#set_annotations """ allow_overlap = cast(bool, self.cfg["allow_overlap"]) - labels = self.labels + labels = list(self.labels) indices, scores = indices_scores offset = 0 for i, doc in enumerate(docs): @@ -200,7 +200,7 @@ class Exclusive_SpanCategorizer(SpanCategorizer): doc, indices_i, scores[offset : offset + indices.lengths[i]], - labels, # type: ignore[arg-type] + labels, allow_overlap, ) offset += indices.lengths[i]