Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -181,13 +181,13 @@ def create_topic_map(summaries):
|
|
181 |
if country_en and country_en in coordinates:
|
182 |
# Direct label mapping (no conversion needed)
|
183 |
REVERSE_EMOTION_LABELS = {
|
184 |
-
'
|
185 |
-
'
|
186 |
-
'
|
187 |
}
|
188 |
|
189 |
# Get dominant sentiment
|
190 |
-
dominant_emotion = summary['top_emotions'][0]['emotion'] if summary['top_emotions'] else "
|
191 |
dominant_label = REVERSE_EMOTION_LABELS.get(dominant_emotion, 'LABEL_2')
|
192 |
circle_color = sentiment_colors.get(dominant_label, 'gray')
|
193 |
|
|
|
181 |
if country_en and country_en in coordinates:
|
182 |
# Direct label mapping (no conversion needed)
|
183 |
REVERSE_EMOTION_LABELS = {
|
184 |
+
'positive': 'LABEL_1',
|
185 |
+
'negative': 'LABEL_0',
|
186 |
+
'neutral': 'LABEL_2'
|
187 |
}
|
188 |
|
189 |
# Get dominant sentiment
|
190 |
+
dominant_emotion = summary['top_emotions'][0]['emotion'] if summary['top_emotions'] else "neutral"
|
191 |
dominant_label = REVERSE_EMOTION_LABELS.get(dominant_emotion, 'LABEL_2')
|
192 |
circle_color = sentiment_colors.get(dominant_label, 'gray')
|
193 |
|