mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 09:26:27 +03:00
spancat: replace a cast by an assertion
This commit is contained in:
parent
b828954fb6
commit
0bd5730d16
|
@ -311,8 +311,9 @@ class SpanCategorizer(TrainablePipe):
|
|||
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):
|
||||
|
|
Loading…
Reference in New Issue
Block a user