mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-24 00:46:28 +03:00
Fix converter CLI
This commit is contained in:
parent
5a87bcf35f
commit
2b3b937a04
|
@ -7,7 +7,6 @@ from pathlib import Path
|
|||
from .converters import conllu2json, iob2json
|
||||
from ..util import prints
|
||||
|
||||
|
||||
# Converters are matched by file extension. To add a converter, add a new entry
|
||||
# to this dict with the file extension mapped to the converter function imported
|
||||
# from /converters.
|
||||
|
@ -25,7 +24,7 @@ CONVERTERS = {
|
|||
n_sents=("Number of sentences per doc", "option", "n", float),
|
||||
morphology=("Enable appending morphology to tags", "flag", "m", bool)
|
||||
)
|
||||
def convert(input_file, output_dir, n_sents, morphology):
|
||||
def convert(_, input_file, output_dir, n_sents, morphology):
|
||||
"""Convert files into JSON format for use with train command and other
|
||||
experiment management functions.
|
||||
"""
|
||||
|
@ -39,4 +38,5 @@ def convert(input_file, output_dir, n_sents, morphology):
|
|||
if not file_ext in CONVERTERS:
|
||||
prints("Can't find converter for %s" % input_path.parts[-1],
|
||||
title="Unknown format", exits=1)
|
||||
CONVERTERS[file_ext](input_path, output_path, *args)
|
||||
CONVERTERS[file_ext](input_path, output_path,
|
||||
n_sents=n_sents, morphology=morphology)
|
||||
|
|
Loading…
Reference in New Issue
Block a user