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

View File

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

View File

@ -21,7 +21,7 @@ p
+aside-code("Quickstart"). +aside-code("Quickstart").
# Install spaCy and download English model # Install spaCy and download English model
pip install spacy pip install spacy
python -m spacy.download en python -m spacy download en
# Usage in Python # Usage in Python
import spacy import spacy
@ -90,14 +90,14 @@ p
+code(false, "bash"). +code(false, "bash").
# out-of-the-box: download best-matching default model # out-of-the-box: download best-matching default model
python -m spacy.download en python -m spacy download en
python -m spacy.download de python -m spacy download de
# download best-matching version of specific model for your spaCy installation # 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) # 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 p
| The download command will #[+a("#download-pip") install the model] via | The download command will #[+a("#download-pip") install the model] via
@ -108,7 +108,7 @@ p
+code(false, "bash"). +code(false, "bash").
pip install spacy pip install spacy
python -m spacy.download en python -m spacy download en
+code. +code.
import spacy import spacy
@ -172,7 +172,7 @@ p
| load them by name. | load them by name.
+code(false, "bash"). +code(false, "bash").
python -m spacy.link [package name or path] [shortcut] [--force] python -m spacy link [package name or path] [shortcut] [--force]
p p
| The first argument is the package name (if the model was installed via | The first argument is the package name (if the model was installed via
@ -182,10 +182,10 @@ p
+code("Examples", "bash"). +code("Examples", "bash").
# set up shortcut link to load installed package as "en_default" # 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" # 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 +h(3, "usage-loading") Loading models
@ -198,14 +198,18 @@ p
doc = nlp(u'This is a sentence.') doc = nlp(u'This is a sentence.')
p 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()] | 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. +code.
import spacy import spacy
spacy.info('en_default') spacy.info('en_default')
# JSON-formatted model meta data # model meta data
nlp = spacy.load('en_default') nlp = spacy.load('en_default')
print(nlp.meta['version']) print(nlp.meta['version'])

View File

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