我一直在研究不同的算法,但还没有找到我正在寻找的东西。
Hamming 距离(仅适用于相同长度的字符串) Levenstein 距离(查找类似的词,如 kitten 和 sitten)
我正在寻找的是可以找到关于相同想法的句子的东西。
例如:
Sentence 1: Josh got hurt while playing in the park. Sentence 2: Josh fell off the slide and got hurt at the park. Sentence 3: Be careful at the park, your kids could get hurt. Sentence 4: Josh likes to go shopping.
我正在寻找的会考虑
sentence 1 and 2
关于主题,但不是 sentence 3 or 4
。
我想我可以尝试比较句子中的每个单词?
我将非常感谢任何能指出我正确方向的人。