一个句子字级编辑距离 [英] Word-level edit distance of a sentence

查看:417
本文介绍了一个句子字级编辑距离的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法,可以让你找到2句之间的字级编辑距离的算法? 对于例如,大发狗和大房子胖狗有1替补,3插入

Is there an algorithm that lets you find the word-level edit distance between 2 sentences? For eg., "A Big Fat Dog" and "The Big House with the Fat Dog" have 1 substitute, 3 insertions

推荐答案

您可以使用被用于查找字符串编辑距离找到句子编辑距离相同的算法。你可以把一个句子从一个字母绘制的字符串的每个字符是一个字的英语(假设空间被用来标记,其中一个字启动和下端)。任何标准算法计算编辑距离,如标准动态规划方法计算Levenshtein距离,可适应解决这个问题。

You can use the same algorithms that are used for finding edit distance in strings to find edit distances in sentences. You can think of a sentence as a string drawn from an alphabet where each character is a word in the English language (assuming that spaces are used to mark where one "character" starts and the next ends). Any standard algorithm for computing edit distance, such as the standard dynamic programming approach for computing Levenshtein distance, can be adapted to solve this problem.

这篇关于一个句子字级编辑距离的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆