Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -214,17 +214,22 @@ def generate_text(df, country, theme):
|
|
| 214 |
Adverse 2022: -1.195906
|
| 215 |
Adverse Cumulative: -3.573762
|
| 216 |
|
| 217 |
-
The
|
| 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
|
| 220 |
|
| 221 |
Now, use the following data for {theme} in {country} to generate a similar summary:
|
| 222 |
{row_str}
|
| 223 |
|
| 224 |
-
The
|
|
|
|
|
|
|
|
|
|
|
|
|
| 225 |
"""
|
| 226 |
|
| 227 |
|
|
|
|
| 228 |
# Generate the descriptive text using the model
|
| 229 |
result = table_to_text(prompt, max_length=200)[0]['generated_text']
|
| 230 |
|
|
|
|
| 214 |
Adverse 2022: -1.195906
|
| 215 |
Adverse Cumulative: -3.573762
|
| 216 |
|
| 217 |
+
The topic is GDP.
|
| 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. The cumulative adverse growth is -3.573762%.
|
| 220 |
|
| 221 |
Now, use the following data for {theme} in {country} to generate a similar summary:
|
| 222 |
{row_str}
|
| 223 |
|
| 224 |
+
The topic is {theme}. Ensure that the summary:
|
| 225 |
+
- Reflects the theme accurately
|
| 226 |
+
- Highlights any improvements or worsening compared to previous years
|
| 227 |
+
- Includes a cumulative result if applicable
|
| 228 |
+
- Uses terms 'increase' and 'decrease' to describe changes
|
| 229 |
"""
|
| 230 |
|
| 231 |
|
| 232 |
+
|
| 233 |
# Generate the descriptive text using the model
|
| 234 |
result = table_to_text(prompt, max_length=200)[0]['generated_text']
|
| 235 |
|