Spaces:
Runtime error
Runtime error
jaifar530 commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -315,9 +315,7 @@ if press_me_button:
|
|
| 315 |
"huggingface": "HuggingChat",
|
| 316 |
"human": "Human-Written"
|
| 317 |
}
|
| 318 |
-
|
| 319 |
-
# ridge_name = author_map.get(ridge_prediction[0], ridge_prediction[0])
|
| 320 |
-
# extra_trees_name = author_map.get(extra_trees_prediction[0], extra_trees_prediction[0])
|
| 321 |
|
| 322 |
cnn_name, ridge_name, extra_trees_name = get_author_display_name(predicted_author, ridge_prediction, extra_trees_prediction)
|
| 323 |
with st.expander("1st iteration Details..."):
|
|
@@ -328,11 +326,12 @@ if press_me_button:
|
|
| 328 |
display_name = author_map.get(author, author) # Retrieve the display name, fall back to original if not found
|
| 329 |
st.write(f"{display_name}: {prob * 100:.2f}%")
|
| 330 |
st.progress(float(prob))
|
| 331 |
-
|
| 332 |
if ridge_prediction == extra_trees_prediction == predicted_author:
|
| 333 |
st.success(f"Most likely written by: **{ridge_name}**", icon="✅")
|
| 334 |
st.info("We are quite confident in the accuracy of this result.", icon="ℹ️")
|
| 335 |
-
|
|
|
|
| 336 |
else:
|
| 337 |
# Repeat the text with a space at the end of each iteration
|
| 338 |
|
|
@@ -355,7 +354,7 @@ if press_me_button:
|
|
| 355 |
else:
|
| 356 |
amplify = math.ceil(max_word_count / word_count)
|
| 357 |
|
| 358 |
-
for _ in range(
|
| 359 |
repeated_text += new_text + " "
|
| 360 |
|
| 361 |
new_text = repeated_text
|
|
|
|
| 315 |
"huggingface": "HuggingChat",
|
| 316 |
"human": "Human-Written"
|
| 317 |
}
|
| 318 |
+
|
|
|
|
|
|
|
| 319 |
|
| 320 |
cnn_name, ridge_name, extra_trees_name = get_author_display_name(predicted_author, ridge_prediction, extra_trees_prediction)
|
| 321 |
with st.expander("1st iteration Details..."):
|
|
|
|
| 326 |
display_name = author_map.get(author, author) # Retrieve the display name, fall back to original if not found
|
| 327 |
st.write(f"{display_name}: {prob * 100:.2f}%")
|
| 328 |
st.progress(float(prob))
|
| 329 |
+
st.write(f"Sorted probab: {sorted_probabilities[0][0] }")
|
| 330 |
if ridge_prediction == extra_trees_prediction == predicted_author:
|
| 331 |
st.success(f"Most likely written by: **{ridge_name}**", icon="✅")
|
| 332 |
st.info("We are quite confident in the accuracy of this result.", icon="ℹ️")
|
| 333 |
+
|
| 334 |
+
elif sorted_probabilities[0][0] == 0.1 :
|
| 335 |
else:
|
| 336 |
# Repeat the text with a space at the end of each iteration
|
| 337 |
|
|
|
|
| 354 |
else:
|
| 355 |
amplify = math.ceil(max_word_count / word_count)
|
| 356 |
|
| 357 |
+
for _ in range(amplify):
|
| 358 |
repeated_text += new_text + " "
|
| 359 |
|
| 360 |
new_text = repeated_text
|