Skip to content

Instantly share code, notes, and snippets.

@aswalin
Created May 19, 2018 18:36
Show Gist options
  • Save aswalin/c99f80a6fe6963d9698e26d844200d33 to your computer and use it in GitHub Desktop.
Save aswalin/c99f80a6fe6963d9698e26d844200d33 to your computer and use it in GitHub Desktop.
import torch
infersent = torch.load('InferSent/encoder/infersent.allnli.pickle', map_location=lambda storage, loc: storage)
infersent.set_glove_path("InferSent/dataset/GloVe/glove.840B.300d.txt")
infersent.build_vocab(sentences, tokenize=True)
dict_embeddings = {}
for i in range(len(sentences)):
print(i)
dict_embeddings[sentences[i]] = infersent.encode([sentences[i]], tokenize=True)
@harichandrajyothi
Copy link

Kindly help me in finding "infersent.allnli.pickle".
Searched a lot on this but, nothing worked.......
Thanks in advance...!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment