pipe() takes docs, not examples

This commit is contained in:
svlandeg 2020-06-17 21:29:36 +02:00
parent 0f123af35e
commit d6c4dd6eea

View File

@ -164,8 +164,7 @@ cdef class Parser:
cdef Doc doc cdef Doc doc
for batch in util.minibatch(docs, size=batch_size): for batch in util.minibatch(docs, size=batch_size):
batch_in_order = list(batch) batch_in_order = list(batch)
docs = [ex.predicted for ex in batch_in_order] by_length = sorted(batch, key=lambda doc: len(doc))
by_length = sorted(docs, key=lambda doc: len(doc))
for subbatch in util.minibatch(by_length, size=max(batch_size//4, 2)): for subbatch in util.minibatch(by_length, size=max(batch_size//4, 2)):
subbatch = list(subbatch) subbatch = list(subbatch)
parse_states = self.predict(subbatch) parse_states = self.predict(subbatch)