Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,7 +20,7 @@ class ContentFilter:
|
|
| 20 |
'sexist', 'homophobic', 'transphobic'
|
| 21 |
]
|
| 22 |
|
| 23 |
-
def filter_toxicity(self, text, toxicity_threshold=0.
|
| 24 |
"""
|
| 25 |
Detect toxic content using pre-trained model
|
| 26 |
|
|
@@ -120,7 +120,7 @@ def respond(
|
|
| 120 |
|
| 121 |
# Add toxicity details
|
| 122 |
for category, score in toxicity_details.items():
|
| 123 |
-
if score > 0.
|
| 124 |
warning_message += f"{category} (Score: {score:.2f}), "
|
| 125 |
|
| 126 |
# Add blacklisted keywords
|
|
|
|
| 20 |
'sexist', 'homophobic', 'transphobic'
|
| 21 |
]
|
| 22 |
|
| 23 |
+
def filter_toxicity(self, text, toxicity_threshold=0.5):
|
| 24 |
"""
|
| 25 |
Detect toxic content using pre-trained model
|
| 26 |
|
|
|
|
| 120 |
|
| 121 |
# Add toxicity details
|
| 122 |
for category, score in toxicity_details.items():
|
| 123 |
+
if score > 0.5:
|
| 124 |
warning_message += f"{category} (Score: {score:.2f}), "
|
| 125 |
|
| 126 |
# Add blacklisted keywords
|