私が2つの文を持っているとしましょう:
「速い茶色のキツネが怠惰な犬を飛び越える」
「速い茶色のバニーが怠惰な猫を飛び越える」
これら2つの文の類似度を検出するアルゴリズムはありますか?例えば:
function similarity_ratio($text1, $text2) {
code code code
return $similarity_ratio;
}
$text1 = "The quick brown fox jumps over the lazy dog";
$text2 = "The quick brown cat jumps over the lazy chicken";
echo similarity_ratio($text1, $text2);
// output 88%