spaCy/website/usage/_models/_install-basics.jade
2017-10-03 14:26:20 +02:00

34 lines
1.3 KiB
Plaintext

//- 💫 DOCS > USAGE > MODELS > INSTALLATION BASICS
p
| The easiest way to download a model is via spaCy's
| #[+api("cli#download") #[code download]] command. It takes care of
| finding the best-matching model compatible with your spaCy installation.
- var models = Object.keys(MODELS).map(function(lang) { return "spacy download " + lang })
+code(false, "bash").
# out-of-the-box: download best-matching default model
#{Object.keys(MODELS).map(function(l) {return "spacy download " + l}).join('\n')}
# download best-matching version of specific model for your spaCy installation
spacy download en_core_web_sm
# download exact model version (doesn't create shortcut link)
spacy download en_core_web_sm-2.0.0 --direct
p
| The download command will #[+a("/usage/models#download-pip") install the model] via
| pip, place the package in your #[code site-packages] directory and create
| a #[+a("/usage/models#usage") shortcut link] that lets you load the model by a custom
| name. The shortcut link will be the same as the model name used in
| #[code spacy download].
+code(false, "bash").
pip install spacy
spacy download en
+code.
import spacy
nlp = spacy.load('en')
doc = nlp(u'This is a sentence.')