0

私は肯定的な言葉と否定的な言葉の textblob モジュールをテストしています。しかし、一部の結果は良くありません。例えば ​​:

コード:

from textblob.sentiments import NaiveBayesAnalyzer
from textblob import TextBlob

message = "Fraud"
blob = TextBlob(message, analyzer=NaiveBayesAnalyzer())
a = (blob.sentiment)
print(a)

結果

Sentiment(classification='pos', p_pos=0.6428571428571429, p_neg=0.3571428571428571)

90% の正解が得られますが、一部の単語では誤った結果が返されます!!!

like : message = "like this" センチメント(classification='neg', p_pos=0.4794333489299875, p_neg=0.5205666510700125)

message = "good habits"
Sentiment(classification='neg', p_pos=0.41318402216578204, p_neg=0.5868159778342183)

=====================================

"fraud" = pos
"like this" = neg
"good habits" = neg
4

1 に答える 1