spaCy/website/usage/_models/_quickstart.jade

19 lines
1.1 KiB
Plaintext
Raw Normal View History

2017-10-03 15:26:20 +03:00
//- 💫 DOCS > USAGE > MODELS > QUICKSTART
- QUICKSTART_MODELS[0].options = Object.keys(MODELS).map(m => ({ id: m, title: LANGUAGES[m], checked: m == 'en'}))
+quickstart(QUICKSTART_MODELS, "Quickstart", "Install a default model, get the code to load it from within spaCy and an example to test it. For more options, see the section on available models below.")
for models, lang in MODELS
- var package = models[0]
+qs({lang: lang}) python -m spacy download #{lang}
2017-10-03 15:26:20 +03:00
+qs({lang: lang}, "divider")
+qs({lang: lang, load: "module"}, "python") import #{package}
+qs({lang: lang, load: "module"}, "python") nlp = #{package}.load()
2017-11-06 15:06:26 +03:00
+qs({lang: lang, load: "spacy"}, "python") import spacy
2017-10-03 15:26:20 +03:00
+qs({lang: lang, load: "spacy"}, "python") nlp = spacy.load('#{lang}')
+qs({lang: lang, config: "example"}, "python") doc = nlp(u"#{EXAMPLE_SENTENCES[lang]}")
if lang != "xx"
+qs({lang: lang, config: "example"}, "python") print([(w.text, w.pos_) for w in doc])
else
+qs({lang: lang, config: "example"}, "python") print([(ent.text, ent.label) for ent in doc.ents])