kambris commited on
Commit
e8d0964
·
verified ·
1 Parent(s): c63ad9d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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
- 'LABEL_0': 'LABEL_0',
185
- 'LABEL_1': 'LABEL_1',
186
- 'LABEL_2': 'LABEL_2'
187
  }
188
 
189
  # Get dominant sentiment
190
- dominant_emotion = summary['top_emotions'][0]['emotion'] if summary['top_emotions'] else "LABEL_2"
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