Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -211,27 +211,31 @@ def generate_text(df, country, theme):
|
|
211 |
Summarize the adverse growth for {theme} in {country}. Highlight any increase or decrease compared to previous years and include the cumulative result.
|
212 |
"""
|
213 |
prompt = f"""
|
214 |
-
Here is an example of how to summarize adverse growth data for a
|
215 |
|
216 |
Country: France
|
217 |
Adverse 2020: -0.427975
|
218 |
Adverse 2021: -1.987167
|
219 |
Adverse 2022: -1.195906
|
220 |
Adverse Cumulative: -3.573762
|
221 |
-
|
222 |
Summary:
|
223 |
-
In the adverse scenario, the growth for
|
224 |
|
225 |
-
Now, summarize the data for {theme}
|
226 |
{row_str}
|
227 |
|
228 |
-
|
|
|
|
|
|
|
|
|
229 |
"""
|
230 |
|
231 |
|
232 |
|
233 |
|
234 |
|
|
|
235 |
# Generate the descriptive text using the model
|
236 |
result = table_to_text(prompt, max_length=200, temperature=0.7, top_p=0.9)[0]['generated_text']
|
237 |
|
|
|
211 |
Summarize the adverse growth for {theme} in {country}. Highlight any increase or decrease compared to previous years and include the cumulative result.
|
212 |
"""
|
213 |
prompt = f"""
|
214 |
+
Here is an example of how to summarize adverse growth data for a country with GDP as the topic:
|
215 |
|
216 |
Country: France
|
217 |
Adverse 2020: -0.427975
|
218 |
Adverse 2021: -1.987167
|
219 |
Adverse 2022: -1.195906
|
220 |
Adverse Cumulative: -3.573762
|
|
|
221 |
Summary:
|
222 |
+
In the adverse scenario, the GDP growth for France decreased by 0.427975% in 2020, worsened further by 1.987167% in 2021, and slightly improved by -1.195906% in 2022. The cumulative adverse growth is -3.573762%.
|
223 |
|
224 |
+
Now, summarize the data for {theme} in {country}:
|
225 |
{row_str}
|
226 |
|
227 |
+
Ensure the following:
|
228 |
+
1. Highlight changes from previous years.
|
229 |
+
2. Include a cumulative result if applicable.
|
230 |
+
3. Use 'increase' if the value is positive and 'decrease' if the value is negative.
|
231 |
+
4. The summary should reflect the data accurately.
|
232 |
"""
|
233 |
|
234 |
|
235 |
|
236 |
|
237 |
|
238 |
+
|
239 |
# Generate the descriptive text using the model
|
240 |
result = table_to_text(prompt, max_length=200, temperature=0.7, top_p=0.9)[0]['generated_text']
|
241 |
|