Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,13 +22,16 @@ def sentiment_analyzer(review):
|
|
| 22 |
return sentiment[0]['label']
|
| 23 |
|
| 24 |
def sentiment_pie_chart(df):
|
| 25 |
-
sentiment_counts = df['Sentiment'].value_counts()
|
| 26 |
|
| 27 |
# Create a pie chart
|
| 28 |
fig, ax = plt.subplots()
|
| 29 |
-
sentiment_counts.plot(kind='pie', autopct='%1.1f%%', colors=['green', 'red'])
|
| 30 |
-
|
|
|
|
|
|
|
| 31 |
|
|
|
|
| 32 |
return fig
|
| 33 |
|
| 34 |
|
|
|
|
| 22 |
return sentiment[0]['label']
|
| 23 |
|
| 24 |
def sentiment_pie_chart(df):
|
| 25 |
+
sentiment_counts = df['Sentiment'].value_counts()
|
| 26 |
|
| 27 |
# Create a pie chart
|
| 28 |
fig, ax = plt.subplots()
|
| 29 |
+
sentiment_counts.plot(kind='pie', autopct='%1.1f%%', colors=['green', 'red'], ax=ax)
|
| 30 |
+
|
| 31 |
+
# Remove the y-axis label
|
| 32 |
+
ax.set_ylabel('')
|
| 33 |
|
| 34 |
+
ax.set_title('Review Sentiment Chart')
|
| 35 |
return fig
|
| 36 |
|
| 37 |
|