Fix conllu2json converter to output all sentences (#4716)

Make sure that the last batch of sentences is output if n_sents > 1.
This commit is contained in:
adrianeboyd 2019-11-26 16:05:17 +01:00 committed by Matthew Honnibal
parent 0c9640ced3
commit 9aab0a55e1

View File

@ -34,6 +34,9 @@ def conllu2json(input_data, n_sents=10, use_morphology=False, lang=None, **_):
doc = create_doc(sentences, i)
docs.append(doc)
sentences = []
if sentences:
doc = create_doc(sentences, i)
docs.append(doc)
return docs