From 43fc7a316d415a0e5ef9fecc02112502928c9fd3 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Tue, 29 Sep 2020 16:49:09 +0200 Subject: [PATCH] Add registry function for reading jsonl --- spacy/training/corpus.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spacy/training/corpus.py b/spacy/training/corpus.py index 12bda486e..bd431ab83 100644 --- a/spacy/training/corpus.py +++ b/spacy/training/corpus.py @@ -30,6 +30,11 @@ def create_jsonl_reader( return JsonlTexts(path, min_length=min_length, max_length=max_length, limit=limit) +@util.registry.readers("srsly.read_json.v1") +def _read_json(loc: Path): + return srsly.read_json(loc) + + def walk_corpus(path: Union[str, Path], file_type) -> List[Path]: path = util.ensure_path(path) if not path.is_dir() and path.parts[-1].endswith(file_type):