From e8b03412f9aa34c961a07f1541e67f35aef72b2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20de=20Kok?= Date: Wed, 18 Jan 2023 14:02:44 +0100 Subject: [PATCH] Update spacy/training/corpus.py Co-authored-by: Adriane Boyd --- spacy/training/corpus.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/spacy/training/corpus.py b/spacy/training/corpus.py index 609733792..b57f14898 100644 --- a/spacy/training/corpus.py +++ b/spacy/training/corpus.py @@ -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())