Update docs to reflect new commands

This commit is contained in:
ines 2017-03-18 15:24:42 +01:00
parent e9d8d756fc
commit e635e1f6f4
4 changed files with 19 additions and 15 deletions

View File

@ -17,7 +17,7 @@ p
| and available models, see the #[+a("/docs/usage/models") docs on models].
+code.o-no-block.
python -m spacy.download en
python -m spacy download en
>>> import spacy
>>> nlp = spacy.load('en')

View File

@ -9,7 +9,7 @@ p
+h(2, "models") Install and load models
+code(false, "bash").
python -m spacy.download en
python -m spacy download en
+code.
import spacy

View File

@ -21,7 +21,7 @@ p
+aside-code("Quickstart").
# Install spaCy and download English model
pip install spacy
python -m spacy.download en
python -m spacy download en
# Usage in Python
import spacy
@ -90,14 +90,14 @@ p
+code(false, "bash").
# out-of-the-box: download best-matching default model
python -m spacy.download en
python -m spacy.download de
python -m spacy download en
python -m spacy download de
# download best-matching version of specific model for your spaCy installation
python -m spacy.download en_core_web_md
python -m spacy download en_core_web_md
# download exact model version (doesn't create shortcut link)
python -m spacy.download en_core_web_md-1.2.0 --direct
python -m spacy download en_core_web_md-1.2.0 --direct
p
| The download command will #[+a("#download-pip") install the model] via
@ -108,7 +108,7 @@ p
+code(false, "bash").
pip install spacy
python -m spacy.download en
python -m spacy download en
+code.
import spacy
@ -172,7 +172,7 @@ p
| load them by name.
+code(false, "bash").
python -m spacy.link [package name or path] [shortcut] [--force]
python -m spacy link [package name or path] [shortcut] [--force]
p
| The first argument is the package name (if the model was installed via
@ -182,10 +182,10 @@ p
+code("Examples", "bash").
# set up shortcut link to load installed package as "en_default"
python -m spacy.link en_core_web_md en_default
python -m spacy link en_core_web_md en_default
# set up shortcut link to load local model as "my_amazing_model"
python -m spacy.link /Users/you/model my_amazing_model
python -m spacy link /Users/you/model my_amazing_model
+h(3, "usage-loading") Loading models
@ -198,14 +198,18 @@ p
doc = nlp(u'This is a sentence.')
p
| You can also use the #[code info()] method to print a model's meta data
| You can also use the #[info] command or #[code info()] method to print a model's meta data
| before loading it. Each #[code Language] object returned by #[code spacy.load()]
| also exposes the model's meta data as the attribute #[code meta]:
| also exposes the model's meta data as the attribute #[code meta].
+code(false, "bash").
python -m spacy info en
# model meta data
+code.
import spacy
spacy.info('en_default')
# JSON-formatted model meta data
# model meta data
nlp = spacy.load('en_default')
print(nlp.meta['version'])

View File

@ -66,7 +66,7 @@ include _includes/_mixins
+grid
+grid-col("two-thirds")
+terminal("lightning_tour.py").
# Install: pip install spacy && python -m spacy.download en
# Install: pip install spacy && python -m spacy download en
import spacy
# Load English tokenizer, tagger, parser, NER and word vectors