Cachoups commited on
Commit
385d234
·
verified ·
1 Parent(s): 010f13f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -17
app.py CHANGED
@@ -351,29 +351,25 @@ def generate_text(df, country, theme):
351
 
352
  Describe the adverse growth in the provided data year by year following the pattern in the example, highlighting whether the values increased or decreased each year.
353
  """
354
- prompt1 = f"""
355
- Here is an example of how to describe adverse growth data for a given country:
 
 
 
 
356
 
 
357
  Country: Australia
358
- Adverse 2020: -0.43%
359
- Adverse 2021: -1.99%
360
- Adverse 2022: -1.20%
361
- Adverse Cumulative: -3.57%
362
  Topic: GDP
363
 
364
  Description:
365
- In the adverse scenario, the GDP growth in Australia was -0.43% in 2020. It decreased further to -1.99% in 2021, showing worsening conditions. However, there was a slight improvement to -1.20% in 2022. The total cumulative adverse growth is -3.57%.
366
-
367
- Now, using the following data for {theme} in {country}, perform the following:
368
- 1. Highlight how the values change from year to year.
369
- 2. Describe whether the values increased or decreased compared to the previous year.
370
- 3. Indicate if the changes represent a worsening or improvement, and if this is strong or slight.
371
- 4. Include the cumulative result.
372
 
373
- Data:
374
- {row_str}
375
- Topic: {theme}
376
- Make sure your description follows the example format and accurately reflects the data.
377
  """
378
 
379
  # Generate the descriptive text using the model
 
351
 
352
  Describe the adverse growth in the provided data year by year following the pattern in the example, highlighting whether the values increased or decreased each year.
353
  """
354
+ prompt = f"""
355
+ Given the following adverse growth data for {theme} in {country}:
356
+
357
+ {row_str}
358
+
359
+ Describe the yearly changes in adverse growth, highlighting whether the values increased or decreased, and provide the cumulative growth. Follow this example:
360
 
361
+ Example:
362
  Country: Australia
363
+ 1990: -0.43%
364
+ 1991: -1.99%
365
+ 1992: -1.20%
366
+ Cumulative: -3.57%
367
  Topic: GDP
368
 
369
  Description:
370
+ In Australia, GDP growth was -0.43% in 1990. It worsened to -1.99% in 1991 and improved to -1.20% in 1992. The total cumulative adverse growth was -3.57%.
 
 
 
 
 
 
371
 
372
+ Now, describe the data for {country}.
 
 
 
373
  """
374
 
375
  # Generate the descriptive text using the model