Spaces:
Runtime error
Runtime error
added yellow to highlighter + adjusted thresholds
Browse files
app.py
CHANGED
@@ -173,8 +173,10 @@ def detection_polygraf(text, model="BC Original"):
|
|
173 |
for sentence in temp_sentences:
|
174 |
if scores[i]:
|
175 |
avg_score = sum(scores[i]) / len(scores[i])
|
176 |
-
if avg_score >= 0.
|
177 |
colored_sentence = f"<span style='background-color:red;'>{sentence}</span>"
|
|
|
|
|
178 |
else:
|
179 |
colored_sentence = sentence
|
180 |
colored_sentences.append(colored_sentence)
|
|
|
173 |
for sentence in temp_sentences:
|
174 |
if scores[i]:
|
175 |
avg_score = sum(scores[i]) / len(scores[i])
|
176 |
+
if avg_score >= 0.70:
|
177 |
colored_sentence = f"<span style='background-color:red;'>{sentence}</span>"
|
178 |
+
elif avg_score >= 0.55:
|
179 |
+
colored_sentence = f"<span style='background-color:GoldenRod;'>{sentence}</span>"
|
180 |
else:
|
181 |
colored_sentence = sentence
|
182 |
colored_sentences.append(colored_sentence)
|