Article_Analyzer / sentiment_analysis.py
Karna-AI's picture
Re-uploaded project files
44a3830
raw
history blame contribute delete
260 Bytes
from textblob import TextBlob
def ana_sentiment(text):
analysis = TextBlob(text)
polarity = analysis.sentiment.polarity
if polarity > 0:
return "Positive"
elif polarity < 0:
return "Negative"
else:
return "Neutral"