Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -333,7 +333,7 @@ def compute_abuse_score(matched_scores, sentiment):
|
|
333 |
|
334 |
return min(adjusted_score, 100)
|
335 |
def get_emotion_profile(text):
|
336 |
-
|
337 |
if isinstance(emotions, list) and isinstance(emotions[0], list):
|
338 |
emotions = emotions[0]
|
339 |
return {e['label'].lower(): round(e['score'], 3) for e in emotions}
|
|
|
333 |
|
334 |
return min(adjusted_score, 100)
|
335 |
def get_emotion_profile(text):
|
336 |
+
emotions = emotion_pipeline(text)
|
337 |
if isinstance(emotions, list) and isinstance(emotions[0], list):
|
338 |
emotions = emotions[0]
|
339 |
return {e['label'].lower(): round(e['score'], 3) for e in emotions}
|