From df87c32a4068484471f5ce53b1f4eb7e4f9e4c43 Mon Sep 17 00:00:00 2001 From: Matthw Honnibal Date: Thu, 21 May 2020 20:17:24 +0200 Subject: [PATCH] Pass smaller doc sample into model initialize --- spacy/syntax/nn_parser.pyx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spacy/syntax/nn_parser.pyx b/spacy/syntax/nn_parser.pyx index 94369a828..ed4697302 100644 --- a/spacy/syntax/nn_parser.pyx +++ b/spacy/syntax/nn_parser.pyx @@ -624,11 +624,12 @@ cdef class Parser: sgd = self.create_optimizer() doc_sample = [] gold_sample = [] - for example in islice(get_examples(), 1000): + for example in islice(get_examples(), 10): parses = example.get_gold_parses(merge=False, vocab=self.vocab) for doc, gold in parses: - doc_sample.append(doc) - gold_sample.append(gold) + if len(doc): + doc_sample.append(doc) + gold_sample.append(gold) for name, component in pipeline: if component is self: break