SkwarczynskiP commited on
Commit
941c319
·
verified ·
1 Parent(s): cafebd3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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: red; width: {ai_score * 100}%; height: 20px;">AI-generated</div>'
70
- human_bar = f'<div style="background-color: blue; width: {human_score * 100}%; height: 20px;">Human-written</div>'
71
-
72
  # Scale down the size of the outputted text
73
- scaled_label = f'<p style="font-size: 0.8em;">{label} - Confidence Level: {score * 100:.2f}%</p>'
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