Sephfox commited on
Commit
96a1941
·
verified ·
1 Parent(s): 1ebd803

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -104,7 +104,7 @@ def update_emotion(emotion, percentage, intensity):
104
  # Normalize percentages
105
  total = sum(e['percentage'] for e in emotions.values())
106
  for e in emotions:
107
- emotions[e]['percentage'] = (emotions[e]['percentage'] / total) * 100
108
 
109
  def normalize_context(context):
110
  return context.lower().strip()
@@ -145,7 +145,7 @@ def evolve_emotions():
145
 
146
  for i, (emotion, data) in enumerate(emotions.items()):
147
  data['percentage'] = emotion_values[i]
148
- data['intensity'] = intensities[i]
149
 
150
  # Normalize percentages
151
  total = sum(e['percentage'] for e in emotions.values())
 
104
  # Normalize percentages
105
  total = sum(e['percentage'] for e in emotions.values())
106
  for e in emotions:
107
+ emotions[e]['percentage'] = (emotions[e]['percentage'] / total) * 100
108
 
109
  def normalize_context(context):
110
  return context.lower().strip()
 
145
 
146
  for i, (emotion, data) in enumerate(emotions.items()):
147
  data['percentage'] = emotion_values[i]
148
+ data['intensity'] = intensities[i]
149
 
150
  # Normalize percentages
151
  total = sum(e['percentage'] for e in emotions.values())