lvapeab / nmt-keras

Neural Machine Translation with Keras
http://nmt-keras.readthedocs.io
MIT License
533 stars 130 forks source link

How to use pretrained word2vec embeddings? #124

Closed nashid closed 4 years ago

nashid commented 4 years ago

Is there code sample/example of a project how to use pretrained word2vec embeddings?

lvapeab commented 4 years ago

You need to preprocess your embeddings, either binary or text:

python utils/preprocess_binary_word_vectors.py -v input_vectors.bin -d word2vec.en

And tell the config.py to use them (and the same for the target lanaguge):

https://github.com/lvapeab/nmt-keras/blob/ab29848df8001f1abf58f5294c8e0c1ae78ac23e/config.py#L190