Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -332,6 +332,11 @@ def compute_abuse_score(matched_scores, sentiment):
|
|
332 |
adjusted_score += 10
|
333 |
|
334 |
return min(adjusted_score, 100)
|
|
|
|
|
|
|
|
|
|
|
335 |
def analyze_single_message(text, thresholds):
|
336 |
motif_hits, matched_phrases = detect_motifs(text)
|
337 |
|
|
|
332 |
adjusted_score += 10
|
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}
|
340 |
def analyze_single_message(text, thresholds):
|
341 |
motif_hits, matched_phrases = detect_motifs(text)
|
342 |
|