mirror of
https://github.com/explosion/spaCy.git
synced 2025-04-28 21:03:41 +03:00
Remove mypy ignore and typecast labels to list
This commit is contained in:
parent
14ae4a52c0
commit
0b32a949f1
|
@ -191,7 +191,7 @@ class Exclusive_SpanCategorizer(SpanCategorizer):
|
||||||
DOCS: https://spacy.io/api/spancatcategorizer#set_annotations
|
DOCS: https://spacy.io/api/spancatcategorizer#set_annotations
|
||||||
"""
|
"""
|
||||||
allow_overlap = cast(bool, self.cfg["allow_overlap"])
|
allow_overlap = cast(bool, self.cfg["allow_overlap"])
|
||||||
labels = self.labels
|
labels = list(self.labels)
|
||||||
indices, scores = indices_scores
|
indices, scores = indices_scores
|
||||||
offset = 0
|
offset = 0
|
||||||
for i, doc in enumerate(docs):
|
for i, doc in enumerate(docs):
|
||||||
|
@ -200,7 +200,7 @@ class Exclusive_SpanCategorizer(SpanCategorizer):
|
||||||
doc,
|
doc,
|
||||||
indices_i,
|
indices_i,
|
||||||
scores[offset : offset + indices.lengths[i]],
|
scores[offset : offset + indices.lengths[i]],
|
||||||
labels, # type: ignore[arg-type]
|
labels,
|
||||||
allow_overlap,
|
allow_overlap,
|
||||||
)
|
)
|
||||||
offset += indices.lengths[i]
|
offset += indices.lengths[i]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user