我正在使用textbob计算单词的准确性
text = 'thank you calling on product support talking to caafic k y please helping with your a digit employ number ing'
orig_words = text.split()
fixed_words = TextBlob(text).correct().split()
words=(len([(x,y) for x,y in zip(orig_words, fixed_words) if x != y])) # => 3
total_word_len=len(orig_words)
correct_words=total_word_len-words
accuraccy=correct_words/total_word_len
但问题是它认为“caafic”、“k”、“y”、“ing”是正确的词。理想情况下,这些词不应被视为正确的词语
目前没有回答
相关问题 更多 >
编程相关推荐