From c6dc2fafc02cd1a5593ed2825dc0f7f55a6ac87e Mon Sep 17 00:00:00 2001 From: ines Date: Thu, 1 Jun 2017 17:49:56 +0200 Subject: [PATCH] Add Spanish and move example sentences to meta --- website/_harp.json | 16 ++++++++++++++-- website/docs/usage/index.jade | 1 + website/docs/usage/models.jade | 3 +-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/website/_harp.json b/website/_harp.json index 8c16ccc16..25ad3c5d2 100644 --- a/website/_harp.json +++ b/website/_harp.json @@ -77,7 +77,8 @@ { "id": "model", "title": "Models", "multiple": true, "options": [ { "id": "en", "title": "English", "meta": "50MB" }, { "id": "de", "title": "German", "meta": "645MB" }, - { "id": "fr", "title": "French", "meta": "1.33GB" }] + { "id": "fr", "title": "French", "meta": "1.33GB" }, + { "id": "es", "title": "Spanish", "meta": "377MB"}] } ], @@ -85,7 +86,8 @@ { "id": "lang", "title": "Language", "options": [ { "id": "en", "title": "English", "checked": true }, { "id": "de", "title": "German" }, - { "id": "fr", "title": "French" }] + { "id": "fr", "title": "French" }, + { "id": "es", "title": "Spanish" }] }, { "id": "load", "title": "Loading style", "options": [ { "id": "spacy", "title": "Use spacy.load()", "checked": true, "help": "Use spaCy's built-in loader to load the model by name." }, @@ -108,9 +110,19 @@ ], "fr": [ { "id": "fr_depvec_web_lg", "lang": "French", "feats": [1, 1, 0, 1], "size": "1.33 GB", "license": "CC BY-NC" } + ], + "es": [ + { "id": "es_core_web_md", "lang": "Spanish", "feats": [1, 1, 1, 1], "size": "377 MB", "license": "CC BY-SA"} ] }, + "EXAMPLE_SENTENCES": { + "en": "This is a sentence.", + "de": "Dies ist ein Satz.", + "fr": "C'est une phrase.", + "es": "Esto es una frase." + }, + "ALPHA": true, "V_CSS": "1.6", "V_JS": "1.2", diff --git a/website/docs/usage/index.jade b/website/docs/usage/index.jade index c79c689a4..d3deaa17e 100644 --- a/website/docs/usage/index.jade +++ b/website/docs/usage/index.jade @@ -40,6 +40,7 @@ p +qs({model: 'en'}) python -m spacy download en +qs({model: 'de'}) python -m spacy download de +qs({model: 'fr'}) python -m spacy download fr + +qs({model: 'es'}) python -m spacy download es +h(2, "installation") Installation instructions diff --git a/website/docs/usage/models.jade b/website/docs/usage/models.jade index a837b4d29..bc0f14e01 100644 --- a/website/docs/usage/models.jade +++ b/website/docs/usage/models.jade @@ -18,7 +18,6 @@ p | skew, which might decrease your accuracy. +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.") - - var examples = {en: "This is a sentence.", de: "Dies ist ein Satz.", fr: "C'est une phrase."} for models, lang in MODELS - var package = (models.length == 1) ? models[0] : models.find(function(m) { return m.def }) +qs({lang: lang}) python -m spacy download #{lang} @@ -26,7 +25,7 @@ p +qs({lang: lang, load: "module"}, "python") import #{package.id} +qs({lang: lang, load: "module"}, "python") nlp = #{package.id}.load() +qs({lang: lang, load: "spacy"}, "python") nlp = spacy.load('#{lang}') - +qs({lang: lang, config: "example"}, "python") doc = nlp(u"#{examples[lang]}") + +qs({lang: lang, config: "example"}, "python") doc = nlp(u"#{EXAMPLE_SENTENCES[lang]}") +qs({lang: lang, config: "example"}, "python") print([(w.text, w.pos_) for w in doc]) +h(2, "available") Available models