Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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,
|
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
|
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 |
|