How to extract the word embedding vector from a trained model?

pytorch

(long li) #1

I am using OpenNMT to train a NLP model for my task, and found it’s a great tool for research. Now I finished the training of model, and I want to extract the learned word embedding vectors for other task. Is this available in the case of OpenNMT, if so, how can I do to achieve it ?
Any advice would be appreciated !


(Guillaume Klein) #2

I assume you are using the Lua version so you should take a look at the tools/extract_embeddings.lua script.


(long li) #3

I am using the Pytorch version, but the answer is the same. Thank you for your reply !