Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -113,53 +113,54 @@ def build_prompt(text: str, target_level: int, original_fre: Optional[float] = N
|
|
| 113 |
original_fre_val = float("nan")
|
| 114 |
|
| 115 |
return f"""
|
| 116 |
-
The Flesch Reading Ease score is a numeric measure of text readability,
|
| 117 |
-
where higher scores indicate easier readability and lower scores indicate more difficult text.
|
| 118 |
-
|
| 119 |
-
In this task, we are trying to rewrite a given text into the target Flesch Reading Ease score
|
| 120 |
-
and preserving the original meaning and information.
|
| 121 |
-
|
| 122 |
-
Given the original draft (Flesch Reading Ease = {
|
| 123 |
-
|
| 124 |
-
[TEXT START]
|
| 125 |
-
{text}
|
| 126 |
-
[TEXT END]
|
| 127 |
-
|
| 128 |
-
Rewrite the above text to the difficulty level of:
|
| 129 |
-
Flesch Reading Ease = {target_flesch}
|
| 130 |
-
|
| 131 |
-
Follow the instructions below carefully.
|
| 132 |
-
|
| 133 |
-
Content preservation:
|
| 134 |
-
- Maintain the original meaning faithfully.
|
| 135 |
-
- Do not add new information.
|
| 136 |
-
- Do not remove important information.
|
| 137 |
-
- Do not introduce interpretations or opinions that are not present in the original text.
|
| 138 |
-
|
| 139 |
-
Scope of rewriting:
|
| 140 |
-
-
|
| 141 |
-
-
|
| 142 |
-
-
|
| 143 |
-
|
| 144 |
-
Readability control guidelines:
|
| 145 |
-
- Make sentences shorter.
|
| 146 |
-
- Prefer familiar, high-frequency vocabulary.
|
| 147 |
-
- Use simple and direct sentence structures.
|
| 148 |
-
- Avoid jargon; if technical terms are necessary, explain them clearly in simple language.
|
| 149 |
-
- Minimize figurative language, idioms, and expressions whose meanings are not directly inferable.
|
| 150 |
-
|
| 151 |
-
Language modernization:
|
| 152 |
-
- Rewrite the text in clear, modern English.
|
| 153 |
-
- Remove archaic expressions and unnatural or outdated syntax typical of older texts at all levels..
|
| 154 |
-
|
| 155 |
-
Structure and formatting:
|
| 156 |
-
-
|
| 157 |
-
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
-
|
| 162 |
-
- Do not include
|
|
|
|
| 163 |
""".strip()
|
| 164 |
|
| 165 |
|
|
|
|
| 113 |
original_fre_val = float("nan")
|
| 114 |
|
| 115 |
return f"""
|
| 116 |
+
The Flesch Reading Ease score is a numeric measure of text readability,
|
| 117 |
+
where higher scores indicate easier readability and lower scores indicate more difficult text.
|
| 118 |
+
|
| 119 |
+
In this task, we are trying to rewrite a given text into the target Flesch Reading Ease score
|
| 120 |
+
and preserving the original meaning and information.
|
| 121 |
+
|
| 122 |
+
Given the original draft (Flesch Reading Ease = {original_fre}):
|
| 123 |
+
|
| 124 |
+
[TEXT START]
|
| 125 |
+
{text}
|
| 126 |
+
[TEXT END]
|
| 127 |
+
|
| 128 |
+
Rewrite the above text to the difficulty level of:
|
| 129 |
+
Flesch Reading Ease = {target_flesch}
|
| 130 |
+
|
| 131 |
+
Follow the instructions below carefully.
|
| 132 |
+
|
| 133 |
+
Content preservation:
|
| 134 |
+
- Maintain the original meaning faithfully.
|
| 135 |
+
- Do not add new information.
|
| 136 |
+
- Do not remove important information.
|
| 137 |
+
- Do not introduce interpretations or opinions that are not present in the original text.
|
| 138 |
+
|
| 139 |
+
Scope of rewriting:
|
| 140 |
+
- Rewrite ONLY the main body text.
|
| 141 |
+
- Completely EXCLUDE titles, headings, chapter labels, author names, source information, footnotes, annotations, and introductions.
|
| 142 |
+
- Do NOT include any text other than the rewritten main body under any circumstances.
|
| 143 |
+
|
| 144 |
+
Readability control guidelines:
|
| 145 |
+
- Make sentences shorter.
|
| 146 |
+
- Prefer familiar, high-frequency vocabulary.
|
| 147 |
+
- Use simple and direct sentence structures.
|
| 148 |
+
- Avoid jargon; if technical terms are necessary, explain them clearly in simple language.
|
| 149 |
+
- Minimize figurative language, idioms, and expressions whose meanings are not directly inferable.
|
| 150 |
+
|
| 151 |
+
Language modernization:
|
| 152 |
+
- Rewrite the text in clear, modern English.
|
| 153 |
+
- Remove archaic expressions and unnatural or outdated syntax typical of older texts at all levels..
|
| 154 |
+
|
| 155 |
+
Structure and formatting:
|
| 156 |
+
- Preserve the original paragraph structure of the main text.
|
| 157 |
+
- Insert exactly ONE blank line between paragraphs.
|
| 158 |
+
- Do NOT create new section breaks, chapter divisions, or headings.
|
| 159 |
+
|
| 160 |
+
Output constraints:
|
| 161 |
+
- Output only the rewritten text.
|
| 162 |
+
- Do not include explanations, comments, or metadata.
|
| 163 |
+
- Do not include [TEXT START] and [TEXT END] in the output.
|
| 164 |
""".strip()
|
| 165 |
|
| 166 |
|