Jayashree
Jayashree

Reputation: 825

Evaluating Glove model by finding linear algebraic structure of words

I have built Glove model on my text corpus using in c application following this implementation https://github.com/stanfordnlp/GloVe/tree/master/src. I want to find the word embeddings in such a way that

If A is related to B and C is related to D, then A-C+B should be equal to D. For example, embedding vector arithmetic of "Australia"-"Canberra"+"India" should be equal to the embedding of "New Delhi".

I want to evaluate these embeddings in python.

Upvotes: 1

Views: 144

Answers (1)

Mehdi
Mehdi

Reputation: 4318

Evaluation steps for any A B C D:

  1. Calculate the vector representation of D' with D' = A-C+B.
  2. For all word vector v in trained GloV, calculate the cosine similarity of v and D'.
  3. Check if the most similar vector to D' is actually intended word D.

Such results can be considered as @top1 like evaluation of an information retrieval. You can change the third step to get @top k.

Upvotes: 1

Related Questions