import nltk
from nltk.sentiment import SentimentIntensityAnalyzer
def analyze_sentiment(text):
sia = SentimentIntensityAnalyzer()
sentiment_score = sia.polarity_scores(text)['compound']
if sentiment_score >= 0.05:
return "Positive"
elif sentiment_score <= -0.05:
return "Negative"
else:
return "Neutral"
if __name__ == "__main__":
user_input = input("Enter text for sentiment analysis: ")
0 Comments