NLP - Sentiment Analysis Advanced
Identify the bug in this negation handling code snippet:
negate = False
for word in sentence.split():
if word == 'not':
negate = True
elif word in sentiment_dict:
if negate:
sentiment_score += sentiment_dict[word]
else:
sentiment_score += sentiment_dict[word]
negate = False
