Closed koreyou closed 7 years ago
Loading GoogleNews-vectors-negative300.bin from original word2vec website fails. Loaded word embedding have shape of (0, 4687957).
GoogleNews-vectors-negative300.bin
(0, 4687957)
from word_embedding_loader import WordEmbedding wv = WordEmbedding.load(''GoogleNews-vectors-negative300.bin") print(wv.vectors.shape) #(0, 4687957)
It reproduces at least on python 3.4.5 and on 3.5.2.
It seems that problem lies in here:
https://github.com/koreyou/word_embedding_loader/blob/develop/word_embedding_loader/loader/word2vec_bin.pyx#L107-L109
cdef long long words, size fscanf(f, '%lld', &words) fscanf(f, '%lld', &size)
inspecting words and size prints out 0 and 4687957
Loading
GoogleNews-vectors-negative300.bin
from original word2vec website fails. Loaded word embedding have shape of(0, 4687957)
.It reproduces at least on python 3.4.5 and on 3.5.2.