pip install textblob python from textblob import TextBlob def analyze_sentiment(text): blob = TextBlob(text) sentiment = blob.sentiment.polarity if sentiment > 0: elif sentiment < 0: else: sentiment = analyze_sentiment(text)