mirror of
https://github.com/explosion/spaCy.git
synced 2025-02-11 09:00:36 +03:00
Fix Corpus
This commit is contained in:
parent
450c6fe39c
commit
396dd60b3a
|
@ -68,9 +68,11 @@ class Corpus:
|
|||
i += 1
|
||||
return n
|
||||
|
||||
def train_dataset(self, nlp, **kwargs):
|
||||
def train_dataset(self, nlp, shuffle=True, **kwargs):
|
||||
ref_docs = self.read_docbin(nlp.vocab, self.walk_corpus(self.train_loc))
|
||||
examples = list(self.make_examples(nlp, ref_docs, **kwargs))
|
||||
examples = self.make_examples(nlp, ref_docs, **kwargs)
|
||||
if shuffle:
|
||||
examples = list(examples)
|
||||
random.shuffle(examples)
|
||||
yield from examples
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user