Using pretrained gensim Word2vec embedding in keras

前端 未结 3 720
盖世英雄少女心
盖世英雄少女心 2021-01-05 00:41

I have trained word2vec in gensim. In Keras, I want to use it to make matrix of sentence using that word embedding. As storing the matrix of all the sentences is very space

3条回答
  •  盖世英雄少女心
    2021-01-05 01:15

    With the new Gensim version this is pretty easy:

    w2v_model.wv.get_keras_embedding(train_embeddings=False)
    

    there you have your Keras embedding layer

提交回复
热议问题