Samstag, 16. Mai 2015

My first graphical interpretation of word2vec-Quadrupels as Venn-Diagrams

When I for the first time played around with word2vec, the first interpretation, of the word-analogy-equations, like king - prince + princes = queen that came to mind was a graphical one:


So, it's kind of a Venn-Diagram, the ones you've had in school to visualize intersections and unions of  sets...
Or more sophisticated, in the form of a contingency table, because the sample uses logical opposites, completing each other:


So again, visualized as sets (outline-color shows semantic extent, presupposed, there's no semantic intersection between male/child, child/female, female/adult, adult/male) we get the following:


(which is a simplified version of the first graphic of this post)

we can now deduce, step by step:

1. king - prince yields (keep in mind the "negative" child, indicated by inverse colors!):


2. (king - prince) + princess yields (notice how the "negative" child from result of step 1 and "positive" child from definition of princess, cancel each other out!):


which (by definition) happens to equal queen !!!

q.e.d.