Spaces:
Running on Zero
Running on Zero
Use real human/AI dataset rows as examples
Browse files
app.py
CHANGED
|
@@ -73,23 +73,26 @@ def analyze(text):
|
|
| 73 |
return summary, label_probs
|
| 74 |
|
| 75 |
|
|
|
|
|
|
|
| 76 |
HUMAN_EXAMPLE = (
|
| 77 |
-
"
|
| 78 |
-
"
|
| 79 |
-
"
|
| 80 |
-
"
|
| 81 |
-
"
|
| 82 |
-
"
|
|
|
|
| 83 |
)
|
| 84 |
|
| 85 |
AI_EXAMPLE = (
|
| 86 |
-
"
|
| 87 |
-
"
|
| 88 |
-
"
|
| 89 |
-
"
|
| 90 |
-
"
|
| 91 |
-
"
|
| 92 |
-
"
|
| 93 |
)
|
| 94 |
|
| 95 |
with gr.Blocks(title="EditLens") as demo:
|
|
@@ -118,7 +121,7 @@ with gr.Blocks(title="EditLens") as demo:
|
|
| 118 |
gr.Examples(
|
| 119 |
examples=[[HUMAN_EXAMPLE], [AI_EXAMPLE]],
|
| 120 |
inputs=text_in,
|
| 121 |
-
label="Examples (human-
|
| 122 |
)
|
| 123 |
with gr.Column():
|
| 124 |
summary_out = gr.Markdown()
|
|
|
|
| 73 |
return summary, label_probs
|
| 74 |
|
| 75 |
|
| 76 |
+
# Both examples are real rows from the EditLens test set (pangram/editlens_iclr),
|
| 77 |
+
# not text written for this demo — a human_written review and an ai_generated review.
|
| 78 |
HUMAN_EXAMPLE = (
|
| 79 |
+
"We enjoyed our first visit to enroute coffee. Place was very easy to find and "
|
| 80 |
+
"had a very warm and cozy feel for the place. Walking in you quickly view the "
|
| 81 |
+
"delicious looking pastries they have lined up along the counter. Trying those "
|
| 82 |
+
"next visit. They had a large section of coffee choices and looks like they sell "
|
| 83 |
+
"additional merchandise. Giving them a 5 for outstanding 1st impression.\n\n"
|
| 84 |
+
"Note for owner: possible define the cash register station or separate it a bit "
|
| 85 |
+
"more from coffee pickup station. Seemed a bit crowded in that area."
|
| 86 |
)
|
| 87 |
|
| 88 |
AI_EXAMPLE = (
|
| 89 |
+
"McDonald’s offers a consistent fast-food experience with widely recognized "
|
| 90 |
+
"favorites like the Big Mac, fries, and McNuggets. The service is generally "
|
| 91 |
+
"quick, and the menu provides options for breakfast, lunch, and dinner, as well "
|
| 92 |
+
"as some healthier choices. While the food isn’t gourmet, it’s reliably "
|
| 93 |
+
"tasty and convenient, making it a popular choice for people on the go. Prices "
|
| 94 |
+
"are reasonable, but quality can vary slightly between locations. Overall, "
|
| 95 |
+
"McDonald’s delivers on expectations for fast, accessible, and familiar meals."
|
| 96 |
)
|
| 97 |
|
| 98 |
with gr.Blocks(title="EditLens") as demo:
|
|
|
|
| 121 |
gr.Examples(
|
| 122 |
examples=[[HUMAN_EXAMPLE], [AI_EXAMPLE]],
|
| 123 |
inputs=text_in,
|
| 124 |
+
label="Examples (real human-written / AI-generated reviews from the EditLens test set)",
|
| 125 |
)
|
| 126 |
with gr.Column():
|
| 127 |
summary_out = gr.Markdown()
|