mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-26 01:04:34 +03:00
Change code language from cli
to bash
This commit is contained in:
parent
80144ebad0
commit
93768cc909
|
@ -43,7 +43,7 @@ pipeline name to be specified with its version (e.g. `en_core_web_sm-3.0.0`).
|
|||
> will also allow you to add it as a versioned package dependency to your
|
||||
> project.
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy download [model] [--direct] [--sdist] [pip_args]
|
||||
```
|
||||
|
||||
|
@ -63,17 +63,17 @@ setup, and generate [Markdown](https://en.wikipedia.org/wiki/Markdown)-formatted
|
|||
markup to copy-paste into
|
||||
[GitHub issues](https://github.com/explosion/spaCy/issues).
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy info [--markdown] [--silent] [--exclude]
|
||||
```
|
||||
|
||||
> #### Example
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> $ python -m spacy info en_core_web_lg --markdown
|
||||
> ```
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy info [model] [--markdown] [--silent] [--exclude]
|
||||
```
|
||||
|
||||
|
@ -102,7 +102,7 @@ compatible versions and command for updating are shown.
|
|||
> suite, to ensure all packages are up to date before proceeding. If
|
||||
> incompatible packages are found, it will return `1`.
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy validate
|
||||
```
|
||||
|
||||
|
@ -127,11 +127,11 @@ customize those settings in your config file later.
|
|||
|
||||
> #### Example
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> $ python -m spacy init config config.cfg --lang en --pipeline ner,textcat --optimize accuracy
|
||||
> ```
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy init config [output_file] [--lang] [--pipeline] [--optimize] [--gpu] [--pretraining] [--force]
|
||||
```
|
||||
|
||||
|
@ -161,7 +161,7 @@ validation error with more details.
|
|||
|
||||
> #### Example
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> $ python -m spacy init fill-config base.cfg config.cfg --diff
|
||||
> ```
|
||||
>
|
||||
|
@ -169,7 +169,7 @@ validation error with more details.
|
|||
>
|
||||
> ![Screenshot of visual diff in terminal](/images/cli_init_fill-config_diff.jpg)
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy init fill-config [base_path] [output_file] [--diff]
|
||||
```
|
||||
|
||||
|
@ -198,7 +198,7 @@ This functionality was previously available as part of the command `init-model`.
|
|||
|
||||
</Infobox>
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy init vectors [lang] [vectors_loc] [output_dir] [--prune] [--truncate] [--name] [--verbose]
|
||||
```
|
||||
|
||||
|
@ -233,7 +233,7 @@ After generating the labels, you can provide them to components that accept a
|
|||
> path = "corpus/labels/ner.json
|
||||
> ```
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy init labels [config_path] [output_path] [--code] [--verbose] [--gpu-id] [overrides]
|
||||
```
|
||||
|
||||
|
@ -256,7 +256,7 @@ Convert files into spaCy's
|
|||
management functions. The converter can be specified on the command line, or
|
||||
chosen based on the file extension of the input file.
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy convert [input_file] [output_dir] [--converter] [--file-type] [--n-sents] [--seg-sents] [--base] [--morphology] [--merge-subtokens] [--ner-map] [--lang]
|
||||
```
|
||||
|
||||
|
@ -302,13 +302,13 @@ errors at once and some issues are only shown once previous errors have been
|
|||
fixed. To auto-fill a partial config and save the result, you can use the
|
||||
[`init fill-config`](/api/cli#init-fill-config) command.
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy debug config [config_path] [--code] [--show-functions] [--show-variables] [overrides]
|
||||
```
|
||||
|
||||
> #### Example
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> $ python -m spacy debug config config.cfg
|
||||
> ```
|
||||
|
||||
|
@ -332,7 +332,7 @@ python -m spacy init fill-config tmp/starter-config_invalid.cfg tmp/starter-conf
|
|||
|
||||
<Accordion title="Example output (valid config and all options)" spaced>
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy debug config ./config.cfg --show-functions --show-variables
|
||||
```
|
||||
|
||||
|
@ -478,13 +478,13 @@ the token distributions. To learn more, you can check out Papay et al.'s work on
|
|||
|
||||
</Infobox>
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy debug data [config_path] [--code] [--ignore-warnings] [--verbose] [--no-format] [overrides]
|
||||
```
|
||||
|
||||
> #### Example
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> $ python -m spacy debug data ./config.cfg
|
||||
> ```
|
||||
|
||||
|
@ -646,13 +646,13 @@ you must supply these as extra parameters to the command when comparing to the
|
|||
default settings. The generated diff can also be used when posting to the
|
||||
discussion forum to provide more information for the maintainers.
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy debug diff-config [config_path] [--compare-to] [--optimize] [--gpu] [--pretraining] [--markdown]
|
||||
```
|
||||
|
||||
> #### Example
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> $ python -m spacy debug diff-config ./config.cfg
|
||||
> ```
|
||||
|
||||
|
@ -881,7 +881,7 @@ The `profile` command is now available as a subcommand of `spacy debug`.
|
|||
|
||||
</Infobox>
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy debug profile [model] [inputs] [--n-texts]
|
||||
```
|
||||
|
||||
|
@ -898,7 +898,7 @@ $ python -m spacy debug profile [model] [inputs] [--n-texts]
|
|||
Debug a Thinc [`Model`](https://thinc.ai/docs/api-model) by running it on a
|
||||
sample text and checking how it updates its internal weights and parameters.
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy debug model [config_path] [component] [--layers] [--dimensions] [--parameters] [--gradients] [--attributes] [--print-step0] [--print-step1] [--print-step2] [--print-step3] [--gpu-id]
|
||||
```
|
||||
|
||||
|
@ -909,7 +909,7 @@ model ("Step 0"), which helps us to understand the internal structure of the
|
|||
Neural Network, and to focus on specific layers that we want to inspect further
|
||||
(see next example).
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy debug model ./config.cfg tagger -P0
|
||||
```
|
||||
|
||||
|
@ -955,7 +955,7 @@ an all-zero matrix determined by the `nO` and `nI` dimensions. After a first
|
|||
training step (Step 2), this matrix has clearly updated its values through the
|
||||
training feedback loop.
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy debug model ./config.cfg tagger -l "5,15" -DIM -PAR -P0 -P1 -P2
|
||||
```
|
||||
|
||||
|
@ -1042,11 +1042,11 @@ in the section `[paths]`.
|
|||
|
||||
> #### Example
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> $ python -m spacy train config.cfg --output ./output --paths.train ./train --paths.dev ./dev
|
||||
> ```
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy train [config_path] [--output] [--code] [--verbose] [--gpu-id] [overrides]
|
||||
```
|
||||
|
||||
|
@ -1112,11 +1112,11 @@ auto-generated by setting `--pretraining` on
|
|||
|
||||
> #### Example
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> $ python -m spacy pretrain config.cfg ./output_pretrain --paths.raw_text ./data.jsonl
|
||||
> ```
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy pretrain [config_path] [output_dir] [--code] [--resume-path] [--epoch-resume] [--gpu-id] [overrides]
|
||||
```
|
||||
|
||||
|
@ -1145,7 +1145,7 @@ skew. To render a sample of dependency parses in a HTML file using the
|
|||
[displaCy visualizations](/usage/visualizers), set as output directory as the
|
||||
`--displacy-path` argument.
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy evaluate [model] [data_path] [--output] [--code] [--gold-preproc] [--gpu-id] [--displacy-path] [--displacy-limit]
|
||||
```
|
||||
|
||||
|
@ -1177,12 +1177,12 @@ be provided.
|
|||
|
||||
> #### Examples
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> # For textcat_multilabel:
|
||||
> $ python -m spacy find-threshold my_nlp data.spacy textcat_multilabel threshold cats_macro_f
|
||||
> ```
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> # For spancat:
|
||||
> $ python -m spacy find-threshold my_nlp data.spacy spancat threshold spans_sc_f
|
||||
> ```
|
||||
|
@ -1211,11 +1211,11 @@ config.
|
|||
|
||||
> #### Example
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> $ python -m spacy assemble config.cfg ./output
|
||||
> ```
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy assemble [config_path] [output_dir] [--code] [--verbose] [overrides]
|
||||
```
|
||||
|
||||
|
@ -1255,13 +1255,13 @@ the sdist and wheel by setting `--build sdist,wheel`.
|
|||
|
||||
</Infobox>
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy package [input_dir] [output_dir] [--code] [--meta-path] [--create-meta] [--build] [--name] [--version] [--force]
|
||||
```
|
||||
|
||||
> #### Example
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> $ python -m spacy package /input /output
|
||||
> $ cd /output/en_pipeline-0.0.0
|
||||
> $ pip install dist/en_pipeline-0.0.0.tar.gz
|
||||
|
@ -1296,19 +1296,19 @@ what you need. By default, spaCy's
|
|||
can provide any other repo (public or private) that you have access to using the
|
||||
`--repo` option.
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy project clone [name] [dest] [--repo] [--branch] [--sparse]
|
||||
```
|
||||
|
||||
> #### Example
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> $ python -m spacy project clone pipelines/ner_wikiner
|
||||
> ```
|
||||
>
|
||||
> Clone from custom repo:
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> $ python -m spacy project clone template --repo https://github.com/your_org/your_repo
|
||||
> ```
|
||||
|
||||
|
@ -1333,13 +1333,13 @@ considered "private" and you have to take care of putting them into the
|
|||
destination directory yourself. If a local path is provided, the asset is copied
|
||||
into the current project.
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy project assets [project_dir]
|
||||
```
|
||||
|
||||
> #### Example
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> $ python -m spacy project assets [--sparse]
|
||||
> ```
|
||||
|
||||
|
@ -1359,13 +1359,13 @@ all commands in the workflow are run, in order. If commands define
|
|||
re-run if state has changed. For example, if the input dataset changes, a
|
||||
preprocessing command that depends on those files will be re-run.
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy project run [subcommand] [project_dir] [--force] [--dry]
|
||||
```
|
||||
|
||||
> #### Example
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> $ python -m spacy project run train
|
||||
> ```
|
||||
|
||||
|
@ -1398,13 +1398,13 @@ remote storages, so you can use any protocol that `Pathy` supports, including
|
|||
filesystem, although you may need to install extra dependencies to use certain
|
||||
protocols.
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy project push [remote] [project_dir]
|
||||
```
|
||||
|
||||
> #### Example
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> $ python -m spacy project push my_bucket
|
||||
> ```
|
||||
>
|
||||
|
@ -1443,13 +1443,13 @@ remote storages, so you can use any protocol that `Pathy` supports, including
|
|||
filesystem, although you may need to install extra dependencies to use certain
|
||||
protocols.
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy project pull [remote] [project_dir]
|
||||
```
|
||||
|
||||
> #### Example
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> $ python -m spacy project pull my_bucket
|
||||
> ```
|
||||
>
|
||||
|
@ -1475,13 +1475,13 @@ content will be placed between two hidden markers, so you can add your own
|
|||
custom content before or after the auto-generated documentation. When you re-run
|
||||
the `project document` command, only the auto-generated part is replaced.
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy project document [project_dir] [--output] [--no-emoji]
|
||||
```
|
||||
|
||||
> #### Example
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> $ python -m spacy project document --output README.md
|
||||
> ```
|
||||
|
||||
|
@ -1521,13 +1521,13 @@ You'll also need to add the assets you want to track with
|
|||
|
||||
</Infobox>
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy project dvc [project_dir] [workflow] [--force] [--verbose] [--quiet]
|
||||
```
|
||||
|
||||
> #### Example
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> $ git init
|
||||
> $ dvc init
|
||||
> $ python -m spacy project dvc all
|
||||
|
@ -1550,7 +1550,7 @@ spaCy pipelines to the [Hugging Face Hub](https://huggingface.co/).
|
|||
|
||||
> #### Installation
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> $ pip install spacy-huggingface-hub
|
||||
> $ huggingface-cli login
|
||||
> ```
|
||||
|
@ -1570,13 +1570,13 @@ Push a spaCy pipeline to the Hugging Face Hub. Expects a `.whl` file packaged
|
|||
with [`spacy package`](/api/cli#package) and `--build wheel`. For more details,
|
||||
see the spaCy project [integration](/usage/projects#huggingface_hub).
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy huggingface-hub push [whl_path] [--org] [--msg] [--local-repo] [--verbose]
|
||||
```
|
||||
|
||||
> #### Example
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> $ python -m spacy huggingface-hub push en_ner_fashion-0.0.0-py3-none-any.whl
|
||||
> ```
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@ need paths, you can define them here. All config values can also be
|
|||
[`spacy train`](/api/cli#train), which is especially relevant for data paths
|
||||
that you don't want to hard-code in your config file.
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy train config.cfg --paths.train ./corpus/train.spacy
|
||||
```
|
||||
|
||||
|
@ -300,7 +300,7 @@ objects to JSON, you can now serialize them directly using the
|
|||
[`spacy convert`](/api/cli) lets you convert your JSON data to the new `.spacy`
|
||||
format:
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy convert ./data.json .
|
||||
```
|
||||
|
||||
|
|
|
@ -264,7 +264,7 @@ Writes the results of a training step to the console in a tabular format.
|
|||
|
||||
<Accordion title="Example console output" spaced>
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy train config.cfg
|
||||
```
|
||||
|
||||
|
|
|
@ -530,7 +530,7 @@ saves them to a `jsonl` file.
|
|||
|
||||
<Accordion title="Example console output" spaced>
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy train config.cfg
|
||||
```
|
||||
|
||||
|
|
|
@ -257,7 +257,7 @@ which lets you access the transformers outputs at runtime. The trained
|
|||
transformer-based [pipelines](/models) provided by spaCy end on `_trf`, e.g.
|
||||
[`en_core_web_trf`](/models/en#en_core_web_trf).
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy download en_core_web_trf
|
||||
```
|
||||
|
||||
|
@ -453,7 +453,7 @@ function. You can make it available via the `--code` argument that can point to
|
|||
a Python file. For more details on training with custom code, see the
|
||||
[training documentation](/usage/training#custom-functions).
|
||||
|
||||
```cli
|
||||
```bash
|
||||
python -m spacy train ./config.cfg --code ./code.py
|
||||
```
|
||||
|
||||
|
@ -677,14 +677,14 @@ You can add a `[pretraining]` block to your config by setting the
|
|||
`--pretraining` flag on [`init config`](/api/cli#init-config) or
|
||||
[`init fill-config`](/api/cli#init-fill-config):
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy init fill-config config.cfg config_pretrain.cfg --pretraining
|
||||
```
|
||||
|
||||
You can then run [`spacy pretrain`](/api/cli#pretrain) with the updated config
|
||||
and pass in optional config overrides, like the path to the raw text file:
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy pretrain config_pretrain.cfg ./output --paths.raw_text text.jsonl
|
||||
```
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ Before you install spaCy and its dependencies, make sure that your `pip`,
|
|||
> After installation you typically want to download a trained pipeline. For more
|
||||
> info and available packages, see the [models directory](/models).
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> $ python -m spacy download en_core_web_sm
|
||||
>
|
||||
> >>> import spacy
|
||||
|
@ -114,7 +114,7 @@ version. If incompatible packages are found, tips and installation instructions
|
|||
are printed. It's recommended to run the command with `python -m` to make sure
|
||||
you're executing the correct version of spaCy.
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ pip install -U %%SPACY_PKG_NAME%%SPACY_PKG_FLAGS
|
||||
$ python -m spacy validate
|
||||
```
|
||||
|
|
|
@ -1894,7 +1894,7 @@ access to some nice Latin vectors. You can then pass the directory path to
|
|||
> doc1.similarity(doc2)
|
||||
> ```
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ wget https://dl.fbaipublicfiles.com/fasttext/vectors-crawl/cc.la.300.vec.gz
|
||||
$ python -m spacy init vectors en cc.la.300.vec.gz /tmp/la_vectors_wiki_lg
|
||||
```
|
||||
|
@ -1954,7 +1954,7 @@ the vector of "leaving", which is identical. If you're using the
|
|||
option to easily reduce the size of the vectors as you add them to a spaCy
|
||||
pipeline:
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy init vectors en la.300d.vec.tgz /tmp/la_vectors_web_md --prune 10000
|
||||
```
|
||||
|
||||
|
@ -2044,7 +2044,7 @@ language name, and even train pipelines with it and refer to it in your
|
|||
> needs to be available during training. You can load a Python file containing
|
||||
> the code using the `--code` argument:
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> python -m spacy train config.cfg --code code.py
|
||||
> ```
|
||||
|
||||
|
|
|
@ -327,7 +327,7 @@ best-matching package compatible with your spaCy installation.
|
|||
> + nlp = spacy.load("en_core_web_sm")
|
||||
> ```
|
||||
|
||||
```cli
|
||||
```bash
|
||||
# Download best-matching version of a package for your spaCy installation
|
||||
$ python -m spacy download en_core_web_sm
|
||||
|
||||
|
@ -338,7 +338,7 @@ $ python -m spacy download en_core_web_sm-3.0.0 --direct
|
|||
The download command will [install the package](/usage/models#download-pip) via
|
||||
pip and place the package in your `site-packages` directory.
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ pip install -U %%SPACY_PKG_NAME%%SPACY_PKG_FLAGS
|
||||
$ python -m spacy download en_core_web_sm
|
||||
```
|
||||
|
@ -356,7 +356,7 @@ Make sure to **restart your kernel** or runtime after installation (just like
|
|||
you would when installing other Python packages) to make sure that the installed
|
||||
pipeline package can be found.
|
||||
|
||||
```cli
|
||||
```bash
|
||||
!python -m spacy download en_core_web_sm
|
||||
```
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ project template and copies the files to a local directory. You can then run the
|
|||
project, e.g. to train a pipeline and edit the commands and scripts to build
|
||||
fully custom workflows.
|
||||
|
||||
```cli
|
||||
```bash
|
||||
python -m spacy project clone pipelines/tagger_parser_ud
|
||||
```
|
||||
|
||||
|
@ -115,7 +115,7 @@ with. Each project template comes with a `project.yml` that defines the assets
|
|||
to download and where to put them. The [`spacy project assets`](/api/cli#run)
|
||||
will fetch the project assets for you:
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ cd some_example_project
|
||||
$ python -m spacy project assets
|
||||
```
|
||||
|
@ -153,7 +153,7 @@ Commands consist of one or more steps and can be run with
|
|||
[`spacy project run`](/api/cli#project-run). The following will run the command
|
||||
`preprocess` defined in the `project.yml`:
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy project run preprocess
|
||||
```
|
||||
|
||||
|
@ -193,7 +193,7 @@ pipeline on the converted data and if that's successful, run
|
|||
installable Python package. The following command runs the workflow named `all`
|
||||
defined in the `project.yml`, and executes the commands it specifies, in order:
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy project run all
|
||||
```
|
||||
|
||||
|
@ -222,7 +222,7 @@ a remote storage, using protocols like [S3](https://aws.amazon.com/s3/),
|
|||
you **export** your pipeline packages, **share** work with your team, or **cache
|
||||
results** to avoid repeating work.
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy project push
|
||||
```
|
||||
|
||||
|
@ -604,7 +604,7 @@ in the project and include details on how to run the project, as well as links
|
|||
to the relevant spaCy documentation to make it easy for others to get started
|
||||
using your project.
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy project document --output README.md
|
||||
```
|
||||
|
||||
|
@ -629,7 +629,7 @@ The [`spacy project clone`](/api/cli#project-clone) command lets you customize
|
|||
the repo to clone from using the `--repo` option. It calls into `git`, so you'll
|
||||
be able to clone from any repo that you have access to, including private repos.
|
||||
|
||||
```cli
|
||||
```bash
|
||||
python -m spacy project clone your_project --repo https://github.com/you/repo
|
||||
```
|
||||
|
||||
|
@ -671,7 +671,7 @@ protocols.
|
|||
|
||||
> #### Example
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> $ python -m spacy project pull local
|
||||
> ```
|
||||
|
||||
|
@ -737,7 +737,7 @@ execution context of your output. It would then compute an MD5 hash of the
|
|||
`training/model-best` directory, and use those three pieces of information to
|
||||
construct the storage URL.
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy project run train
|
||||
$ python -m spacy project push
|
||||
```
|
||||
|
@ -808,7 +808,7 @@ can then manage your spaCy project like any other DVC project, run
|
|||
and [`dvc repro`](https://dvc.org/doc/command-reference/repro) to reproduce the
|
||||
workflow or individual commands.
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy project dvc [project_dir] [workflow_name]
|
||||
```
|
||||
|
||||
|
@ -853,7 +853,7 @@ collected with Prodigy and training a spaCy pipeline:
|
|||
|
||||
> #### Example usage
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> $ python -m spacy project run all
|
||||
> ```
|
||||
|
||||
|
@ -970,7 +970,7 @@ and explore your own custom trained pipelines.
|
|||
|
||||
> #### Example usage
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> $ python -m spacy project run visualize
|
||||
> ```
|
||||
|
||||
|
@ -1018,7 +1018,7 @@ query your API from Python and JavaScript (Vanilla JS and React).
|
|||
|
||||
> #### Example usage
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> $ python -m spacy project run serve
|
||||
> ```
|
||||
|
||||
|
@ -1103,7 +1103,7 @@ it's installed.
|
|||
|
||||
> #### Installation
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> $ pip install spacy-huggingface-hub
|
||||
> # Check that the CLI is registered
|
||||
> $ python -m spacy huggingface-hub --help
|
||||
|
@ -1116,7 +1116,7 @@ package, including the auto-generated pretty `README.md` and the model details
|
|||
available in the `meta.json`. For examples, check out the
|
||||
[spaCy pipelines](https://huggingface.co/spacy) we've uploaded.
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ huggingface-cli login
|
||||
$ python -m spacy package ./en_ner_fashion ./output --build wheel
|
||||
$ cd ./output/en_ner_fashion-0.0.0/dist
|
||||
|
|
|
@ -662,7 +662,7 @@ this, see the [`package`](/api/cli#package) docs.
|
|||
> }
|
||||
> ```
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy package ./en_example_pipeline ./packages
|
||||
```
|
||||
|
||||
|
@ -713,7 +713,7 @@ argument.
|
|||
> ...
|
||||
> ```
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy package ./en_example_pipeline ./packages --code functions.py
|
||||
```
|
||||
|
||||
|
|
|
@ -167,7 +167,7 @@ the website or company in a specific context.
|
|||
|
||||
> #### Loading pipelines
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> $ python -m spacy download en_core_web_sm
|
||||
>
|
||||
> >>> import spacy
|
||||
|
|
|
@ -78,7 +78,7 @@ the [`init fill-config`](/api/cli#init-fill-config) command to fill in the
|
|||
remaining defaults. Training configs should always be **complete and without
|
||||
hidden defaults**, to keep your experiments reproducible.
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy init fill-config base_config.cfg config.cfg
|
||||
```
|
||||
|
||||
|
@ -88,7 +88,7 @@ $ python -m spacy init fill-config base_config.cfg config.cfg
|
|||
> your training and development data, get useful stats, and find problems like
|
||||
> invalid entity annotations, cyclic dependencies, low data labels and more.
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> $ python -m spacy debug data config.cfg
|
||||
> ```
|
||||
|
||||
|
@ -100,7 +100,7 @@ add your data and run [`train`](/api/cli#train) with your config. See the
|
|||
spaCy's binary `.spacy` format. You can either include the data paths in the
|
||||
`[paths]` section of your config, or pass them in via the command line.
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy train config.cfg --output ./output --paths.train ./train.spacy --paths.dev ./dev.spacy
|
||||
```
|
||||
|
||||
|
@ -108,7 +108,7 @@ $ python -m spacy train config.cfg --output ./output --paths.train ./train.spacy
|
|||
>
|
||||
> Use the `--gpu-id` option to select the GPU:
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> $ python -m spacy train config.cfg --gpu-id 0
|
||||
> ```
|
||||
|
||||
|
@ -254,7 +254,7 @@ For cases like this, you can set additional command-line options starting with
|
|||
`--paths.train ./corpus/train.spacy` sets the `train` value in the `[paths]`
|
||||
block.
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy train config.cfg --paths.train ./corpus/train.spacy --paths.dev ./corpus/dev.spacy --training.batch_size 128
|
||||
```
|
||||
|
||||
|
@ -279,7 +279,7 @@ This is especially useful if you're training models as part of an automated
|
|||
process. Environment variables **take precedence** over CLI overrides and values
|
||||
defined in the config file.
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ SPACY_CONFIG_OVERRIDES="--system.gpu_allocator pytorch --training.batch_size 128" ./your_script.sh
|
||||
```
|
||||
|
||||
|
@ -297,7 +297,7 @@ fly without having to save to and load from disk.
|
|||
> stdout. In a custom script, you can print the string config, e.g.
|
||||
> `print(nlp.config.to_str())`.
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy init config - --lang en --pipeline ner,textcat --optimize accuracy | python -m spacy train - --paths.train ./corpus/train.spacy --paths.dev ./corpus/dev.spacy
|
||||
```
|
||||
|
||||
|
@ -742,12 +742,12 @@ value for it.
|
|||
|
||||
### Training with custom code {id="custom-code"}
|
||||
|
||||
> ```cli
|
||||
> ```bash
|
||||
> ### Training
|
||||
> $ python -m spacy train config.cfg --code functions.py
|
||||
> ```
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> ### Packaging
|
||||
> $ python -m spacy package ./model-best ./packages --code functions.py
|
||||
> ```
|
||||
|
@ -873,7 +873,7 @@ you can now run [`spacy train`](/api/cli#train) and point the argument `--code`
|
|||
to your Python file. Before loading the config, spaCy will import the
|
||||
`functions.py` module and your custom functions will be registered.
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy train config.cfg --output ./output --code ./functions.py
|
||||
```
|
||||
|
||||
|
@ -912,7 +912,7 @@ def make_customize_tokenizer():
|
|||
|
||||
When training, provide the function above with the `--code` option:
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy train config.cfg --code ./functions.py
|
||||
```
|
||||
|
||||
|
@ -1157,7 +1157,7 @@ allow them to initialize faster.
|
|||
> path = "corpus/labels/ner.json
|
||||
> ```
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy init labels config.cfg ./corpus --paths.train ./corpus/train.spacy
|
||||
```
|
||||
|
||||
|
@ -1187,7 +1187,7 @@ easiest way to convert it for use with spaCy is to run
|
|||
[`spacy convert`](/api/cli#convert) and pass it a file and an output directory.
|
||||
By default, the command will pick the converter based on the file extension.
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy convert ./train.gold.conll ./corpus
|
||||
```
|
||||
|
||||
|
@ -1572,7 +1572,7 @@ valid.
|
|||
|
||||
> #### Installation
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> $ pip install -U %%SPACY_PKG_NAME[ray]%%SPACY_PKG_FLAGS
|
||||
> # Check that the CLI is registered
|
||||
> $ python -m spacy ray --help
|
||||
|
@ -1598,7 +1598,7 @@ The [`spacy ray train`](/api/cli#ray-train) command follows the same API as
|
|||
setup. You can optionally set the `--address` option to point to your Ray
|
||||
cluster. If it's not set, Ray will run locally.
|
||||
|
||||
```cli
|
||||
```bash
|
||||
python -m spacy ray train config.cfg --n-workers 2
|
||||
```
|
||||
|
||||
|
|
|
@ -159,7 +159,7 @@ from a config file without additional training. It can be especially useful for
|
|||
creating a blank pipeline with a custom tokenizer, rule-based components or word
|
||||
vectors.
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy assemble config.cfg ./output
|
||||
```
|
||||
|
||||
|
@ -222,7 +222,7 @@ details, files and interactive visualizers, as well as a direct URL to the wheel
|
|||
file that you can install via `pip install`. For examples, check out the
|
||||
[spaCy pipelines](https://huggingface.co/spacy) we've uploaded.
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ pip install spacy-huggingface-hub
|
||||
$ huggingface-cli login
|
||||
$ python -m spacy package ./en_ner_fashion ./output --build wheel
|
||||
|
|
|
@ -207,7 +207,7 @@ working as expected, you can update the spaCy version requirements in the
|
|||
To update a config from spaCy v3.1 with the new v3.2 settings, run
|
||||
[`init fill-config`](/api/cli#init-fill-config):
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy init fill-config config-v3.1.cfg config-v3.2.cfg
|
||||
```
|
||||
|
||||
|
|
|
@ -235,7 +235,7 @@ working as expected, you can update the spaCy version requirements in the
|
|||
To update a config from spaCy v3.2 with the new v3.3 settings, run
|
||||
[`init fill-config`](/api/cli#init-fill-config):
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy init fill-config config-v3.2.cfg config-v3.3.cfg
|
||||
```
|
||||
|
||||
|
|
|
@ -133,7 +133,7 @@ working as expected, you can update the spaCy version requirements in the
|
|||
To update a config from spaCy v3.3 with the new v3.4 settings, run
|
||||
[`init fill-config`](/api/cli#init-fill-config):
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy init fill-config config-v3.3.cfg config-v3.4.cfg
|
||||
```
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ tag <Tag variant="new">3</Tag>.
|
|||
|
||||
> #### Example
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> $ python -m spacy download en_core_web_trf
|
||||
> ```
|
||||
|
||||
|
@ -215,7 +215,7 @@ freely combine implementations from different frameworks into a single model.
|
|||
|
||||
> #### Example
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> # Clone a project template
|
||||
> $ python -m spacy project clone pipelines/tagger_parser_ud
|
||||
> $ cd tagger_parser_ud
|
||||
|
@ -264,7 +264,7 @@ treebank.
|
|||
|
||||
> #### Example
|
||||
>
|
||||
> ```cli
|
||||
> ```bash
|
||||
> $ pip install -U %%SPACY_PKG_NAME[ray]%%SPACY_PKG_FLAGS
|
||||
> # Check that the CLI is registered
|
||||
> $ python -m spacy ray --help
|
||||
|
@ -927,7 +927,7 @@ storage**, especially when packing multiple documents together. You can convert
|
|||
your existing JSON-formatted data using the [`spacy convert`](/api/cli#convert)
|
||||
command, which outputs `.spacy` files:
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy convert ./training.json ./output
|
||||
```
|
||||
|
||||
|
@ -939,7 +939,7 @@ The easiest way to get started with a training config is to use the
|
|||
requirements, and it will auto-generate a starter config with the best-matching
|
||||
default settings.
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy init config ./config.cfg --lang en --pipeline tagger,parser
|
||||
```
|
||||
|
||||
|
@ -1001,7 +1001,7 @@ def make_customize_tokenizer():
|
|||
|
||||
When training, provide the function above with the `--code` option:
|
||||
|
||||
```cli
|
||||
```bash
|
||||
$ python -m spacy train config.cfg --code ./functions.py
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user