From 0903b69b8e11ab4136b272ee8231ea2d27755eaa Mon Sep 17 00:00:00 2001 From: andrewso <9V5f1FkzI2LD> Date: Fri, 9 Oct 2020 20:11:04 +0100 Subject: [PATCH] [09.10.20] Filtering out neutral tweets --- src/tweets/collector.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tweets/collector.py b/src/tweets/collector.py index b298db5..5e18567 100644 --- a/src/tweets/collector.py +++ b/src/tweets/collector.py @@ -110,9 +110,10 @@ class Listener(StreamListener): if callSpamFilter(cleanedTweet) != 'spam': pos, neu, neg, compound = callSentimentAnalyser(cleanedTweet) - hourTweet = {'pos': pos, 'neu': neu, 'neg': neg, 'compound': compound} + if compound != 0.0: + hourTweet = {'pos': pos, 'neu': neu, 'neg': neg, 'compound': compound} - hourStack.append(hourTweet) + hourStack.append(hourTweet) def collector(hashtag):