gensim gensim.models.word2vec.Word2Vec gensim.models.word2vec.Doc2Vec Only the train function in is reimplemented with keras + Theano so that it works on GPU word2vec-keras-in-gensim Except for train, it's exactly the same as gensim
python
import gensim.models.word2vec
from word2veckeras.word2veckeras import Word2VecKeras
vsk = Word2VecKeras(gensim.models.word2vec.LineSentence('test.txt'),iter=100)
print( vsk.most_similar('the', topn=5))
It can be used like this.
Installation is
bash
pip install word2veckeras
The main file is word2veckeras.py doc2veckeras.py And each
python
if __name__ == "__main__":
Usage examples are written below and in doctest.
As a result of implementing word2vec with keras, it seems that it can be easily modified. As an example, Modify for simultaneous learning of additional information is placed.
Recommended Posts