Toya0421 commited on
Commit
c878901
·
verified ·
1 Parent(s): f6962e3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +48 -48
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
- Content preservation:
335
- - Maintain the original meaning faithfully.
336
- - Do not add new information.
337
- - Do not remove important information.
338
- - Do not introduce interpretations or opinions that are not present in the original text.
339
-
340
- Scope of rewriting:
341
- - Rewrite ONLY the main body text.
342
- - Completely EXCLUDE titles, headings, chapter labels, author names, source information, footnotes, annotations, and introductions.
343
- - Do NOT include any text other than the rewritten main body under any circumstances.
344
-
345
- Readability control guidelines:
346
- - Make sentences shorter.
347
- - Prefer familiar, high-frequency vocabulary.
348
- - Use simple and direct sentence structures.
349
- - Avoid jargon; if technical terms are necessary, explain them clearly in simple language.
350
- - Minimize figurative language, idioms, and expressions whose meanings are not directly inferable.
351
-
352
- Language modernization:
353
- - Rewrite the text in clear, modern English.
354
- - Remove archaic expressions and unnatural or outdated syntax typical of older texts at all levels.
355
-
356
- Structure and formatting:
357
- - Preserve the original paragraph structure of the main text.
358
- - Insert exactly ONE blank line between paragraphs.
359
- - Do NOT create new section breaks, chapter divisions, or headings.
360
-
361
- Output constraints:
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: