Cachoups commited on
Commit
8589fad
·
verified ·
1 Parent(s): 43eecac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -10
app.py CHANGED
@@ -206,21 +206,23 @@ def generate_text(df, country, theme):
206
 
207
  # Create the prompt
208
  prompt = f"""
209
- Here is an example of how to summarize data for France:
210
- Country France
211
- Adverse 2020 -0.427975
212
- Adverse 2021 -1.987167
213
- Adverse 2022 -1.195906
214
- Adverse Cumulative -3.573762
 
 
215
 
216
  The theme is GDP.
217
- Output:
218
- In adverse scenario, the growth for GDP in France is -0.427975% in 2020, -1.987167% in 2021, and -1.195906% in 2022 which is an adverse cumulative of -3.573762%.
219
 
220
- Now summarize the adverse scenario growth for {theme} in {country} based on the data below:
221
  {row_str}
222
 
223
- Ensure that you follow a similar pattern to the example for France. Use the terms 'increase' and 'decrease' based on the changes in the values.
224
  """
225
 
226
  # Generate the descriptive text using the model
 
206
 
207
  # Create the prompt
208
  prompt = f"""
209
+ Here is an example of summarizing adverse growth data:
210
+
211
+ Example for France:
212
+ Country: France
213
+ Adverse 2020: 0.643631
214
+ Adverse 2021: -0.493879
215
+ Adverse 2022: -0.785046
216
+ Adverse Cumulative: -0.639624
217
 
218
  The theme is GDP.
219
+ Summary:
220
+ In the adverse scenario, the growth for GDP in France increased by 0.643631% in 2020 but decreased significantly by -0.493879% in 2021 and further decreased by -0.785046% in 2022, resulting in an adverse cumulative decrease of -0.639624%.
221
 
222
+ Now, summarize the adverse scenario growth for {theme} in {country} based on the following data:
223
  {row_str}
224
 
225
+ Please ensure to follow this format and use the terms 'increase' or 'decrease' based on whether the values go up or down from the previous year. Explicitly mention if the growth increased or decreased compared to the previous year and include a cumulative result if applicable.
226
  """
227
 
228
  # Generate the descriptive text using the model