模糊字符串匹配
对一些图像运行光学字符识别后,我得到了近似的文本。通常认可度并不高。例如,实际文本“DATE”为“DHTE”或“0HTE”。基本上我需要识别并提取每一行中的数据,所以我不需要完美的识别,只要足以识别日期线即可。我尝试计算 Levenshtein 编辑距离,但不幸的是,这往往会为 DATE 和 TIME 提供相似的值。目前,我正在尝试探索是否可以使用正则表达式来匹配数据模式。
有没有一种方法/算法可以改善匹配过程?幸运的是,我的词组不是很大。
(我使用 tesseract 进行 ocr 并使用 groovy/java 进行算法)
After running optical char recognition on some images, I get approximate text. Often the recognition is not great. For instance, the actual text "DATE" comes as "DHTE" or "0HTE". Basically I need to identify and extract the data in each line, so i don't want perfect recognition, just enough to identify the date line. I tried to calculate the Levenshtein edit distance, but unfortunately this tends to give similar values for DATE and TIME. At the moment, I'm trying to explore if I can match the data patterns using regular expressions instead.
Is there a method/algorithm to better the matching process? Fortunately, my set of words is not very large.
(i'm using tesseract for ocr and groovy/java for the algorithm)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个有一些很酷的算法
http://secondstring.sourceforge.net/
这是 StringUtils 中的基本一个
莱文斯坦距离
This one has a few pretty cool algorithms
http://secondstring.sourceforge.net/
This is a basic one in StringUtils
levenstein distance