Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -470,17 +470,18 @@ with gr.Blocks(theme='gradio/soft',js=js_func) as demo:
|
|
470 |
# Classify the financial tone of the selected paragraph from PDF 1
|
471 |
sentiment_btn1.click(fn=lambda p: process_paragraph_1_sent(p), inputs=paragraph_1_dropdown, outputs=sentiment_textbox_1)
|
472 |
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
|
|
484 |
|
485 |
# Process the selected paragraph from PDF 2
|
486 |
with gr.Column():
|
@@ -503,18 +504,18 @@ with gr.Blocks(theme='gradio/soft',js=js_func) as demo:
|
|
503 |
|
504 |
# Classify the financial tone of the selected paragraph from PDF 2
|
505 |
sentiment_btn2.click(fn=lambda p: process_paragraph_2_sent(p), inputs=paragraph_2_dropdown, outputs=sentiment_textbox_2)
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
|
519 |
|
520 |
with gr.Tab("Financial Report Table Analysis"):
|
|
|
470 |
# Classify the financial tone of the selected paragraph from PDF 1
|
471 |
sentiment_btn1.click(fn=lambda p: process_paragraph_1_sent(p), inputs=paragraph_1_dropdown, outputs=sentiment_textbox_1)
|
472 |
|
473 |
+
with gr.Accordion("Analyze Financial Tone on each sentence"):
|
474 |
+
analyze_btn1 = gr.Button("With FinBERT-tone")
|
475 |
+
fin_spans_1 = gr.HighlightedText(label="Financial Tone Analysis for PDF 1")
|
476 |
+
|
477 |
+
# Analyze financial tone on each sentence using FinBERT-tone
|
478 |
+
analyze_btn1.click(fn=lambda p: process_paragraph_1_sent_tone(p), inputs=paragraph_1_dropdown, outputs=fin_spans_1)
|
479 |
+
|
480 |
+
analyze_btn1_ = gr.Button("With ProsusAI/finbert")
|
481 |
+
fin_spans_1_ = gr.HighlightedText(label="Financial Tone Analysis for PDF 1 (Bis)")
|
482 |
+
|
483 |
+
# Analyze financial tone using ProsusAI/finbert
|
484 |
+
analyze_btn1_.click(fn=lambda p: process_paragraph_1_sent_tone_bis(p), inputs=paragraph_1_dropdown, outputs=fin_spans_1_)
|
485 |
|
486 |
# Process the selected paragraph from PDF 2
|
487 |
with gr.Column():
|
|
|
504 |
|
505 |
# Classify the financial tone of the selected paragraph from PDF 2
|
506 |
sentiment_btn2.click(fn=lambda p: process_paragraph_2_sent(p), inputs=paragraph_2_dropdown, outputs=sentiment_textbox_2)
|
507 |
+
with gr.Accordion("Analyze Financial Tone on each sentence"):
|
508 |
+
analyze_btn2 = gr.Button("With FinBERT-tone")
|
509 |
+
fin_spans_2 = gr.HighlightedText(label="Financial Tone Analysis for PDF 2")
|
510 |
+
|
511 |
+
# Analyze financial tone on each sentence using FinBERT-tone for PDF 2
|
512 |
+
analyze_btn2.click(fn=lambda p: process_paragraph_2_sent_tone(p), inputs=paragraph_2_dropdown, outputs=fin_spans_2)
|
513 |
+
|
514 |
+
analyze_btn2_ = gr.Button("With ProsusAI/finbert")
|
515 |
+
fin_spans_2_ = gr.HighlightedText(label="Financial Tone Analysis for PDF 2 (Bis)")
|
516 |
+
|
517 |
+
# Analyze financial tone using ProsusAI/finbert for PDF 2
|
518 |
+
analyze_btn2_.click(fn=lambda p: process_paragraph_2_sent_tone_bis(p), inputs=paragraph_2_dropdown, outputs=fin_spans_2_)
|
519 |
|
520 |
|
521 |
with gr.Tab("Financial Report Table Analysis"):
|