|
@@ -159,7 +159,10 @@ class _FastText(object):
|
|
|
else:
|
|
else:
|
|
|
text = check(text)
|
|
text = check(text)
|
|
|
predictions = self.f.predict(text, k, threshold, on_unicode_error)
|
|
predictions = self.f.predict(text, k, threshold, on_unicode_error)
|
|
|
- probs, labels = zip(*predictions)
|
|
|
|
|
|
|
+ if predictions:
|
|
|
|
|
+ probs, labels = zip(*predictions)
|
|
|
|
|
+ else:
|
|
|
|
|
+ probs, labels = ([], ())
|
|
|
|
|
|
|
|
return labels, np.array(probs, copy=False)
|
|
return labels, np.array(probs, copy=False)
|
|
|
|
|
|