Cachoups commited on
Commit
c6b10c9
·
verified ·
1 Parent(s): 999ea46

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -211,29 +211,29 @@ 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 a summary:
215
 
216
- For France (GDP):
 
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 GDP in France was -0.427975% in 2020, worsened to -1.987167% in 2021, and slightly improved to -1.195906% in 2022. The cumulative adverse growth is -3.573762%.
224
 
225
- Now summarize the following data for {theme} in {country}:
226
  {row_str}
227
 
228
- The theme is {theme}. Please:
229
- - Describe how the values changed each year.
230
- - Mention the cumulative result if available.
231
- - Use terms like 'increase' or 'decrease' based on the trends.
232
  """
233
 
234
 
235
 
236
 
 
237
  # Generate the descriptive text using the model
238
  result = table_to_text(prompt, max_length=200, temperature=0.7, top_p=0.9)[0]['generated_text']
239
 
 
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 given country with GDP as the theme:
215
 
216
+ Example for France (GDP):
217
+ Country: France
218
  Adverse 2020: -0.427975
219
  Adverse 2021: -1.987167
220
  Adverse 2022: -1.195906
221
  Adverse Cumulative: -3.573762
222
 
223
+ The theme is GDP.
224
  Summary:
225
+ 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. The cumulative adverse growth is -3.573762%.
226
 
227
+ Now, summarize the data for {theme} in {country}:
228
  {row_str}
229
 
230
+ Make sure to highlight changes compared to previous years, include the cumulative result if applicable and use 'increase' or 'decrease' to describe changes.
 
 
 
231
  """
232
 
233
 
234
 
235
 
236
+
237
  # Generate the descriptive text using the model
238
  result = table_to_text(prompt, max_length=200, temperature=0.7, top_p=0.9)[0]['generated_text']
239