Standford NLP Course(2) - Edit Distance
2015-09-01 17:35
477 查看
Minimum edit distance
How similar are two strings? letter scale / word scale- Insertion
- Deletion
- Substitution
For two strings
X of length n
Y of length m
Define D(i,j)
the edit distance between X[1 … i] and Y[1 … j]
the edit distance between X and Y is D(n,m)
Dynamic Programming for Minimum edit distance动态规划计算最小编辑距离
Levenshtein 莱文斯顿距离
Bottom-up
1. 第一行 第一列加#,表示空字符
2. 空字符和任意x个字符距离都是x,因此第一行第一列直接填1 2 3…
3. 如果第i行第j列字母相同,比较左侧+1(insertion),下面+1(deletion),左下三个数字,取最小值
4. 如果第i行第j列字母不同,比较左侧+1,下面+1,左下+2三个数字(substitution),取最小值
Backtrace
得到距离,还需要知道它是怎么得来的
左侧:Insertion
下方:Deletion
左下:Substitution
Performance
Time: O(nm)
Space: O(mn)
Backtrace: O(m+n)
Weighted Minimum edit distance
Spell Correction: some letters are more likely to be mistyped than others
Biology: certain kinds of deletions or insertions are more likely than others
Minimum Edit Distance in Computational Biology
加了两种情况
所求的不是两者间的距离,而是两者的相似度
可以掐头去尾
但从视频里看更多地用于基因链条分析等等,算法也相对类似,就不仔细贴了
相关文章推荐
- 长期招聘:自然语言处理工程师
- 2014.6.30面百度NLP部实习
- MMSEG中文分词算法
- NLP coursera note 1
- PYTHON 自然语言处理
- 自然语言处理
- 从文本抽取特征
- Installing Moses
- NLP学习笔记
- CoNLL Multi-lingual Dependency Parsing 格式
- deep learning in NLP—深度学习在自然语言处理中的应用—入门学习序列
- deep learning NLP—深度学习,自然语言处理—资源列表
- NLP常用工具
- [NLP] 命名实体识别简要知识点
- LDA摘要
- CTK(Champollion-1.2)----A Sentence Alignment Toll
- Some related topic about QA
- Unable to resolve "edu/stanford/nlp/models/pos-tagger/english-left3words/english-left3words-distsim.
- [NLP]自然语言理解概述