mirror of
https://github.com/explosion/spaCy.git
synced 2025-08-07 21:54:54 +03:00
rename to apply
This commit is contained in:
parent
ab80dea14f
commit
a7070f3dcf
|
@ -16,7 +16,7 @@ from .debug_config import debug_config # noqa: F401
|
||||||
from .debug_model import debug_model # noqa: F401
|
from .debug_model import debug_model # noqa: F401
|
||||||
from .debug_diff import debug_diff # noqa: F401
|
from .debug_diff import debug_diff # noqa: F401
|
||||||
from .evaluate import evaluate # 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 .convert import convert # noqa: F401
|
||||||
from .init_pipeline import init_pipeline_cli # noqa: F401
|
from .init_pipeline import init_pipeline_cli # noqa: F401
|
||||||
from .init_config import init_config, fill_config # noqa: F401
|
from .init_config import init_config, fill_config # noqa: F401
|
||||||
|
|
|
@ -72,8 +72,8 @@ def _stream_data(
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
|
|
||||||
@app.command("annotate")
|
@app.command("apply")
|
||||||
def annotate_cli(
|
def apply_cli(
|
||||||
# fmt: off
|
# fmt: off
|
||||||
model: str = Arg(..., help="Model name or path"),
|
model: str = Arg(..., help="Model name or path"),
|
||||||
data_path: Path = Arg(..., help=path_help, exists=True),
|
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")
|
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.
|
Expects a loadable spaCy pipeline and some data as input.
|
||||||
The input can be provided multiple formats. It can be a .spacy
|
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
|
file, a single text file with one document per line or a directory
|
||||||
|
@ -94,10 +94,10 @@ def annotate_cli(
|
||||||
"""
|
"""
|
||||||
import_code(code_path)
|
import_code(code_path)
|
||||||
setup_gpu(use_gpu)
|
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,
|
data_path: Path,
|
||||||
output: Path,
|
output: Path,
|
||||||
model: str,
|
model: str,
|
Loading…
Reference in New Issue
Block a user