Permalink
Browse files

Fix word2vec embeddings parsing

  • Loading branch information...
guillaumekln committed May 2, 2017
1 parent 8226bc4 commit b87e186338662c045bcd59b9d5ec6188e3302329
Showing with 3 additions and 0 deletions.
  1. +3 −0 tools/embeddings.lua
@@ -177,6 +177,9 @@ local function loadEmbeddings(embeddingFilename, embeddingType, dictionary)
local wordEmbedding = f:readFloat(embeddingSize)
wordEmbedding = torch.FloatTensor(wordEmbedding)

-- Skip newline.
f:readChar()

local idx = locateIdx(word, dict)

if idx ~= nil then

0 comments on commit b87e186

Please sign in to comment.