【发布时间】:2021-09-20 11:00:27
【问题描述】:
下面是我的代码:
from fuzzywuzzy import fuzz
check = open("text.txt","a")
MIN_MATCH_SCORE = 30
heard_word = 'i5-1135G7 '
possible_words = check
guessed_word = [word for word in possible_words if fuzz.ratio(heard_word, word) >=
MIN_MATCH_SCORE]
print ('this one - ', guessed_word)
预期输出:
11th Generation Intel® Core™ i5-1135G7 Processor
是否可以仅通过单独给出“i5-1135G7”来获得预期输出中的整个句子?有没有其他解决方案可以得到我的期望?提前谢谢你。
下面是 text.txt 的链接
https://drive.google.com/file/d/1Mo3qFmeOAqa3WPPyg8SpeFVSjDx7AQBj/view
【问题讨论】:
标签: python machine-learning nlp nltk fuzzywuzzy