Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -204,11 +204,10 @@ def generate_text(df, country, theme):
|
|
204 |
# Convert the row to a string format for prompt
|
205 |
row_str = row.to_string(index=True)
|
206 |
|
207 |
-
# Create the prompt
|
208 |
prompt = f"""
|
209 |
-
Here is an example of how to summarize adverse growth data for a given country:
|
210 |
|
211 |
-
Example for France:
|
212 |
Country: France
|
213 |
Adverse 2020: -0.427975
|
214 |
Adverse 2021: -1.987167
|
@@ -219,10 +218,10 @@ def generate_text(df, country, theme):
|
|
219 |
Summary:
|
220 |
In the adverse scenario, the growth for GDP in France decreased by -0.427975% in 2020, worsened further by -1.987167% in 2021, and slightly improved by -1.195906% in 2022, resulting in an adverse cumulative decrease of -3.573762%.
|
221 |
|
222 |
-
Now,
|
223 |
{row_str}
|
224 |
|
225 |
-
|
226 |
"""
|
227 |
|
228 |
|
|
|
204 |
# Convert the row to a string format for prompt
|
205 |
row_str = row.to_string(index=True)
|
206 |
|
|
|
207 |
prompt = f"""
|
208 |
+
Here is an example of how to summarize adverse growth data for a given country with GDP as the theme:
|
209 |
|
210 |
+
Example for France (GDP):
|
211 |
Country: France
|
212 |
Adverse 2020: -0.427975
|
213 |
Adverse 2021: -1.987167
|
|
|
218 |
Summary:
|
219 |
In the adverse scenario, the growth for GDP in France decreased by -0.427975% in 2020, worsened further by -1.987167% in 2021, and slightly improved by -1.195906% in 2022, resulting in an adverse cumulative decrease of -3.573762%.
|
220 |
|
221 |
+
Now, use the following data for {theme} in {country} to generate a similar summary:
|
222 |
{row_str}
|
223 |
|
224 |
+
The theme is {theme}. Ensure that the summary reflects the theme accurately and follows the pattern from the example. Highlight any improvements or worsening compared to previous years and include a cumulative result if applicable. Use terms 'increase' and 'decrease' to describe changes in values, and make sure the output aligns with the provided data.
|
225 |
"""
|
226 |
|
227 |
|