diff --git a/spacy/cli/__init__.py b/spacy/cli/__init__.py index 841794fc0..0dedb54fe 100644 --- a/spacy/cli/__init__.py +++ b/spacy/cli/__init__.py @@ -16,7 +16,7 @@ from .debug_config import debug_config # noqa: F401 from .debug_model import debug_model # noqa: F401 from .debug_diff import debug_diff # noqa: F401 from .evaluate import evaluate # noqa: F401 -from .annotate import annotate # noqa: F401 +from .apply import apply # noqa: F401 from .convert import convert # noqa: F401 from .init_pipeline import init_pipeline_cli # noqa: F401 from .init_config import init_config, fill_config # noqa: F401 diff --git a/spacy/cli/annotate.py b/spacy/cli/apply.py similarity index 95% rename from spacy/cli/annotate.py rename to spacy/cli/apply.py index 3643277c9..0f20a2d4c 100644 --- a/spacy/cli/annotate.py +++ b/spacy/cli/apply.py @@ -72,8 +72,8 @@ def _stream_data( sys.exit() -@app.command("annotate") -def annotate_cli( +@app.command("apply") +def apply_cli( # fmt: off model: str = Arg(..., help="Model name or path"), data_path: Path = Arg(..., help=path_help, exists=True), @@ -84,7 +84,7 @@ def annotate_cli( n_process: int = Opt(1, "--n-process", "-n", help="Number of processors to use") ): """ - Run a trained pipeline over documents. + Apply a trained pipeline to documents to get predictions. Expects a loadable spaCy pipeline and some data as input. The input can be provided multiple formats. It can be a .spacy file, a single text file with one document per line or a directory @@ -94,10 +94,10 @@ def annotate_cli( """ import_code(code_path) setup_gpu(use_gpu) - annotate(data_path, output, model, batch_size, n_process) + apply(data_path, output, model, batch_size, n_process) -def annotate( +def apply( data_path: Path, output: Path, model: str,