From b0f80a6ff3b4e58c55b6162b3b621af71225761a Mon Sep 17 00:00:00 2001 From: Jan Berkel Date: Wed, 11 Oct 2017 20:24:07 +0200 Subject: [PATCH] Fix spelling (#1625) --- docs/notebooks/FastText_Tutorial.ipynb | 4 ++-- docs/notebooks/Word2Vec_FastText_Comparison.ipynb | 4 ++-- gensim/models/keyedvectors.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/notebooks/FastText_Tutorial.ipynb b/docs/notebooks/FastText_Tutorial.ipynb index 6145cb835d..f547009215 100644 --- a/docs/notebooks/FastText_Tutorial.ipynb +++ b/docs/notebooks/FastText_Tutorial.ipynb @@ -279,7 +279,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "The word vector lookup operation only works if atleast one of the component character ngrams is present in the training corpus. For example -" + "The word vector lookup operation only works if at least one of the component character ngrams is present in the training corpus. For example -" ] }, { @@ -346,7 +346,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Similarity operations work the same way as word2vec. **Out-of-vocabulary words can also be used, provided they have atleast one character ngram present in the training data.**" + "Similarity operations work the same way as word2vec. **Out-of-vocabulary words can also be used, provided they have at least one character ngram present in the training data.**" ] }, { diff --git a/docs/notebooks/Word2Vec_FastText_Comparison.ipynb b/docs/notebooks/Word2Vec_FastText_Comparison.ipynb index 641c159951..a9191dcb28 100644 --- a/docs/notebooks/Word2Vec_FastText_Comparison.ipynb +++ b/docs/notebooks/Word2Vec_FastText_Comparison.ipynb @@ -466,7 +466,7 @@ "Both these subtractions would result in a very similar set of remaining ngrams.\n", "No surprise the fastText embeddings do extremely well on this.\n", "\n", - "Let's do a small test to validate this hypothesis - fastText differs from word2vec only in that it uses char n-gram embeddings as well as the actual word embedding in the scoring function to calculate scores and then likelihoods for each word, given a context word. In case char n-gram embeddings are not present, this reduces (atleast theoretically) to the original word2vec model. This can be implemented by setting 0 for the max length of char n-grams for fastText.\n" + "Let's do a small test to validate this hypothesis - fastText differs from word2vec only in that it uses char n-gram embeddings as well as the actual word embedding in the scoring function to calculate scores and then likelihoods for each word, given a context word. In case char n-gram embeddings are not present, this reduces (at least theoretically) to the original word2vec model. This can be implemented by setting 0 for the max length of char n-grams for fastText.\n" ] }, { @@ -1081,4 +1081,4 @@ }, "nbformat": 4, "nbformat_minor": 0 -} \ No newline at end of file +} diff --git a/gensim/models/keyedvectors.py b/gensim/models/keyedvectors.py index 8711322124..497f9d86f0 100644 --- a/gensim/models/keyedvectors.py +++ b/gensim/models/keyedvectors.py @@ -633,7 +633,7 @@ def n_similarity(self, ws1, ws2): """ if not(len(ws1) and len(ws2)): - raise ZeroDivisionError('Atleast one of the passed list is empty.') + raise ZeroDivisionError('At least one of the passed list is empty.') v1 = [self[word] for word in ws1] v2 = [self[word] for word in ws2] return dot(matutils.unitvec(array(v1).mean(axis=0)), matutils.unitvec(array(v2).mean(axis=0)))