Update spacy/training/corpus.py

Co-authored-by: Adriane Boyd <adrianeboyd@gmail.com>
This commit is contained in:
Daniël de Kok 2023-01-18 14:02:44 +01:00 committed by Daniël de Kok
parent d4fa60cc8a
commit e8b03412f9

View File

@ -314,8 +314,6 @@ class PlainTextCorpus:
continue
elif self.max_length >= 1 and len(doc) > self.max_length:
continue
words = [w.text for w in doc]
spaces = [bool(w.whitespace_) for w in doc]
# We don't *need* an example here, but it seems nice to
# make it match the Corpus signature.
yield Example(doc, Doc(nlp.vocab, words=words, spaces=spaces))
yield Example(doc, doc.copy())