From 9aab0a55e1aaa2544d1d1e294bd9e87f3db626de Mon Sep 17 00:00:00 2001 From: adrianeboyd Date: Tue, 26 Nov 2019 16:05:17 +0100 Subject: [PATCH] Fix conllu2json converter to output all sentences (#4716) Make sure that the last batch of sentences is output if n_sents > 1. --- spacy/cli/converters/conllu2json.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spacy/cli/converters/conllu2json.py b/spacy/cli/converters/conllu2json.py index ff720f4bf..c0fd58fb0 100644 --- a/spacy/cli/converters/conllu2json.py +++ b/spacy/cli/converters/conllu2json.py @@ -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