Reputation: 825
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
Reputation: 4318
Evaluation steps for any A B C D
:
D'
with D' = A-C+B
.v
in trained GloV, calculate the cosine similarity of v
and D'
.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