←back to thread

176 points nxa | 1 comments | | HN request time: 0.207s | source

I've been playing with embeddings and wanted to try out what results the embedding layer will produce based on just word-by-word input and addition / subtraction, beyond what many videos / papers mention (like the obvious king-man+woman=queen). So I built something that doesn't just give the first answer, but ranks the matches based on distance / cosine symmetry. I polished it a bit so that others can try it out, too.

For now, I only have nouns (and some proper nouns) in the dataset, and pick the most common interpretation among the homographs. Also, it's case sensitive.

1. ale42 ◴[] No.43994225[source]
Not what it's meant for, I guess, but it's not very strong at chemistry ;-)

  salt - chlorine + potassium = sodium
  chlorine + sodium = rubidium
  water - hydrogen = tap water
It also has some other interesting outputs:

  woman + man = adult female body (already reported by someone else)
  man - hand = woman
  woman - hand = businesswoman
  businessman - male + female = industrialist
  telephone + antenna = television equipment
  olive oil - oil = hearth money