How to covert word2vec model to fit pre_word_vecs_enc ?
I've written a script to convert text-formatted embeddings to pytorch-compatible format. Maybe you will find it useful. The embeddings file is in the format of
word1 0.xx 0.xx ...
word2 0.xx 0.xx ...
and the dictionary file is identical to the one that preprocess.py produces.
Run it like
python embeddings_to_torch.py -emb_file emb.txt -dict_file source.dict -output_file emb.src.pt
Most helpful comment
I've written a script to convert text-formatted embeddings to pytorch-compatible format. Maybe you will find it useful. The embeddings file is in the format of
and the dictionary file is identical to the one that
preprocess.pyproduces.Run it like