0

I can't tell how to get the correct scores for positive, negative and neutral under the "TODO" in application.py, here:

# TODO
positive, negative, neutral = 0.0, 0.0, 100.0

That isn't all we have to do on that file, though, is it? It also said to analyze tweets. Do I do the same thing as in tweets for that?

1 Answer 1

1

Yes, in the application.py you need to implement almost the same code as you have written in tweets.

  • load positive.file and negative.file into memory
  • analyze each tweet

positive = 0 negative = 0 neutral = 0 score = 0

for tweet in tweets:

    score = analyzer.analyze(tweet)

    if score > 0.0:
        positive += 1
    elif score < 0.0:
        negative += 1
    else:
        neutral += 1

    score = 0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .