SamanthaStorm commited on
Commit
6e598a6
·
verified ·
1 Parent(s): 1202ad3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -85,9 +85,9 @@ def get_emotional_tone_tag(emotions, sentiment, patterns, abuse_score=0):
85
  # Main function
86
  def analyze_message(text):
87
  preprocessed = preprocess_sentiment_text(text)
88
- sentiment_result = sst_classifier(preprocessed)[0]
89
- sentiment_label = "supportive" if sentiment_result["label"] == "POSITIVE" else "undermining"
90
- sentiment_score = round(sentiment_result["score"] * 100, 2)
91
 
92
  emotions = get_emotion_profile(text)
93
  emotion_summary = "\n".join([f"{k.title()}: {v:.2f}" for k, v in emotions.items()])
 
85
  # Main function
86
  def analyze_message(text):
87
  preprocessed = preprocess_sentiment_text(text)
88
+ sentiment = sst_result[0] # get the first result
89
+ sentiment_label = "supportive" if sentiment["label"] == "POSITIVE" else "undermining"
90
+ sentiment_score = round(sentiment["score"] * 100, 2)
91
 
92
  emotions = get_emotion_profile(text)
93
  emotion_summary = "\n".join([f"{k.title()}: {v:.2f}" for k, v in emotions.items()])