Closed gg2572 closed 6 years ago
It's likely that the pre-trained word vector was trained on a newer version of gensim, and so you an't load it with my (very old) forked version of gensim.
Hi @jhlau ,
Thank you for your quick reply. Can I use the pre-trained word2vec model on your git https://github.com/jhlau/doc2vec
? Does the model contain the word embedding? (I don't find it in the model's values.)
Best, Gan
You can find the pre-trained word2vec model on the README: https://github.com/jhlau/doc2vec/blob/master/README.md
We released pre-trained English Wikipedia and AP-NEWS word embeddings.
@jhlau Thank you. I loaded the word2vec model and used the function save_word2vec_format
to save the trained vector, and later loaded it to the doc2vec model. It's working. Thanks again for your help!
@jhlau Hey Jey, I hope you're doing well. This is Gan and I was trying to use your forked version and load a pre-trained word vector,
wiki-news-300d-1M.vec
, fromhttps://fasttext.cc/docs/en/english-vectors.html
; however, I'm getting the error:TypeError: don't know how to handle uri
, and I think it's from thesmart_open
function. I'm training a very small corpus so I think it may be better to initialize with the pre-trained vector. Following is the code:Do you have any idea what's wrong on here? Thank you so much and look forward to your reply.
Best, Gan