word2vec-keras-in-gensim
Just rewrite train function in gensim.models.word2vec.Word2Vec and gensim.models.doc2vec.Doc2Vec using Keras+Theano
like
class Word2VecKeras(gensim.models.word2vec.Word2Vec):
def train(...
And can use GPU via Theano.
Install
pip install word2veckeras
Usage
same to gensim.models.word2vec.Word2Vec
Example
vsk = Word2VecKeras(gensim.models.word2vec.LineSentence('test.txt'),iter=100)
print( vsk.most_similar('the', topn=5))
from nltk.corpus import brown
brk = Word2VecKeras(brown.sents(),iter=10)
print( brk.most_similar('the', topn=5))
Requirements
pip install -U keras