diff --git a/spacy/pipeline/spancat.py b/spacy/pipeline/spancat.py index c517991f55a..c0e07a57ef2 100644 --- a/spacy/pipeline/spancat.py +++ b/spacy/pipeline/spancat.py @@ -311,8 +311,9 @@ def set_annotations(self, docs: Iterable[Doc], activations: ActivationsT) -> Non labels = self.labels indices = activations["indices"] + scores = activations["scores"] assert isinstance(indices, Ragged) - scores = cast(Floats2d, activations["scores"]) + assert isinstance(scores, Floats2d) offset = 0 for i, doc in enumerate(docs):