Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,13 +7,24 @@ def analyze_text(user_text):
|
|
| 7 |
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
| 8 |
gr.Markdown(
|
| 9 |
"""
|
| 10 |
-
#
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
"""
|
| 14 |
)
|
| 15 |
|
| 16 |
with gr.Row():
|
|
|
|
|
|
|
|
|
|
| 17 |
with gr.Column(scale=2):
|
| 18 |
user_input = gr.Textbox(
|
| 19 |
label="✍️ Enter Text",
|
|
@@ -30,12 +41,12 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
| 30 |
|
| 31 |
def run_analysis(user_text):
|
| 32 |
results = analyze_text(user_text)
|
| 33 |
-
return results, results # send
|
| 34 |
|
| 35 |
analyze_btn.click(
|
| 36 |
fn=run_analysis,
|
| 37 |
inputs=user_input,
|
| 38 |
-
outputs=[final_output, model_output]
|
| 39 |
)
|
| 40 |
|
| 41 |
-
demo.launch()
|
|
|
|
| 7 |
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
| 8 |
gr.Markdown(
|
| 9 |
"""
|
| 10 |
+
# 🤖 AI vs Human Text Detector
|
| 11 |
+
|
| 12 |
+
Paste any text below. Our system will analyze it using **three advanced models** to detect if the text is AI-generated or human-written.
|
| 13 |
+
|
| 14 |
+
### 📝 Formatting Preservation
|
| 15 |
+
|
| 16 |
+
- Your **line breaks, spacing, and Markdown syntax** will be preserved exactly as you paste them.
|
| 17 |
+
- The input and output text are displayed without any modification.
|
| 18 |
+
- Perfect for analyzing **code snippets, poetry, or Markdown documents** without losing formatting.
|
| 19 |
+
|
| 20 |
+
Click **"🚀 Run Detection"** to start.
|
| 21 |
"""
|
| 22 |
)
|
| 23 |
|
| 24 |
with gr.Row():
|
| 25 |
+
with gr.Column(scale=1):
|
| 26 |
+
formatted_input_display = gr.Code(label="📝 Your Input (Preserved Formatting)", interactive=False)
|
| 27 |
+
|
| 28 |
with gr.Column(scale=2):
|
| 29 |
user_input = gr.Textbox(
|
| 30 |
label="✍️ Enter Text",
|
|
|
|
| 41 |
|
| 42 |
def run_analysis(user_text):
|
| 43 |
results = analyze_text(user_text)
|
| 44 |
+
return results, results, user_text # send input text as-is to output
|
| 45 |
|
| 46 |
analyze_btn.click(
|
| 47 |
fn=run_analysis,
|
| 48 |
inputs=user_input,
|
| 49 |
+
outputs=[final_output, model_output, formatted_input_display]
|
| 50 |
)
|
| 51 |
|
| 52 |
+
demo.launch()
|