2017-10-03 12:26:20 +00:00
|
|
|
//- 💫 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.
|
|
|
|
|
2017-11-10 01:30:55 +00:00
|
|
|
- var models = Object.keys(MODELS).map(function(lang) { return "python -m spacy download " + lang })
|
2017-10-03 12:26:20 +00:00
|
|
|
+code(false, "bash").
|
|
|
|
# out-of-the-box: download best-matching default model
|
2017-11-10 01:30:55 +00:00
|
|
|
#{Object.keys(MODELS).map(function(l) {return "python -m spacy download " + l}).join('\n')}
|
2017-10-03 12:26:20 +00:00
|
|
|
|
|
|
|
# download best-matching version of specific model for your spaCy installation
|
2017-11-10 01:30:55 +00:00
|
|
|
python -m spacy download en_core_web_sm
|
2017-10-03 12:26:20 +00:00
|
|
|
|
|
|
|
# download exact model version (doesn't create shortcut link)
|
2017-11-10 01:30:55 +00:00
|
|
|
python -m spacy download en_core_web_sm-2.0.0 --direct
|
2017-10-03 12:26:20 +00:00
|
|
|
|
|
|
|
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
|
2017-11-10 01:30:55 +00:00
|
|
|
python -m spacy download en
|
2017-10-03 12:26:20 +00:00
|
|
|
|
|
|
|
+code.
|
|
|
|
import spacy
|
|
|
|
nlp = spacy.load('en')
|
|
|
|
doc = nlp(u'This is a sentence.')
|