[英]Why does TextBlob 0.3.7 sometimes generate sentiment polarity of less than -1
I recently started using the TextBlob package for Python (version 0.3.7). 我最近开始使用适用于Python(0.3.7版)的TextBlob包。 According to the documentation, the
.sentiment
method returns a tuple of sentiment polarity and subjectivity, with the defined range for polarity being between -1
and +1
. 根据该文档,
.sentiment
方法返回情感极性和主观性的元组,极性的定义范围在-1
和+1
之间。
However, this code gives me a polarity value of -1.24
. 但是,此代码给我的极性值为
-1.24
。
Is this a known bug or is there anything wrong with my usage of the code? 这是一个已知的错误,还是我的代码使用有问题?
from text.blob import TextBlob
MyText = '''
tired of nbc universal. got 2 of the 3 periods of tonight's game and 62 of the 78 laps of the f1 race in monaco. stop the pregame crap and fill it with the event you morons!!!!!!
'''
text = TextBlob(MyText)
print text.sentiment
This is a known bug in 0.3.7. 这是0.3.7中的已知错误。 There have been significant updates since version 0.3.7, including improved sentiment analysis, so I would update to the latest version (0.5.2 as of this writing).
自0.3.7版以来,已有重大更新,包括改进的情感分析,因此我将更新为最新版(撰写本文时为0.5.2)。 This can be done with
这可以用
pip install -U textblob
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.