xinyadu / nqg

neural question generation for reading comprehension

Home Page:https://arxiv.org/abs/1705.00106

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

could not convert string to float

hamzaLeb opened this issue · comments

When running the command:
python preprocess_embedding.py --embedding <path to embedding txt file> --dict ./data/qg.{src,tgt}.dict --output ./data/qg.{src,tgt}.840B.300d.npy

I get the error "could not convert string to float" as in preprocess_embedding.py we convert the content of the embedding txt file (.txt) to float (line 50: word2embedding[line[0]] = np.asarray(map(float, line[1 : ])))

Am I missing something? The embedded file to give is a .txt file isn't it?

Hope anyone can help me with that. Thank you in advance.

RESOLVED: I just used python3 instead of python. Which means: python3 preprocess_embedding.py --embedding <path to embedding txt file> --dict ./data/qg.{src,tgt}.dict --output ./data/qg.{src,tgt}.840B.300d.npy