Skip to content

Commit

Permalink
Fix docs about Word2Vec (fix piskvorky#2934)
Browse files Browse the repository at this point in the history
Docs say you can use a generator as the first argument, but you can't.

The tempfile path was also unused, so that's been removed.
  • Loading branch information
polm committed Sep 8, 2020
1 parent 9cd72f5 commit b89be94
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions gensim/models/word2vec.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,15 @@
.. sourcecode:: pycon
>>> from gensim.test.utils import common_texts, get_tmpfile
>>> from gensim.test.utils import common_texts
>>> from gensim.models import Word2Vec
>>>
>>> path = get_tmpfile("word2vec.model")
>>>
>>> model = Word2Vec(common_texts, size=100, window=5, min_count=1, workers=4)
>>> model.save("word2vec.model")
The training is streamed, meaning `sentences` can be a generator, reading input data
from disk on-the-fly, without loading the entire corpus into RAM.
`common_texts` is a list of lists of strings, where each list is a document.
It also means you can continue training the model later:
If you save the model you can continue training it later:
.. sourcecode:: pycon
Expand Down

0 comments on commit b89be94

Please sign in to comment.