Cachoups commited on
Commit
b2ec946
·
verified ·
1 Parent(s): 4659357

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -234,7 +234,7 @@ def process_and_compare(file1, sheet1, file2, sheet2):
234
  plt.savefig(file_path, format='png', bbox_inches='tight')
235
  plt.close()
236
 
237
- return merged_df, f'Histogram of Difference between Adverse cumulative growth of {year2} and {year1} for {sheet1}', 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
@@ -593,7 +593,7 @@ with gr.Blocks(theme='gradio/soft',js=js_func) as demo:
593
  inputs=[country_2_dropdown, sheet],
594
  outputs=text_result_df2)
595
  # Button to extract text from PDFs and perform sentiment analysis
596
- b1.click(fn=process_and_compare, inputs=[file1, sheet, file2, sheet], outputs=[result, result.title,country_1_dropdown, country_2_dropdown])
597
  b2.click(fn=process_pdfs_and_analyze_sentiment, inputs=[file1, file2, sheet], outputs=[sentiment_results_pdf1, sentiment_results_pdf2])
598
 
599
 
 
234
  plt.savefig(file_path, format='png', bbox_inches='tight')
235
  plt.close()
236
 
237
+ return merged_df, 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
 
593
  inputs=[country_2_dropdown, sheet],
594
  outputs=text_result_df2)
595
  # Button to extract text from PDFs and perform sentiment analysis
596
+ b1.click(fn=process_and_compare, inputs=[file1, sheet, file2, sheet], outputs=[result ,country_1_dropdown, country_2_dropdown])
597
  b2.click(fn=process_pdfs_and_analyze_sentiment, inputs=[file1, file2, sheet], outputs=[sentiment_results_pdf1, sentiment_results_pdf2])
598
 
599