mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
Prefix dummy argument names with underscore
This commit is contained in:
parent
cc9df10e69
commit
a9ff6eadc9
|
@ -24,7 +24,7 @@ CONVERTERS = {
|
||||||
n_sents=("Number of sentences per doc", "option", "n", int),
|
n_sents=("Number of sentences per doc", "option", "n", int),
|
||||||
converter=("Name of converter (auto, iob, conllu or ner)", "option", "c", str),
|
converter=("Name of converter (auto, iob, conllu or ner)", "option", "c", str),
|
||||||
morphology=("Enable appending morphology to tags", "flag", "m", bool))
|
morphology=("Enable appending morphology to tags", "flag", "m", bool))
|
||||||
def convert(cmd, input_file, output_dir, n_sents=1, morphology=False,
|
def convert(_cmd, input_file, output_dir, n_sents=1, morphology=False,
|
||||||
converter='auto'):
|
converter='auto'):
|
||||||
"""
|
"""
|
||||||
Convert files into JSON format for use with train command and other
|
Convert files into JSON format for use with train command and other
|
||||||
|
|
|
@ -16,7 +16,7 @@ from .. import about
|
||||||
model=("model to download, shortcut or name)", "positional", None, str),
|
model=("model to download, shortcut or name)", "positional", None, str),
|
||||||
direct=("force direct download. Needs model name with version and won't "
|
direct=("force direct download. Needs model name with version and won't "
|
||||||
"perform compatibility check", "flag", "d", bool))
|
"perform compatibility check", "flag", "d", bool))
|
||||||
def download(cmd, model, direct=False):
|
def download(_cmd, model, direct=False):
|
||||||
"""
|
"""
|
||||||
Download compatible model from default download path using pip. Model
|
Download compatible model from default download path using pip. Model
|
||||||
can be shortcut, model name or, if --direct flag is set, full model name
|
can be shortcut, model name or, if --direct flag is set, full model name
|
||||||
|
|
|
@ -25,7 +25,7 @@ numpy.random.seed(0)
|
||||||
displacy_path=("directory to output rendered parses as HTML", "option",
|
displacy_path=("directory to output rendered parses as HTML", "option",
|
||||||
"dp", str),
|
"dp", str),
|
||||||
displacy_limit=("limit of parses to render as HTML", "option", "dl", int))
|
displacy_limit=("limit of parses to render as HTML", "option", "dl", int))
|
||||||
def evaluate(cmd, model, data_path, gpu_id=-1, gold_preproc=False,
|
def evaluate(_cmd, model, data_path, gpu_id=-1, gold_preproc=False,
|
||||||
displacy_path=None, displacy_limit=25):
|
displacy_path=None, displacy_limit=25):
|
||||||
"""
|
"""
|
||||||
Evaluate a model. To render a sample of parses in a HTML file, set an
|
Evaluate a model. To render a sample of parses in a HTML file, set an
|
||||||
|
|
|
@ -13,7 +13,7 @@ from .. import util
|
||||||
@plac.annotations(
|
@plac.annotations(
|
||||||
model=("optional: shortcut link of model", "positional", None, str),
|
model=("optional: shortcut link of model", "positional", None, str),
|
||||||
markdown=("generate Markdown for GitHub issues", "flag", "md", str))
|
markdown=("generate Markdown for GitHub issues", "flag", "md", str))
|
||||||
def info(cmd, model=None, markdown=False):
|
def info(_cmd, model=None, markdown=False):
|
||||||
"""Print info about spaCy installation. If a model shortcut link is
|
"""Print info about spaCy installation. If a model shortcut link is
|
||||||
speficied as an argument, print model information. Flag --markdown
|
speficied as an argument, print model information. Flag --markdown
|
||||||
prints details in Markdown for easy copy-pasting to GitHub issues.
|
prints details in Markdown for easy copy-pasting to GitHub issues.
|
||||||
|
|
|
@ -13,7 +13,7 @@ from .. import util
|
||||||
origin=("package name or local path to model", "positional", None, str),
|
origin=("package name or local path to model", "positional", None, str),
|
||||||
link_name=("name of shortuct link to create", "positional", None, str),
|
link_name=("name of shortuct link to create", "positional", None, str),
|
||||||
force=("force overwriting of existing link", "flag", "f", bool))
|
force=("force overwriting of existing link", "flag", "f", bool))
|
||||||
def link(cmd, origin, link_name, force=False, model_path=None):
|
def link(_cmd, origin, link_name, force=False, model_path=None):
|
||||||
"""
|
"""
|
||||||
Create a symlink for models within the spacy/data directory. Accepts
|
Create a symlink for models within the spacy/data directory. Accepts
|
||||||
either the name of a pip package, or the local path to the model data
|
either the name of a pip package, or the local path to the model data
|
||||||
|
|
|
@ -20,7 +20,7 @@ from .. import about
|
||||||
"the command line prompt", "flag", "c", bool),
|
"the command line prompt", "flag", "c", bool),
|
||||||
force=("force overwriting of existing model directory in output directory",
|
force=("force overwriting of existing model directory in output directory",
|
||||||
"flag", "f", bool))
|
"flag", "f", bool))
|
||||||
def package(cmd, input_dir, output_dir, meta_path=None, create_meta=False,
|
def package(_cmd, input_dir, output_dir, meta_path=None, create_meta=False,
|
||||||
force=False):
|
force=False):
|
||||||
"""
|
"""
|
||||||
Generate Python package for model data, including meta and required
|
Generate Python package for model data, including meta and required
|
||||||
|
|
|
@ -29,7 +29,7 @@ def read_inputs(loc):
|
||||||
@plac.annotations(
|
@plac.annotations(
|
||||||
lang=("model/language", "positional", None, str),
|
lang=("model/language", "positional", None, str),
|
||||||
inputs=("Location of input file", "positional", None, read_inputs))
|
inputs=("Location of input file", "positional", None, read_inputs))
|
||||||
def profile(cmd, lang, inputs=None):
|
def profile(_cmd, lang, inputs=None):
|
||||||
"""
|
"""
|
||||||
Profile a spaCy pipeline, to find out which functions take the most time.
|
Profile a spaCy pipeline, to find out which functions take the most time.
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -38,7 +38,7 @@ numpy.random.seed(0)
|
||||||
version=("Model version", "option", "V", str),
|
version=("Model version", "option", "V", str),
|
||||||
meta_path=("Optional path to meta.json. All relevant properties will be "
|
meta_path=("Optional path to meta.json. All relevant properties will be "
|
||||||
"overwritten.", "option", "m", Path))
|
"overwritten.", "option", "m", Path))
|
||||||
def train(cmd, lang, output_dir, train_data, dev_data, n_iter=30, n_sents=0,
|
def train(_cmd, lang, output_dir, train_data, dev_data, n_iter=30, n_sents=0,
|
||||||
use_gpu=-1, vectors=None, no_tagger=False,
|
use_gpu=-1, vectors=None, no_tagger=False,
|
||||||
no_parser=False, no_entities=False, gold_preproc=False,
|
no_parser=False, no_entities=False, gold_preproc=False,
|
||||||
version="0.0.0", meta_path=None):
|
version="0.0.0", meta_path=None):
|
||||||
|
|
|
@ -10,7 +10,7 @@ from ..util import prints, get_data_path, read_json
|
||||||
from .. import about
|
from .. import about
|
||||||
|
|
||||||
|
|
||||||
def validate(cmd):
|
def validate(_cmd):
|
||||||
"""Validate that the currently installed version of spaCy is compatible
|
"""Validate that the currently installed version of spaCy is compatible
|
||||||
with the installed models. Should be run after `pip install -U spacy`.
|
with the installed models. Should be run after `pip install -U spacy`.
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -21,7 +21,7 @@ from ..util import prints, ensure_path
|
||||||
prune_vectors=("optional: number of vectors to prune to.",
|
prune_vectors=("optional: number of vectors to prune to.",
|
||||||
"option", "V", int)
|
"option", "V", int)
|
||||||
)
|
)
|
||||||
def make_vocab(cmd, lang, output_dir, lexemes_loc,
|
def make_vocab(_cmd, lang, output_dir, lexemes_loc,
|
||||||
vectors_loc=None, prune_vectors=-1):
|
vectors_loc=None, prune_vectors=-1):
|
||||||
"""Compile a vocabulary from a lexicon jsonl file and word vectors."""
|
"""Compile a vocabulary from a lexicon jsonl file and word vectors."""
|
||||||
if not lexemes_loc.exists():
|
if not lexemes_loc.exists():
|
||||||
|
|
Loading…
Reference in New Issue
Block a user