Text-Mining / Persian-Wikipedia-Corpus

Parsing the Persian wikipedia's markup language into JSON and the most modern deep learning models built on it.
49 stars 11 forks source link

how to load these .bin models with word2vec #2

Open sia-watsonlee opened 1 year ago

sia-watsonlee commented 1 year ago

i was wondering if we can load these models with gensim or something similar. since the whole file is binary we need to know its format and more information. can you please provide more info on it ?

Mazochi commented 1 year ago

Hi @sia-watsonlee It can be loaded with this code:

from gensim.models import KeyedVectors
from gensim.test.utils import datapath
model = KeyedVectors.load_word2vec_format(datapath("/content/word2vec.model-skipgram-size=200-window=5.bin"), binary=True)