Open Joseph94m opened 6 years ago
You can use gensim to load the .bin model:
from gensim.models import Word2Vec
model = Word2Vec.load("vi.bin")
model.wv['nhà']
Then, you will get the embedding vector of the word "nhà", in Vietnamese for example. Remember to install gensim library
But it didn't work with FastText, below is my code:
from gensim.models import FastText
model_f = FastText.load("zh.bin") v = model_f.wv['你好']`
It throws a exception: Exception has occurred: _pickle.UnpicklingError invalid load key, ','.
But it didn't work with FastText, below is my code:
from gensim.models import FastText
model_f = FastText.load("zh.bin") v = model_f.wv['你好']`
It throws a exception: Exception has occurred: _pickle.UnpicklingError invalid load key, ','.
I fixed it by replacing load with load_fasttext_format.
Hi,
I downloaded the French embeddings, and extracted the zip file. How can I load these embeddings in a python code and return the embeddings for a specified word, e.g.: embedding("bonjour") -----> [0.2, -0,2, etc...]
Thanks