From d6c4dd6eea49474485ea4107dece413bcd3a7061 Mon Sep 17 00:00:00 2001 From: svlandeg Date: Wed, 17 Jun 2020 21:29:36 +0200 Subject: [PATCH] pipe() takes docs, not examples --- spacy/syntax/nn_parser.pyx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spacy/syntax/nn_parser.pyx b/spacy/syntax/nn_parser.pyx index 14b350067..bc6b5c0c2 100644 --- a/spacy/syntax/nn_parser.pyx +++ b/spacy/syntax/nn_parser.pyx @@ -164,8 +164,7 @@ cdef class Parser: cdef Doc doc for batch in util.minibatch(docs, size=batch_size): batch_in_order = list(batch) - docs = [ex.predicted for ex in batch_in_order] - by_length = sorted(docs, key=lambda doc: len(doc)) + by_length = sorted(batch, key=lambda doc: len(doc)) for subbatch in util.minibatch(by_length, size=max(batch_size//4, 2)): subbatch = list(subbatch) parse_states = self.predict(subbatch)