From bdfb696677a7591ced018e7597c00929e97c6837 Mon Sep 17 00:00:00 2001 From: adrianeboyd Date: Fri, 15 Nov 2019 17:08:32 +0100 Subject: [PATCH] Fix conllu2json converter to output all sentences (#4656) 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 8f2900a9b..e66a8c50e 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