Spaces:
Running
Running
Update app.py
Browse files
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 |
-
|
355 |
-
|
|
|
|
|
|
|
|
|
356 |
|
|
|
357 |
Country: Australia
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
Topic: GDP
|
363 |
|
364 |
Description:
|
365 |
-
In
|
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 |
-
|
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
|