我试图用fuzzyfuzzy来纠正文本中拼写错误的名字。但是我得不到工艺提取以及工艺提取酮按照我期望的方式行事。在
from fuzzywuzzy import process
the_text = 'VICTOR HUGO e MARIANA VEIGA'
search_term = 'VEYGA'
the_text = the_text.split()
found_word = process.extract(search_term, the_text)
print(found_word)
这将导致:
^{pr2}$我怎样才能让fuzzyfuzzy正确识别“VEIGA”作为正确的回答?在
您可以尝试使用:fuzz.token_set_比率或者fuzz.token_sort_比率 这里的答案是:When to use which fuzz function to compare 2 strings给出了一个很好的解释。在
对于completes,这里有一些代码:
输出:
[('VEIGA',80),('e',33),('HUGO',22),('VICTOR',18),('MARIANA',17)]
相关问题 更多 >
编程相关推荐