diff --git a/src/tweets/collector.py b/src/tweets/collector.py index 3205f9e..4f4ec1d 100644 --- a/src/tweets/collector.py +++ b/src/tweets/collector.py @@ -171,12 +171,12 @@ def createHourJob(): global timeF timeF = timeFunction() - # processTweet() + processStack = hourStack.copy() log("Extracting sentiment scores...", 'INFO') - if len(hourStack) != 0: - log("Process stack size is :: [{}]".format(len(hourStack)), 'INFO') + if len(processStack) != 0: + log("Process stack size is :: [{}]".format(len(processStack)), 'INFO') for item in hourStack: ovPos = ovPos + item['pos'] ovNeu = ovNeu + item['neu'] @@ -184,10 +184,10 @@ def createHourJob(): ovCompound = ovCompound + item['compound'] type = item["type"] - pos = round(ovPos/len(hourStack), 3) - neu = round(ovNeu/len(hourStack), 3) - neg = round(ovNeg/len(hourStack), 3) - compound = round(ovCompound/len(hourStack), 3) + pos = round(ovPos/len(processStack), 3) + neu = round(ovNeu/len(processStack), 3) + neg = round(ovNeg/len(processStack), 3) + compound = round(ovCompound/len(processStack), 3) if type == "bitcoin": type = 'btc_usd'