kambris commited on
Commit
84cf1b5
·
verified ·
1 Parent(s): f3304e8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -505,6 +505,8 @@ if uploaded_file is not None:
505
 
506
  df['country'] = df['country'].str.strip()
507
  df = df.dropna(subset=['country', 'poem'])
 
 
508
 
509
  st.subheader("Topic Modeling Settings")
510
  col1, col2 = st.columns(2)
@@ -550,7 +552,7 @@ if uploaded_file is not None:
550
 
551
 
552
  summaries, topic_model = process_and_summarize(
553
- df,
554
  bert_tokenizer,
555
  bert_model,
556
  emotion_classifier,
 
505
 
506
  df['country'] = df['country'].str.strip()
507
  df = df.dropna(subset=['country', 'poem'])
508
+ # Extract 10 rows per country
509
+ sampled_df = df.groupby('country').apply(lambda x: x.head(10)).reset_index(drop=True)
510
 
511
  st.subheader("Topic Modeling Settings")
512
  col1, col2 = st.columns(2)
 
552
 
553
 
554
  summaries, topic_model = process_and_summarize(
555
+ sampled_df,
556
  bert_tokenizer,
557
  bert_model,
558
  emotion_classifier,