Python textblob.情绪只会带来积极的情绪

Python textblob.情绪只会带来积极的情绪,python,twitter,sentiment-analysis,textblob,Python,Twitter,Sentiment Analysis,Textblob,我开始在python(2.7)中使用textblob(0.11)进行情绪分析程序。 我从twitter获取tweets并解码json以从tweets中提取文本,然后将文本输入情感分析代码。 代码运行良好,但每次都以“pos”的形式输出情绪。对于许多明显负面的文本,该程序将情绪显示为“Pos” 好心帮忙 import tweepy import json import csv import textblob import unicodedata from tweepy import Stream

我开始在python(2.7)中使用textblob(0.11)进行情绪分析程序。 我从twitter获取tweets并解码json以从tweets中提取文本,然后将文本输入情感分析代码。 代码运行良好,但每次都以“pos”的形式输出情绪。对于许多明显负面的文本,该程序将情绪显示为“Pos”

好心帮忙

import tweepy
import json
import csv
import textblob
import unicodedata
from tweepy import Stream
from tweepy.streaming import StreamListener
from textblob.sentiments import NaiveBayesAnalyzer
import sys
consumer_key = ''
consumer_secret = ''
access_token = ''
access_token_secret = ''

class listener(StreamListener):

def on_data(self,data):
    decoded = json.loads(data)
   decoded=decoded['text']
    print decoded

   blob = textblob.TextBlob(decoded, analyzer=NaiveBayesAnalyzer())
    print (blob.sentiment)


def on_error(self,status):
    print status


if __name__ == '__main__':

auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)

api = tweepy.API(auth)

def on_error(self,status):
    print status


twitterStream = Stream(auth,listener())

twitterStream.filter(track=["#Trend"])