Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1328,9 +1328,6 @@ def sentiment_analysis_interface(reviews_text: str, file_upload, language: str):
|
|
| 1328 |
|
| 1329 |
# REPLACE THIS RETURN STATEMENT:
|
| 1330 |
formatted_result = f"""
|
| 1331 |
-
SENTIMENT ANALYSIS RESULTS
|
| 1332 |
-
{'-'*50}
|
| 1333 |
-
|
| 1334 |
SENTIMENT DISTRIBUTION:
|
| 1335 |
Positive: {result['summary'].get('positive', 0):>6.1f}%
|
| 1336 |
Negative: {result['summary'].get('negative', 0):>6.1f}%
|
|
@@ -1342,9 +1339,6 @@ Average Confidence: {result['average_confidence']:.3f}
|
|
| 1342 |
|
| 1343 |
KEY INSIGHTS:
|
| 1344 |
{chr(10).join([insight for insight in result['insights']])}
|
| 1345 |
-
|
| 1346 |
-
REVIEW DETAILS (Top 3):
|
| 1347 |
-
{chr(10).join([f'{i+1}. {detail["text"]} (Sentiment: {detail["sentiment"]}, Confidence: {detail["confidence"]:.2f})' for i, detail in enumerate(result['details'][:3])])}
|
| 1348 |
"""
|
| 1349 |
|
| 1350 |
return formatted_result, fig1, fig2
|
|
|
|
| 1328 |
|
| 1329 |
# REPLACE THIS RETURN STATEMENT:
|
| 1330 |
formatted_result = f"""
|
|
|
|
|
|
|
|
|
|
| 1331 |
SENTIMENT DISTRIBUTION:
|
| 1332 |
Positive: {result['summary'].get('positive', 0):>6.1f}%
|
| 1333 |
Negative: {result['summary'].get('negative', 0):>6.1f}%
|
|
|
|
| 1339 |
|
| 1340 |
KEY INSIGHTS:
|
| 1341 |
{chr(10).join([insight for insight in result['insights']])}
|
|
|
|
|
|
|
|
|
|
| 1342 |
"""
|
| 1343 |
|
| 1344 |
return formatted_result, fig1, fig2
|