Spaces:
Running
Running
abrar-adnan
commited on
Commit
•
3b983a7
1
Parent(s):
ed2cf11
Update app.py
Browse files
app.py
CHANGED
@@ -182,13 +182,13 @@ def video_processing(video_file, encoded_video):
|
|
182 |
"text_sentiment" : text_sentiment
|
183 |
}
|
184 |
|
185 |
-
for item in final_result_dict
|
186 |
emotions = item['face_emotion']
|
187 |
top_emotions = dict(sorted(emotions.items(), key=lambda x: x[1], reverse=True)[:3])
|
188 |
item['face_emotion'] = top_emotions
|
189 |
|
190 |
# Update the text_emotion data
|
191 |
-
for item in final_result_dict
|
192 |
emotions = item['text_emotion']
|
193 |
top_emotions = sorted(emotions, key=lambda x: x['score'], reverse=True)[:3]
|
194 |
item['text_emotion'] = top_emotions
|
|
|
182 |
"text_sentiment" : text_sentiment
|
183 |
}
|
184 |
|
185 |
+
for item in final_result_dict:
|
186 |
emotions = item['face_emotion']
|
187 |
top_emotions = dict(sorted(emotions.items(), key=lambda x: x[1], reverse=True)[:3])
|
188 |
item['face_emotion'] = top_emotions
|
189 |
|
190 |
# Update the text_emotion data
|
191 |
+
for item in final_result_dict:
|
192 |
emotions = item['text_emotion']
|
193 |
top_emotions = sorted(emotions, key=lambda x: x['score'], reverse=True)[:3]
|
194 |
item['text_emotion'] = top_emotions
|