Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -314,54 +314,54 @@ def rewrite_level(text, target_level, original_fre):
|
|
| 314 |
original_fre_val = float("nan")
|
| 315 |
|
| 316 |
prompt = f"""
|
| 317 |
-
The Flesch Reading Ease score is a numeric measure of text readability,
|
| 318 |
-
where higher scores indicate easier readability and lower scores indicate more difficult text.
|
| 319 |
-
|
| 320 |
-
In this task, we are trying to rewrite a given text into the target Flesch Reading Ease score
|
| 321 |
-
and preserving the original meaning and information.
|
| 322 |
-
|
| 323 |
-
Given the original draft (Flesch Reading Ease = {original_fre_val}):
|
| 324 |
-
|
| 325 |
-
[TEXT START]
|
| 326 |
-
{text}
|
| 327 |
-
[TEXT END]
|
| 328 |
-
|
| 329 |
-
Rewrite the above text to the difficulty level of:
|
| 330 |
-
Flesch Reading Ease = {target_flesch}
|
| 331 |
-
|
| 332 |
-
Follow the instructions below carefully.
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
-
|
| 336 |
-
-
|
| 337 |
-
-
|
| 338 |
-
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
-
|
| 350 |
-
-
|
| 351 |
-
|
| 352 |
-
|
| 353 |
-
|
| 354 |
-
-
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
|
| 358 |
-
|
| 359 |
-
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
- Output only the rewritten text.
|
| 363 |
-
- Do not include explanations, comments, or metadata.
|
| 364 |
-
- Do not include [TEXT START] and [TEXT END] in the output.
|
| 365 |
""".strip()
|
| 366 |
|
| 367 |
with _rewrite_sem:
|
|
|
|
| 314 |
original_fre_val = float("nan")
|
| 315 |
|
| 316 |
prompt = f"""
|
| 317 |
+
The Flesch Reading Ease score is a numeric measure of text readability,
|
| 318 |
+
where higher scores indicate easier readability and lower scores indicate more difficult text.
|
| 319 |
+
|
| 320 |
+
In this task, we are trying to rewrite a given text into the target Flesch Reading Ease score
|
| 321 |
+
and preserving the original meaning and information.
|
| 322 |
+
|
| 323 |
+
Given the original draft (Flesch Reading Ease = {original_fre_val}):
|
| 324 |
+
|
| 325 |
+
[TEXT START]
|
| 326 |
+
{text}
|
| 327 |
+
[TEXT END]
|
| 328 |
+
|
| 329 |
+
Rewrite the above text to the difficulty level of:
|
| 330 |
+
Flesch Reading Ease = {target_flesch}
|
| 331 |
+
|
| 332 |
+
Follow the instructions below carefully.
|
| 333 |
+
|
| 334 |
+
Numerous Readability Manipulation
|
| 335 |
+
- Make sentences shorter.
|
| 336 |
+
- Prefer familiar, high-frequency vocabulary.
|
| 337 |
+
- Use simple and direct sentence structures.
|
| 338 |
+
- Avoid jargon; if technical terms are necessary, explain them clearly in simple language.
|
| 339 |
+
- Minimize figurative language, idioms, and expressions whose meanings are not directly inferable.
|
| 340 |
+
|
| 341 |
+
Qualitative Readability Control
|
| 342 |
+
・Content preservation
|
| 343 |
+
- Maintain the original meaning faithfully.
|
| 344 |
+
- Do not add new information.
|
| 345 |
+
- Do not remove important information.
|
| 346 |
+
- Do not introduce interpretations or opinions that are not present in the original text.
|
| 347 |
+
|
| 348 |
+
・Language modernization
|
| 349 |
+
- Rewrite the text in clear, modern English.
|
| 350 |
+
- Remove archaic expressions and unnatural or outdated syntax typical of older texts at all levels.
|
| 351 |
+
|
| 352 |
+
Formatting Constraints
|
| 353 |
+
・Scope of rewriting
|
| 354 |
+
- Rewrite ONLY the main body text.
|
| 355 |
+
- Completely EXCLUDE titles, headings, chapter labels, author names, source information, footnotes, annotations, and introductions.
|
| 356 |
+
- Do NOT include any text other than the rewritten main body under any circumstances.
|
| 357 |
+
|
| 358 |
+
・Structure and formatting
|
| 359 |
+
- Preserve the original paragraph structure of the main text.
|
| 360 |
+
- Insert exactly ONE blank line between paragraphs.
|
| 361 |
+
- Do NOT create new section breaks, chapter divisions, or headings.
|
| 362 |
+
- Output only the rewritten text.
|
| 363 |
+
- Do not include explanations, comments, or metadata.
|
| 364 |
+
- Do not include [TEXT START] and [TEXT END] in the output.
|
| 365 |
""".strip()
|
| 366 |
|
| 367 |
with _rewrite_sem:
|