[PYTHON] Implemented word2vec with Theano + Keras

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

Implemented word2vec with Theano + Keras
Implemented Efficient GAN with keras
Word2Vec with BoUoW
Image recognition with keras
Implemented hard-swish in Keras
CIFAR-10 tutorial with Keras
Multivariate LSTM with Keras
Install Keras (used with Anaconda)
Multiple regression analysis with Keras
Sentiment analysis with Python (word2vec)
Implemented SMO with Python + NumPy
Sentence generation with GRU (keras)
Tuning Keras parameters with Keras Tuner
I implemented VQE with Blueqat
How to cast with Theano
Easily build CNN with Keras
Implemented Conditional GAN with chainer
Implemented SmoothGrad with Chainer v2
I made Word2Vec with Pytorch
Zura with softmax function implemented
Image recognition with Keras + OpenCV
MNIST (DCNN) with Keras (TensorFlow backend)
Implemented file download with Python + Bottle
Predict Kaggle's Titanic with keras (kaggle ⑦)
I implemented Attention Seq2Seq with PyTorch
Keras as wrapper of Theano & TensorFlow
[TensorFlow] [Keras] Neural network construction with Keras
Verify "Fucking Deca" + "Rashomon" with word2vec
Implement Keras LSTM feedforward with numpy
Compare DCGAN and pix2pix with keras
Score-CAM implementation with keras. Comparison with Grad-CAM
Prediction of sine wave with keras
Beginner RNN (LSTM) | Try with Keras
Write Reversi AI with Keras + DQN
Implemented inter-frame difference method with OpenCV
Classifying SNLI datasets with Word2Vec + LSTM
4/22 prediction of sine wave with keras