logoalt Hacker News

Show HN: Semantic Calculator (king-man+woman=?)

176 pointsby nxa05/14/2025172 commentsview on HN

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.


Comments

zerof1l05/14/2025

male + age = female

female + age = male

jryb05/15/2025

Just inverting the canonical example fails: queen - woman + man = drone

show 1 reply
doubtfuluser05/15/2025

doctor - man + woman = medical practitioner

Good to understand this bias before blindly applying these models (Yes- doctor is gender neutral - even women can be doctors!!)

show 1 reply
blobbers05/14/2025

rice + fish = fish meat

rice + fish + raw = meat

hahaha... I JUST WANT SUSHI!

737373737305/14/2025

it doesn't know the word human

G1N05/14/2025

twelve-ten+five=

six (84%)

Close enough I suppose

bluelightning2k05/15/2025

potato + microwave = potato tree

tlhunter05/14/2025

man + woman = adult female body

downboots05/14/2025

three + two = four (90%)

show 1 reply
erulabs05/15/2025

dog - fur = Aegean civilization (22%)

huh

atum4705/15/2025

horse+man

78% male horse 72% horseman

adzm05/14/2025

noodle+tomato=pasta

this is pretty fun

show 1 reply
ainiriand05/15/2025

dog+woman = man

That's weird.

mannykannot05/15/2025

Now I'm wondering if this could be helpful in doing the NY Times Connections puzzle.

quantum_state05/14/2025

The app produces nonsense ... such as quantum - superposition = quantum theory !!!

kataqatsi05/14/2025

garden + sin = gardening

hmm...

woodruffw05/14/2025

colorless+green+ideas doesn't produce anything of interest, which is disappointing.

show 1 reply
insane_dreamer05/15/2025

carbon + oxygen = nitrogen

LOL

throwaway98439305/15/2025

[dead]

ephou705/14/2025

[flagged]

ezbie05/14/2025

Can someone explain me what the fuck this is supposed to be!?

show 2 replies
spinarrets05/15/2025

cheeseburger-giraffe+space-kidney-monkey = cheesecake