skip-thoughts.torch icon indicating copy to clipboard operation
skip-thoughts.torch copied to clipboard

How can i get a sentence representation

Open gkv91 opened this issue 7 years ago • 4 comments

Hi, Can you please tell me, how can I extract a single feature vector given a sentence in textual form or a list of word2vec vectors. Thanks

gkv91 avatar Apr 22 '19 15:04 gkv91

Is this sufficient? https://github.com/Cadene/skip-thoughts.torch/tree/master/pytorch#quick-example

Cadene avatar Apr 22 '19 15:04 Cadene

So first we need to make a vocabulary of all the possible words?. Instead of making a vector of word indices (eg. [1,2,3,4,0] in the example), can I use the word2vec embeddings (input as a 5x300 tensor)?

gkv91 avatar Apr 22 '19 15:04 gkv91

@gkv91

The dictionary of all the words that can be associated to an embedding is available here.

As it contains too much word for my task, I prefer to reduce it / create my own.

Also, note that the skipthought model was trained using its own embedding layer initialized with the word2vec embeddings.

Cadene avatar Apr 22 '19 16:04 Cadene