diff --git a/examples/vectors_fast_text.py b/examples/vectors_fast_text.py index 323d5803f..159250098 100644 --- a/examples/vectors_fast_text.py +++ b/examples/vectors_fast_text.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # coding: utf8 -"""Load vectors for a language trained using FastText +"""Load vectors for a language trained using fastText https://github.com/facebookresearch/fastText/blob/master/pretrained-vectors.md """ from __future__ import unicode_literals @@ -10,7 +10,8 @@ import numpy import from spacy.language import Language -@plac.annotations(vectors_loc=("Path to vectors", "positional", None, str)) +@plac.annotations( + vectors_loc=("Path to vectors", "positional", None, str)) def main(vectors_loc): nlp = Language() diff --git a/website/usage/_data.json b/website/usage/_data.json index c34b5f2b0..63e959882 100644 --- a/website/usage/_data.json +++ b/website/usage/_data.json @@ -199,6 +199,7 @@ "Information Extraction": "information-extraction", "Pipeline": "pipeline", "Training": "training", + "Vectors & Similarity": "vectors", "Deep Learning": "deep-learning" } } diff --git a/website/usage/examples.jade b/website/usage/examples.jade index 74d562e27..808810364 100644 --- a/website/usage/examples.jade +++ b/website/usage/examples.jade @@ -119,6 +119,18 @@ include ../_includes/_mixins +github("spacy", "examples/training/train_textcat.py") ++section("vectors") + +h(3, "fasttext") Loading pre-trained FastText vectors + + p + | This simple snippet is all you need to be able to use the Facebook's + | #[+a("https://github.com/facebookresearch/fastText/blob/master/pretrained-vectors.md") fastText vectors] + | (294 languages, pre-trained on Wikipedia) with spaCy. Once they're + | loaded, the vectors will be available via spaCy's built-in + | #[code similarity()] methods. + + +github("spacy", "examples/vectors_fast_text.py") + +section("deep-learning") +h(3, "keras") Text classification with Keras