Object of type bytes is not JSON serializable
Помогите исправить, пожалуйста!
nasty = 0
statuses = twitter_api.GetUserTimeline(screen_name=user, count=twt_num, include_rts=False)
for status in statuses:
if (status.lang == 'en'):
classes = natural_language_classifier.classify('f48968x109-nlc-5062', status.text.encode('utf-8'))
if (classes["top_class"] == "cyberbully"):
nasty += 1
mean = ((float(nasty) / twt_num) * 100)
#if(nasty >= limit):
print ('\033[1m' + account.name)
print ('\033[0m' + "%.0f%% mean tweets" % mean)
И выдает такую ошибку
TypeError Traceback (most recent call last)
<ipython-input-82-4292c20d380b> in <module>
3 for status in statuses:
4 if (status.lang == 'en'):
----> 5 classes = natural_language_classifier.classify('f48968x109-nlc-5062', status.text.encode('utf-8'))
6 if (classes["top_class"] == "cyberbully"):
7 nasty += 1
TypeError: Object of type bytes is not JSON serializable