Cachoups commited on
Commit
0a5d324
·
verified ·
1 Parent(s): 10f2423

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -233,8 +233,9 @@ def process_and_compare(file1, sheet1, file2, sheet2):
233
  file_path = 'output/plot.png'
234
  plt.savefig(file_path, format='png', bbox_inches='tight')
235
  plt.close()
236
-
237
- return file_path, gr.update(choices=stored_df1.Country.values.tolist()), gr.update(choices=stored_df2.Country.values.tolist())
 
238
 
239
  def find_sentences_with_keywords(text, keywords):
240
  # Split text into sentences using regular expression to match sentence-ending punctuation
 
233
  file_path = 'output/plot.png'
234
  plt.savefig(file_path, format='png', bbox_inches='tight')
235
  plt.close()
236
+ filtered_countries1 = [country for country in countries_list if len(stored_df1.Country.values.tolist()) < 20]
237
+ filtered_countries2 = [country for country in countries_list if len(stored_df2.Country.values.tolist()) < 20]
238
+ return file_path, gr.update(choices=filtered_countries1), gr.update(choices=filtered_countries2)
239
 
240
  def find_sentences_with_keywords(text, keywords):
241
  # Split text into sentences using regular expression to match sentence-ending punctuation