Spaces:
Running
Running
Commit
·
f850f13
1
Parent(s):
0521579
upadted
Browse files
app.py
CHANGED
|
@@ -420,7 +420,8 @@ def humanize_text(
|
|
| 420 |
|
| 421 |
# Calculate similarity
|
| 422 |
similarity = calculate_similarity(input_text, result)
|
| 423 |
-
|
|
|
|
| 424 |
|
| 425 |
# Generate status message
|
| 426 |
if not stages_applied:
|
|
@@ -428,7 +429,7 @@ def humanize_text(
|
|
| 428 |
else:
|
| 429 |
status = f"✅ Successfully applied: {', '.join(stages_applied)}"
|
| 430 |
|
| 431 |
-
return result, similarity, status,
|
| 432 |
|
| 433 |
except Exception as e:
|
| 434 |
logger.error(f"Error in humanization: {e}")
|
|
@@ -471,8 +472,14 @@ def create_gradio_interface():
|
|
| 471 |
with gr.Row():
|
| 472 |
similarity_output = gr.Number(label="Similarity Score", precision=4)
|
| 473 |
status_output = gr.Textbox(label="Status",interactive=False,lines=2, max_lines=10)
|
| 474 |
-
|
| 475 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 476 |
|
| 477 |
with gr.Column(scale=1):
|
| 478 |
gr.Markdown("## 🎛️ Pipeline Configuration")
|
|
@@ -520,13 +527,13 @@ def create_gradio_interface():
|
|
| 520 |
hedge_prob, booster_prob, connector_prob, starter_prob,
|
| 521 |
split_prob, merge_prob, min_split_length, max_merge_length
|
| 522 |
],
|
| 523 |
-
outputs=[output_text, similarity_output, status_output,
|
| 524 |
)
|
| 525 |
|
| 526 |
clear_btn.click(
|
| 527 |
fn=lambda: ("", "", 0.0, ""),
|
| 528 |
inputs=[],
|
| 529 |
-
outputs=[input_text, output_text, similarity_output, status_output]
|
| 530 |
)
|
| 531 |
|
| 532 |
return demo
|
|
|
|
| 420 |
|
| 421 |
# Calculate similarity
|
| 422 |
similarity = calculate_similarity(input_text, result)
|
| 423 |
+
ai_content_label_generated, ai_content_score_generated = predict_ai_content(result)
|
| 424 |
+
ai_content_label_input, ai_content_score_input = predict_ai_content(input_text)
|
| 425 |
|
| 426 |
# Generate status message
|
| 427 |
if not stages_applied:
|
|
|
|
| 429 |
else:
|
| 430 |
status = f"✅ Successfully applied: {', '.join(stages_applied)}"
|
| 431 |
|
| 432 |
+
return result, similarity, status,ai_content_label_generated, ai_content_score_generated,ai_content_label_input, ai_content_score_input
|
| 433 |
|
| 434 |
except Exception as e:
|
| 435 |
logger.error(f"Error in humanization: {e}")
|
|
|
|
| 472 |
with gr.Row():
|
| 473 |
similarity_output = gr.Number(label="Similarity Score", precision=4)
|
| 474 |
status_output = gr.Textbox(label="Status",interactive=False,lines=2, max_lines=10)
|
| 475 |
+
|
| 476 |
+
with gr.Row():
|
| 477 |
+
ai_content_label_input = gr.Textbox(label="AI Content Detection", interactive=False)
|
| 478 |
+
ai_content_score_input = gr.Number(label="AI Content Score", precision=4, interactive=False)
|
| 479 |
+
|
| 480 |
+
with gr.Row():
|
| 481 |
+
ai_content_label_generated = gr.Textbox(label="AI Content Detection", interactive=False)
|
| 482 |
+
ai_content_score_generated = gr.Number(label="AI Content Score", precision=4, interactive=False)
|
| 483 |
|
| 484 |
with gr.Column(scale=1):
|
| 485 |
gr.Markdown("## 🎛️ Pipeline Configuration")
|
|
|
|
| 527 |
hedge_prob, booster_prob, connector_prob, starter_prob,
|
| 528 |
split_prob, merge_prob, min_split_length, max_merge_length
|
| 529 |
],
|
| 530 |
+
outputs=[output_text, similarity_output, status_output,]
|
| 531 |
)
|
| 532 |
|
| 533 |
clear_btn.click(
|
| 534 |
fn=lambda: ("", "", 0.0, ""),
|
| 535 |
inputs=[],
|
| 536 |
+
outputs=[input_text, output_text, similarity_output, status_output,ai_content_label_generated, ai_content_score_generated,ai_content_label_input, ai_content_score_input]
|
| 537 |
)
|
| 538 |
|
| 539 |
return demo
|