Given a set of 10 words (["dog", "cat", "rabbit" .... ]) I'd like to find the lowest common hypernym if there's one.
I know that WordNet lets you find one between two synsets, but what would be a good way to find it among multiple words?
My problem comes from the fact each word has a set of sysnets, in which each member of this set can have a different hypernym, and each hypernym has a set of synsets, and so on. So a naive algorithm would end up doing a lot of iterations.
Given two words (synsets) in WordNet, find their lowest common hypernym (LCH). Then find the LCH of that hypernym and the next word. Repeat until you have done all the words. In code this could look like this:
You'll have to do N iterations, where N is the size of your list, but there's no way around that.