mirror of
https://github.com/explosion/spaCy.git
synced 2025-03-03 10:55:52 +03:00
test for custom readers with ml_datasets >= 0.2
This commit is contained in:
parent
0d1392340f
commit
714a5a05c6
|
@ -181,9 +181,9 @@ class TextCategorizer(Pipe):
|
||||||
|
|
||||||
DOCS: https://nightly.spacy.io/api/textcategorizer#predict
|
DOCS: https://nightly.spacy.io/api/textcategorizer#predict
|
||||||
"""
|
"""
|
||||||
tensors = [doc.tensor for doc in docs]
|
|
||||||
if not any(len(doc) for doc in docs):
|
if not any(len(doc) for doc in docs):
|
||||||
# Handle cases where there are no tokens in any docs.
|
# Handle cases where there are no tokens in any docs.
|
||||||
|
tensors = [doc.tensor for doc in docs]
|
||||||
xp = get_array_module(tensors)
|
xp = get_array_module(tensors)
|
||||||
scores = xp.zeros((len(docs), len(self.labels)))
|
scores = xp.zeros((len(docs), len(self.labels)))
|
||||||
return scores
|
return scores
|
||||||
|
|
Loading…
Reference in New Issue
Block a user