From aea1c93a0503bb61c18a44ceb376a2600d0cace5 Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Sat, 11 May 2019 21:12:09 +0200 Subject: [PATCH] Replace cytoolz.partition_all with util.minibatch --- spacy/cli/converters/iob2json.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacy/cli/converters/iob2json.py b/spacy/cli/converters/iob2json.py index b6fde31a4..e0086afa0 100644 --- a/spacy/cli/converters/iob2json.py +++ b/spacy/cli/converters/iob2json.py @@ -2,9 +2,9 @@ from __future__ import unicode_literals import re -from cytoolz import partition_all from ...gold import iob_to_biluo +from ...util import minibatch def iob2json(input_data, n_sents=10, *args, **kwargs): @@ -46,7 +46,7 @@ def read_iob(raw_sents): def merge_sentences(docs, n_sents): merged = [] - for group in partition_all(n_sents, docs): + for group in minibatch(docs, size=n_sents): group = list(group) first = group.pop(0) to_extend = first["paragraphs"][0]["sentences"]