SamanthaStorm commited on
Commit
b7213fa
·
verified ·
1 Parent(s): b08d566

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -87,8 +87,9 @@ def analyze_message(text):
87
  preprocessed = preprocess_sentiment_text(text)
88
  sst_result = sst_classifier(preprocessed)[0] # <- this line was missing!
89
 
90
- sentiment_label = "supportive" if sst_result["label"] == "POSITIVE" else "undermining"
91
- sentiment_score = round(sst_result["score"] * 100, 2)
 
92
 
93
  emotions = get_emotion_profile(text)
94
  emotion_summary = "\n".join([f"{k.title()}: {v:.2f}" for k, v in emotions.items()])
 
87
  preprocessed = preprocess_sentiment_text(text)
88
  sst_result = sst_classifier(preprocessed)[0] # <- this line was missing!
89
 
90
+ sst_output = sst_classifier(preprocessed)
91
+ sentiment = sst_output[0]
92
+ sentiment_label = "supportive" if sentiment["label"] == "POSITIVE" else "undermining"
93
 
94
  emotions = get_emotion_profile(text)
95
  emotion_summary = "\n".join([f"{k.title()}: {v:.2f}" for k, v in emotions.items()])