liudaizong / CSMGAN

Code for ACM MM2020 paper: Jointly Cross- and Self-Modal Graph Attention Network for Query-Based Moment Localization
33 stars 5 forks source link

About Glove Embeddings #4

Closed MinamiKotoka closed 3 years ago

MinamiKotoka commented 3 years ago

Hi, I've download the glove embeddings glove.840B.300d.zip, how can I use it? Or how can I get the file glove.bin?

liudaizong commented 3 years ago

Hi, I've download the glove embeddings glove.840B.300d.zip, how can I use it? Or how can I get the file glove.bin?

Hi, you can use python package gensim to convert glove.840B.300d.zip into binary format.

from gensim.models import KeyedVectors KeyedVectors.save_word2vec_format(..., binary=True)

chocokassy commented 3 years ago

Hi, I've download the glove embeddings glove.840B.300d.zip, how can I use it? Or how can I get the file glove.bin?

Hi, you can use python package gensim to convert glove.840B.300d.zip into binary format.

from gensim.models import KeyedVectors KeyedVectors.save_word2vec_format(..., binary=True)

Hi, can I trouble you to post the complete code? I used gensim to convert but an error occurred, and I did not find the code for converting zip to bin on the Internet. Sorry to disturb you.

liudaizong commented 3 years ago

Hi, I've download the glove embeddings glove.840B.300d.zip, how can I use it? Or how can I get the file glove.bin?

Hi, you can use python package gensim to convert glove.840B.300d.zip into binary format. from gensim.models import KeyedVectors KeyedVectors.save_word2vec_format(..., binary=True)

Hi, can I trouble you to post the complete code? I used gensim to convert but an error occurred, and I did not find the code for converting zip to bin on the Internet. Sorry to disturb you.

Hi, firstly, you need to unzip the glove.840B.300d.zip and get a txt file, then you can use the gensim package.

Eagen-l commented 3 years ago

Hi, I've download the glove embeddings glove.840B.300d.zip, how can I use it? Or how can I get the file glove.bin?

Hi, you can use python package gensim to convert glove.840B.300d.zip into binary format. from gensim.models import KeyedVectors KeyedVectors.save_word2vec_format(..., binary=True)

Hi, can I trouble you to post the complete code? I used gensim to convert but an error occurred, and I did not find the code for converting zip to bin on the Internet. Sorry to disturb you.

Hi, have you succeeded in the implementation? Have you encountered an error of ‘unexpected end of input; is count incorrect or file otherwise damaged?’

ChibaneLilaAI commented 1 year ago

I got an error ‘unexpected end of input; is count incorrect or file otherwise damaged?’ too, how to fix it?

hadiloghman commented 11 months ago

You should read the vector file. The first line consists of 2 numbers. The first one is the total lines of the file and the second one is the dimension. Unfortunately, the number of lines is incorrect so you should decrease the number by one. e.g. if the first is 2196017 300 you should replace it with 2196016 300.