Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -66,11 +66,11 @@ def detect_ai_generated_text(model: str, dataset: str, text: str) -> list:
|
|
| 66 |
# Create HTML for the colored bars
|
| 67 |
ai_score = score if label == "AI-generated" else 1 - score
|
| 68 |
human_score = 1 - ai_score
|
| 69 |
-
ai_bar = f'<div style="background-color:
|
| 70 |
-
human_bar = f'<div style="background-color:
|
| 71 |
-
|
| 72 |
# Scale down the size of the outputted text
|
| 73 |
-
scaled_label = f'
|
| 74 |
|
| 75 |
return [scaled_label, ai_bar, human_bar]
|
| 76 |
|
|
|
|
| 66 |
# Create HTML for the colored bars
|
| 67 |
ai_score = score if label == "AI-generated" else 1 - score
|
| 68 |
human_score = 1 - ai_score
|
| 69 |
+
ai_bar = f'<div style="margin-bottom: 1em;"><div style="background-color: #ff7f7f; width: {ai_score * 100}%; height: 20px;"></div><div>AI-generated</div></div>'
|
| 70 |
+
human_bar = f'<div style="margin-bottom: 1em;"><div style="background-color: #7f7fff; width: {human_score * 100}%; height: 20px;"></div><div>Human-written</div></div>'
|
| 71 |
+
|
| 72 |
# Scale down the size of the outputted text
|
| 73 |
+
scaled_label = f'{label} - Confidence Level: {score * 100:.2f}%'
|
| 74 |
|
| 75 |
return [scaled_label, ai_bar, human_bar]
|
| 76 |
|