Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -40,6 +40,10 @@ def classify_comments(categories):
|
|
40 |
|
41 |
# Function to generate visualizations
|
42 |
def visualize_output():
|
|
|
|
|
|
|
|
|
43 |
# Pie Chart of Sentiment
|
44 |
sentiment_counts = df['comment_sentiment'].value_counts()
|
45 |
sentiment_pie = px.pie(
|
|
|
40 |
|
41 |
# Function to generate visualizations
|
42 |
def visualize_output():
|
43 |
+
# Ensure the required columns exist
|
44 |
+
if 'comment_sentiment' not in df.columns or 'comment_category' not in df.columns:
|
45 |
+
return None, None, None, "Error: Please classify comments before visualizing."
|
46 |
+
|
47 |
# Pie Chart of Sentiment
|
48 |
sentiment_counts = df['comment_sentiment'].value_counts()
|
49 |
sentiment_pie = px.pie(
|