mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-24 17:06:29 +03:00
Remove saving & loading docs and link to new workflow
This commit is contained in:
parent
c365795bf6
commit
dea79224ed
|
@ -235,62 +235,13 @@ p
|
||||||
|
|
||||||
p
|
p
|
||||||
| If you've trained your own model, for example for
|
| If you've trained your own model, for example for
|
||||||
| #[+a("/docs/usage/adding-languages") additional languages], you can
|
| #[+a("/docs/usage/adding-languages") additional languages] or
|
||||||
| create a shortuct link for it by pointing #[code spacy.link] to the
|
| #[+a("/docs/usage/train-ner") custom named entities], you can save its
|
||||||
| model's data directory. To allow your model to be downloaded and
|
| state using the #[code Language.save_to_directory()] method. To make the
|
||||||
| installed via pip, you'll also need to generate a package for it. You can
|
| model more convenient to deploy, we recommend wrapping it as a Python
|
||||||
| do this manually, or via the new
|
| package.
|
||||||
| #[+a("/docs/usage/cli#package") #[code spacy package] command] that will
|
|
||||||
| create all required files, and walk you through generating the meta data.
|
|
||||||
|
|
||||||
|
+infobox("Saving and loading models")
|
||||||
+infobox("Important note")
|
| For more information and a detailed guide on how to package your model,
|
||||||
| The model packages are #[strong not suitable] for the public
|
| see the documentation on
|
||||||
| #[+a("https://pypi.python.org") pypi.python.org] directory, which is not
|
| #[+a("/docs/usage/saving-loading") saving and loading models].
|
||||||
| designed for binary data and files over 50 MB. However, if your company
|
|
||||||
| is running an internal installation of pypi, publishing your models on
|
|
||||||
| there can be a convenient solution to share them with your team.
|
|
||||||
|
|
||||||
p The model directory should look like this:
|
|
||||||
|
|
||||||
+code("Directory structure", "yaml").
|
|
||||||
└── /
|
|
||||||
├── MANIFEST.in # to include meta.json
|
|
||||||
├── meta.json # model meta data
|
|
||||||
├── setup.py # setup file for pip installation
|
|
||||||
└── en_core_web_md # model directory
|
|
||||||
├── __init__.py # init for pip installation
|
|
||||||
└── en_core_web_md-1.2.0 # model data
|
|
||||||
|
|
||||||
p
|
|
||||||
| You can find templates for all files in our
|
|
||||||
| #[+a(gh("spacy-dev-resouces", "templates/model")) spaCy dev resources].
|
|
||||||
| Unless you want to customise installation and loading, the only file
|
|
||||||
| you'll need to modify is #[code meta.json], which includes the model's
|
|
||||||
| meta data. It will later be copied into the package and data directory.
|
|
||||||
|
|
||||||
+code("meta.json", "json").
|
|
||||||
{
|
|
||||||
"name": "core_web_md",
|
|
||||||
"lang": "en",
|
|
||||||
"version": "1.2.0",
|
|
||||||
"spacy_version": "1.7.0",
|
|
||||||
"description": "English model for spaCy",
|
|
||||||
"author": "Explosion AI",
|
|
||||||
"email": "contact@explosion.ai",
|
|
||||||
"license": "MIT"
|
|
||||||
}
|
|
||||||
|
|
||||||
p
|
|
||||||
| Keep in mind that the directories need to be named according to the
|
|
||||||
| naming conventions. The #[code lang] setting is also used to create the
|
|
||||||
| respective #[code Language] class in spaCy, which will later be returned
|
|
||||||
| by the model's #[code load()] method.
|
|
||||||
|
|
||||||
p
|
|
||||||
| To generate the package, run the following command from within the
|
|
||||||
| directory. This will create a #[code .tar.gz] archive in a directory
|
|
||||||
| #[code /dist].
|
|
||||||
|
|
||||||
+code(false, "bash").
|
|
||||||
python setup.py sdist
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user