Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
91 |
-
|
|
|
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()])
|