mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-10 19:57:17 +03:00
Clarify how --code
arg works (#12102)
* Clarify how `--code` arg works This adds a few sentences to the docs to clarify how the `--code` argument works, including an explanation of how to load custom components in your own code. * Add link to spacy.load docs
This commit is contained in:
parent
25373d8e8e
commit
a3b15c9f53
|
@ -684,10 +684,15 @@ If your pipeline includes
|
||||||
[custom components](/usage/processing-pipelines#custom-components), model
|
[custom components](/usage/processing-pipelines#custom-components), model
|
||||||
architectures or other [code](/usage/training#custom-code), those functions need
|
architectures or other [code](/usage/training#custom-code), those functions need
|
||||||
to be registered **before** your pipeline is loaded. Otherwise, spaCy won't know
|
to be registered **before** your pipeline is loaded. Otherwise, spaCy won't know
|
||||||
how to create the objects referenced in the config. The
|
how to create the objects referenced in the config. If you're loading your own
|
||||||
[`spacy package`](/api/cli#package) command lets you provide one or more paths
|
pipeline in Python, you can make custom components available just by importing
|
||||||
to Python files containing custom registered functions using the `--code`
|
the code that defines them before calling
|
||||||
argument.
|
[`spacy.load`](/api/top-level#spacy.load). This is also how the `--code`
|
||||||
|
argument to CLI commands works.
|
||||||
|
|
||||||
|
With the [`spacy package`](/api/cli#package) command, you can provide one or
|
||||||
|
more paths to Python files containing custom registered functions using the
|
||||||
|
`--code` argument.
|
||||||
|
|
||||||
> #### \_\_init\_\_.py (excerpt)
|
> #### \_\_init\_\_.py (excerpt)
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user