tensorizer return parameter fix

This commit is contained in:
uwol 2017-11-05 12:25:10 +01:00
parent 0a27afbf86
commit a2162b8908

View File

@ -777,7 +777,8 @@ class TextCategorizer(Pipe):
def predict(self, docs): def predict(self, docs):
scores = self.model(docs) scores = self.model(docs)
scores = self.model.ops.asarray(scores) scores = self.model.ops.asarray(scores)
return scores tensors = [doc.tensor for doc in docs]
return scores, tensors
def set_annotations(self, docs, scores, tensors=None): def set_annotations(self, docs, scores, tensors=None):
for i, doc in enumerate(docs): for i, doc in enumerate(docs):