mirror of
https://github.com/explosion/spaCy.git
synced 2025-08-06 21:30:22 +03:00
Use .sum() as in update
This commit is contained in:
parent
4ecccf8460
commit
965bbb3e0d
|
@ -272,7 +272,7 @@ class SpanCategorizer(TrainablePipe):
|
||||||
DOCS: https://spacy.io/api/spancategorizer#predict
|
DOCS: https://spacy.io/api/spancategorizer#predict
|
||||||
"""
|
"""
|
||||||
indices = self.suggester(docs, ops=self.model.ops)
|
indices = self.suggester(docs, ops=self.model.ops)
|
||||||
if sum(indices.lengths) == 0:
|
if indices.lengths.sum() == 0:
|
||||||
scores = self.model.ops.alloc2f(0, 0)
|
scores = self.model.ops.alloc2f(0, 0)
|
||||||
else:
|
else:
|
||||||
scores = self.model.predict((docs, indices)) # type: ignore
|
scores = self.model.predict((docs, indices)) # type: ignore
|
||||||
|
|
Loading…
Reference in New Issue
Block a user