ArslanXD commited on
Commit
aef8055
Β·
verified Β·
1 Parent(s): f5fbb3f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -15,11 +15,11 @@ def analyze(text):
15
 
16
  weight = {"Neutral":0, "Offensive":0.5, "Sexism":1, "Racism":1, "Religious Discrimination":1}
17
  score = hate_conf * weight.get(hate_label, 0)
18
- action = "No Action Needed"
19
  if score > 0.8:
20
- action = "Immediate Review"
21
  elif score >= 0.49:
22
- action = "Flag for Moderator"
23
 
24
  return hate_label, f"{hate_conf:.2f}", dial_label, f"{dial_conf:.2f}", f"{score:.2f}", action
25
 
 
15
 
16
  weight = {"Neutral":0, "Offensive":0.5, "Sexism":1, "Racism":1, "Religious Discrimination":1}
17
  score = hate_conf * weight.get(hate_label, 0)
18
+ action = "βœ… Safe Content β€” No harmful language detected. No moderation needed."
19
  if score > 0.8:
20
+ action = "🚨 Immediate Review Required β€” This content contains severe hate speech or threats and should be escalated to moderators immediately."
21
  elif score >= 0.49:
22
+ action = "⚠️ Potentially Harmful β€” The content may contain offensive or harmful language. Please review before taking further action."
23
 
24
  return hate_label, f"{hate_conf:.2f}", dial_label, f"{dial_conf:.2f}", f"{score:.2f}", action
25