ZennyKenny commited on
Commit
a6a991c
Β·
verified Β·
1 Parent(s): bd12fee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
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(