如何计算单词的准确度?

2024-09-28 05:24:37 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用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”是正确的词。理想情况下,这些词不应被视为正确的词语


Tags: textlen单词wordtotalfixedsplitwords

热门问题