Glove: How to calculate similarity between two list of words (representing two sentences)?

622 views
Skip to first unread message

tedo.v...@gmail.com

unread,
Nov 17, 2017, 3:26:36 PM11/17/17
to GloVe: Global Vectors for Word Representation
Can I somehow use n_similarity function from Word2vec (wv.n_similarity) for Glove model?

Unfortunately, Glove object has nothing like wv.n_similarity in Word2vec. What can one do to get similarity of two sets of words or two sentences in Glove model?

Tiriar

unread,
Nov 18, 2017, 2:09:34 PM11/18/17
to GloVe: Global Vectors for Word Representation
I am doing a thesis about sentence embeddings, and basically if you wanna encode a sentence using word embeddings, you simply create an embedding for each word in the sentence and then average the vectors to get the sentence vector. Averaging works surprisingly good, there are some articles about why a simple average can keep semantic meaning of the whole sentence (it has something to do with the high dimensionality of the embeddings). But I have to tell you that GloVe performs quite poorly for sentence embeddings. From my tests, word2vec or FastText work better for this, but if you really want to have a well performing model, I would suggest you to try some dedicated sentence embeddings (like sent2vec or InferSent). Sent2vec is quite easy to use, just follow the instructions on their GitHub (https://github.com/epfml/sent2vec).

Cheers

tedo.v...@gmail.com

unread,
Nov 19, 2017, 1:00:41 PM11/19/17
to GloVe: Global Vectors for Word Representation
@Tiriar
Thanks for answer!
Reply all
Reply to author
Forward
0 new messages