Spaces:
Runtime error
Runtime error
jaifar530
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -286,9 +286,7 @@ if press_me_button:
|
|
| 286 |
file_prefix = 'not_trancated_full_paragraph.xlsx'
|
| 287 |
|
| 288 |
# Load the models and vectorizer
|
| 289 |
-
|
| 290 |
-
# extra_trees_model = pickle.load(f"{file_prefix}_extra_trees_model.pkl")
|
| 291 |
-
# vectorizer = pickle.load(f"{file_prefix}_vectorizer.pkl")
|
| 292 |
with open(f"{file_prefix}_ridge_model.pkl", 'rb') as file:
|
| 293 |
ridge_model = pickle.load(file)
|
| 294 |
|
|
@@ -323,7 +321,7 @@ if press_me_button:
|
|
| 323 |
cnn_name, ridge_name, extra_trees_name = get_author_display_name(predicted_author, ridge_prediction, extra_trees_prediction)
|
| 324 |
|
| 325 |
if ridge_prediction == extra_trees_prediction == predicted_author:
|
| 326 |
-
st.success(f"Most likely written by: {ridge_name}", icon="✅")
|
| 327 |
st.info("We are quite confident in the accuracy of this result.", icon="ℹ️")
|
| 328 |
|
| 329 |
else:
|
|
@@ -371,36 +369,36 @@ if press_me_button:
|
|
| 371 |
cnn_name, ridge_name, extra_trees_name = get_author_display_name(predicted_author, ridge_prediction, extra_trees_prediction)
|
| 372 |
|
| 373 |
if ridge_prediction == extra_trees_prediction == predicted_author:
|
| 374 |
-
st.success(f"Most likely written by: {ridge_name}", icon="✅")
|
| 375 |
st.write("_" * 30)
|
| 376 |
-
st.warning(f"The input text has been magnified {amplify} times to better capture its characteristics and patterns.", icon="⚠️")
|
| 377 |
|
| 378 |
elif ridge_prediction == extra_trees_prediction:
|
| 379 |
-
st.success(f"Most likely written by: {ridge_name}", icon="✅")
|
| 380 |
-
st.success(f"2nd Most likely written by: {cnn_name}", icon="✅")
|
| 381 |
st.write("_" * 30)
|
| 382 |
-
st.warning(f"The input text has been magnified {amplify} times to better capture its characteristics and patterns.", icon="⚠️")
|
| 383 |
|
| 384 |
elif extra_trees_prediction == predicted_author:
|
| 385 |
-
st.success(f"Most likely written by: {extra_trees_name}", icon="✅")
|
| 386 |
-
st.success(f"2nd Most likely written by: {ridge_name}", icon="✅")
|
| 387 |
st.write("_" * 30)
|
| 388 |
-
st.warning(f"The input text has been magnified {amplify} times to better capture its characteristics and patterns.", icon="⚠️")
|
| 389 |
|
| 390 |
elif ridge_prediction == predicted_author:
|
| 391 |
-
st.success(f"Most likely written by: {ridge_name}", icon="✅")
|
| 392 |
-
st.success(f"2nd Most likely written by: {extra_trees_name}", icon="✅")
|
| 393 |
st.write("_" * 30)
|
| 394 |
-
st.warning(f"The input text has been magnified {amplify} times to better capture its characteristics and patterns.", icon="⚠️")
|
| 395 |
|
| 396 |
|
| 397 |
else:
|
| 398 |
-
st.warning("
|
| 399 |
-
st.success(f"1- {ridge_name}", icon="✅")
|
| 400 |
-
st.success(f"2- {cnn_name}", icon="✅")
|
| 401 |
-
st.success(f"3- {extra_trees_name}", icon="✅")
|
| 402 |
st.write("_" * 30)
|
| 403 |
-
st.warning(f"The input text has been magnified {amplify} times to better capture its characteristics and patterns.", icon="⚠️")
|
| 404 |
|
| 405 |
# with st.expander("What is this project about?"):
|
| 406 |
# st.write("""
|
|
|
|
| 286 |
file_prefix = 'not_trancated_full_paragraph.xlsx'
|
| 287 |
|
| 288 |
# Load the models and vectorizer
|
| 289 |
+
|
|
|
|
|
|
|
| 290 |
with open(f"{file_prefix}_ridge_model.pkl", 'rb') as file:
|
| 291 |
ridge_model = pickle.load(file)
|
| 292 |
|
|
|
|
| 321 |
cnn_name, ridge_name, extra_trees_name = get_author_display_name(predicted_author, ridge_prediction, extra_trees_prediction)
|
| 322 |
|
| 323 |
if ridge_prediction == extra_trees_prediction == predicted_author:
|
| 324 |
+
st.success(f"Most likely written by: **{ridge_name}**", icon="✅")
|
| 325 |
st.info("We are quite confident in the accuracy of this result.", icon="ℹ️")
|
| 326 |
|
| 327 |
else:
|
|
|
|
| 369 |
cnn_name, ridge_name, extra_trees_name = get_author_display_name(predicted_author, ridge_prediction, extra_trees_prediction)
|
| 370 |
|
| 371 |
if ridge_prediction == extra_trees_prediction == predicted_author:
|
| 372 |
+
st.success(f"Most likely written by: **{ridge_name}**", icon="✅")
|
| 373 |
st.write("_" * 30)
|
| 374 |
+
st.warning(f"**Notice:** The input text has been magnified {amplify} times to better capture its characteristics and patterns.", icon="⚠️")
|
| 375 |
|
| 376 |
elif ridge_prediction == extra_trees_prediction:
|
| 377 |
+
st.success(f"Most likely written by: **{ridge_name}**", icon="✅")
|
| 378 |
+
st.success(f"2nd Most likely written by: **{cnn_name}**", icon="✅")
|
| 379 |
st.write("_" * 30)
|
| 380 |
+
st.warning(f"**Notice:** The input text has been magnified {amplify} times to better capture its characteristics and patterns.", icon="⚠️")
|
| 381 |
|
| 382 |
elif extra_trees_prediction == predicted_author:
|
| 383 |
+
st.success(f"Most likely written by: **{extra_trees_name}**", icon="✅")
|
| 384 |
+
st.success(f"2nd Most likely written by: **{ridge_name}**", icon="✅")
|
| 385 |
st.write("_" * 30)
|
| 386 |
+
st.warning(f"**Notice:** The input text has been magnified {amplify} times to better capture its characteristics and patterns.", icon="⚠️")
|
| 387 |
|
| 388 |
elif ridge_prediction == predicted_author:
|
| 389 |
+
st.success(f"Most likely written by: **{ridge_name}**", icon="✅")
|
| 390 |
+
st.success(f"2nd Most likely written by: **{extra_trees_name}**", icon="✅")
|
| 391 |
st.write("_" * 30)
|
| 392 |
+
st.warning(f"**Notice:** The input text has been magnified {amplify} times to better capture its characteristics and patterns.", icon="⚠️")
|
| 393 |
|
| 394 |
|
| 395 |
else:
|
| 396 |
+
st.warning("Notice 1: There is a difficulity predicting this text, it might fill into one of the below:", icon="⚠️")
|
| 397 |
+
st.success(f"1- **{ridge_name}**", icon="✅")
|
| 398 |
+
st.success(f"2- **{cnn_name}**", icon="✅")
|
| 399 |
+
st.success(f"3- **{extra_trees_name}**", icon="✅")
|
| 400 |
st.write("_" * 30)
|
| 401 |
+
st.warning(f"**Notice 2:** The input text has been magnified {amplify} times to better capture its characteristics and patterns.", icon="⚠️")
|
| 402 |
|
| 403 |
# with st.expander("What is this project about?"):
|
| 404 |
# st.write("""
|