From e5cb53144fafd54fd461ba7dd14c230240097d93 Mon Sep 17 00:00:00 2001 From: HLasse Date: Sun, 24 Oct 2021 07:29:41 +0200 Subject: [PATCH] Fix FastText doc-comment example for `build_vocab` and `train` to use correct argument names (#3227) * fix docs to match argument names * dummy commit to trigger CI * Update CHANGELOG.md Co-authored-by: Michael Penkov Co-authored-by: Michael Penkov --- CHANGELOG.md | 1 + README.md | 1 - gensim/models/fasttext.py | 8 ++++---- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4ea52befc..45c32056bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Changes ## Unreleased * [#3194](https://github.com/RaRe-Technologies/gensim/pull/3194): Added random_seed parameter to make LsiModel reproducible, by [@parashardhapola](https://github.com/parashardhapola) +* [#3227](https://github.com/RaRe-Technologies/gensim/pull/3227): Fix FastText doc-comment example for `build_vocab` and `train` to use correct argument names, by [@HLasse](https://github.com/HLasse) ## 4.1.2, 2021-09-17 diff --git a/README.md b/README.md index f61cd390e4..f1cb9f3ddd 100644 --- a/README.md +++ b/README.md @@ -176,4 +176,3 @@ BibTeX entry: [OpenBLAS]: http://xianyi.github.io/OpenBLAS/ [source tar.gz]: http://pypi.python.org/pypi/gensim [documentation]: http://radimrehurek.com/gensim/install.html - diff --git a/gensim/models/fasttext.py b/gensim/models/fasttext.py index a94bc17f27..6d992d9b94 100644 --- a/gensim/models/fasttext.py +++ b/gensim/models/fasttext.py @@ -38,8 +38,8 @@ >>> print(len(common_texts)) 9 >>> model = FastText(vector_size=4, window=3, min_count=1) # instantiate - >>> model.build_vocab(sentences=common_texts) - >>> model.train(sentences=common_texts, total_examples=len(common_texts), epochs=10) # train + >>> model.build_vocab(corpus_iterable=common_texts) + >>> model.train(corpus_iterable=common_texts, total_examples=len(common_texts), epochs=10) # train Once you have a model, you can access its keyed vectors via the `model.wv` attributes. The keyed vectors instance is quite powerful: it can perform a wide range of NLP tasks. @@ -108,9 +108,9 @@ >>> >>> >>> model4 = FastText(vector_size=4, window=3, min_count=1) - >>> model4.build_vocab(sentences=MyIter()) + >>> model4.build_vocab(corpus_iterable=MyIter()) >>> total_examples = model4.corpus_count - >>> model4.train(sentences=MyIter(), total_examples=total_examples, epochs=5) + >>> model4.train(corpus_iterable=MyIter(), total_examples=total_examples, epochs=5) Persist a model to disk with: