Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -314,12 +314,13 @@ with gr.Blocks() as demo:
|
|
314 |
|
315 |
|
316 |
b1 = gr.Button("Compare Data")
|
317 |
-
|
|
|
318 |
with gr.Row():
|
319 |
with gr.Column():
|
320 |
sentiment_results_pdf1 = gr.HighlightedText(label="Sentiment Analysis - PDF 1")
|
321 |
country_1_dropdown = gr.Dropdown(label="Select Country from Excel File 1")
|
322 |
-
country_1_dropdown.change(fn =change_choices, inputs= stored_df1, outputs=
|
323 |
summarize_btn1_country = gr.Button("Summary for the selected country")
|
324 |
text_result_df1 = gr.Textbox(label="Sentence for excel file 1", lines=2)
|
325 |
summarize_btn1_country.click(fn=lambda country, theme: generate_text(stored_df1, country, theme),
|
@@ -329,7 +330,7 @@ with gr.Blocks() as demo:
|
|
329 |
sentiment_results_pdf2 = gr.HighlightedText(label="Sentiment Analysis - PDF 2")
|
330 |
|
331 |
# Button to extract text from PDFs and perform sentiment analysis
|
332 |
-
|
333 |
b2.click(fn=process_pdfs_and_analyze_sentiment, inputs=[file1, file2, sheet], outputs=[sentiment_results_pdf1, sentiment_results_pdf2])
|
334 |
|
335 |
|
|
|
314 |
|
315 |
|
316 |
b1 = gr.Button("Compare Data")
|
317 |
+
b2 = gr.Button("Extract text information")
|
318 |
+
|
319 |
with gr.Row():
|
320 |
with gr.Column():
|
321 |
sentiment_results_pdf1 = gr.HighlightedText(label="Sentiment Analysis - PDF 1")
|
322 |
country_1_dropdown = gr.Dropdown(label="Select Country from Excel File 1")
|
323 |
+
country_1_dropdown.change(fn =change_choices, inputs= stored_df1, outputs= country_1_dropdown)
|
324 |
summarize_btn1_country = gr.Button("Summary for the selected country")
|
325 |
text_result_df1 = gr.Textbox(label="Sentence for excel file 1", lines=2)
|
326 |
summarize_btn1_country.click(fn=lambda country, theme: generate_text(stored_df1, country, theme),
|
|
|
330 |
sentiment_results_pdf2 = gr.HighlightedText(label="Sentiment Analysis - PDF 2")
|
331 |
|
332 |
# Button to extract text from PDFs and perform sentiment analysis
|
333 |
+
b1.click(fn=process_and_compare, inputs=[file1, sheet, file2, sheet], outputs=result)
|
334 |
b2.click(fn=process_pdfs_and_analyze_sentiment, inputs=[file1, file2, sheet], outputs=[sentiment_results_pdf1, sentiment_results_pdf2])
|
335 |
|
336 |
|