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