Fix textcat.begin_training if vectors set

This commit is contained in:
Matthew Honnibal 2020-08-05 15:40:36 +02:00
parent af125875cf
commit b9df4d6116

View File

@ -355,7 +355,7 @@ class TextCategorizer(Pipe):
for cat in y.cats:
self.add_label(cat)
self.require_labels()
docs = [Doc(Vocab(), words=["hello"])]
docs = [Doc(self.vocab, words=["hello"])]
truths, _ = self._examples_to_truth(examples)
self.set_output(len(self.labels))
self.model.initialize(X=docs, Y=truths)