Is there an algorithm that tells the semantic similarity of two phrases

后端 未结 11 1269
孤独总比滥情好
孤独总比滥情好 2020-11-27 09:44

input: phrase 1, phrase 2

output: semantic similarity value (between 0 and 1), or the probability these two phrases are talking about the same thing

11条回答
  •  执笔经年
    2020-11-27 10:21

    You might want to check into the WordNet project at Princeton University. One possible approach to this would be to first run each phrase through a stop-word list (to remove "common" words such as "a", "to", "the", etc.) Then for each of the remaining words in each phrase, you could compute the semantic "similarity" between each of the words in the other phrase using a distance measure based on WordNet. The distance measure could be something like: the number of arcs you have to pass through in WordNet to get from word1 to word2.

    Sorry this is pretty high-level. I've obviously never tried this. Just a quick thought.

提交回复
热议问题