From 807139ae614c7f016d2f5b173aadc327aceaf7fa Mon Sep 17 00:00:00 2001 From: ines Date: Thu, 16 Mar 2017 21:53:44 +0100 Subject: [PATCH] Update installation docs and add models quickstart aside --- website/docs/usage/index.jade | 68 ++++++----------------------------- 1 file changed, 10 insertions(+), 58 deletions(-) diff --git a/website/docs/usage/index.jade b/website/docs/usage/index.jade index 479635e4b..b894bedde 100644 --- a/website/docs/usage/index.jade +++ b/website/docs/usage/index.jade @@ -12,6 +12,16 @@ p | #[a(href="#source-ubuntu") Ubuntu], #[a(href="#source-osx") macOS/OS X] | and #[a(href="#source-windows") Windows] for details. ++aside("Download models") + | After installation you need to download a language model. For more info + | and available models, see the #[+a("/docs/usage/models") docs on models]. + + +code.o-no-block. + python -m spacy.download en + + >>> import spacy + >>> nlp = spacy.load('en') + +h(2, "pip") pip p Using pip, spaCy releases are currently only available as source packages. @@ -43,64 +53,6 @@ p | #[+a("https://github.com/conda-forge/spacy-feedstock") this repository]. | Improvements and pull requests to the recipe and setup are always appreciated. -+h(2, "models") Download models - -p - | After installation you need to download a language model. Models for - | English (#[code en]) and German (#[code de]) are available. - -+code(false, "bash"). - python -m spacy.en.download all - python -m spacy.de.download all - -+aside-code("Examples", "bash"). - # Install English tagger, parser and NER - python -m spacy.en.download parser - - # Install English GloVe vectors - python -m spacy.en.download glove - - # Upgrade/overwrite existing data - python -m spacy.en.download --force - - # Check whether the model was successfully installed - python -c "import spacy; spacy.load('en'); print('OK')" - -p - | The download command fetches about 1 GB of data which it - | installs within the #[code spacy] package directory. - -+h(3, "custom-location") Download model to custom location - -p - | You can specify where #[code spacy.en.download] and - | #[code spacy.de.download] download the language model to using the - | #[code --data-path] or #[code -d] argument: - -+code(false, "bash"). - python -m spacy.en.download all --data-path /some/dir - -p - | If you choose to download to a custom location, you will need to tell - | spaCy where to load the model from in order to use it. You can do this - | either by calling #[code spacy.util.set_data_path()] before calling - | #[code spacy.load()], or by passing a #[code path] argument to the - | #[code spacy.en.English] or #[code spacy.de.German] constructors. - -+h(3, "models-manual") Download models manually - -p - | As of v1.6, the models and word vectors are also available as direct - | downloads from GitHub, attached to the #[+a(gh("spaCy") + "/releases") releases] as #[code .tar.gz] archives. - -p - | To install the models manually, first find the default data path. You can - | use #[code spacy.util.get_data_path()] to find the directory where spaCy - | will look for its models, or change the default data path with - | #[code spacy.util.set_data_path()]. Then simply unpack the archive and - | place the contained folder in that directory. You can now load the models - | via #[code spacy.load()]. - +h(2, "source") Compile from source p