Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -43,7 +43,8 @@ def classify_comments(categories):
|
|
| 43 |
def visualize_output():
|
| 44 |
# Ensure the required columns exist
|
| 45 |
if 'comment_sentiment' not in df.columns or 'comment_category' not in df.columns:
|
| 46 |
-
|
|
|
|
| 47 |
|
| 48 |
# Pie Chart of Sentiment
|
| 49 |
sentiment_counts = df['comment_sentiment'].value_counts()
|
|
|
|
| 43 |
def visualize_output():
|
| 44 |
# Ensure the required columns exist
|
| 45 |
if 'comment_sentiment' not in df.columns or 'comment_category' not in df.columns:
|
| 46 |
+
# Return 5 values (None for plots and an error message for markdown)
|
| 47 |
+
return None, None, None, "Error: Please classify comments before visualizing.", None
|
| 48 |
|
| 49 |
# Pie Chart of Sentiment
|
| 50 |
sentiment_counts = df['comment_sentiment'].value_counts()
|