Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -110,14 +110,14 @@ with gr.Blocks() as demo:
|
|
| 110 |
selected_paragraph_1 = gr.Textbox(label="Selected Paragraph 1 Content", lines=4)
|
| 111 |
selected_paragraph_1.change(show, paragraph_1_dropdown, selected_paragraph_1)
|
| 112 |
summarize_btn1 = gr.Button("Summarize Text from PDF 1")
|
| 113 |
-
summarize_btn1.click(fn=lambda p: process_paragraph_1(p)[1], inputs=paragraph_1_dropdown, outputs=summary_textbox_1)
|
| 114 |
summary_textbox_1 = gr.Textbox(label="Summary for PDF 1", lines=2)
|
|
|
|
| 115 |
sentiment_btn1 = gr.Button("Classify Financial Tone from PDF 1")
|
| 116 |
-
sentiment_btn1.click(fn=lambda p: process_paragraph_1(p)[2], inputs=paragraph_1_dropdown, outputs=sentiment_textbox_1)
|
| 117 |
sentiment_textbox_1 = gr.Textbox(label="Classification for PDF 1", lines=1)
|
|
|
|
| 118 |
analyze_btn1 = gr.Button("Analyze Financial Tone on each sentence")
|
| 119 |
-
analyze_btn1.click(fn=lambda p: process_paragraph_1(p)[3], inputs=paragraph_1_dropdown, outputs=fin_spans_1)
|
| 120 |
fin_spans_1 = gr.HighlightedText(label="Financial Tone Analysis for PDF 1")
|
|
|
|
| 121 |
|
| 122 |
# Process the selected paragraph from PDF 2
|
| 123 |
with gr.Column():
|
|
@@ -135,13 +135,13 @@ with gr.Blocks() as demo:
|
|
| 135 |
selected_paragraph_2 = gr.Textbox(label="Selected Paragraph 2 Content", lines=4)
|
| 136 |
selected_paragraph_2.change(show, paragraph_2_dropdown, selected_paragraph_2)
|
| 137 |
summarize_btn2 = gr.Button("Summarize Text from PDF 2")
|
| 138 |
-
summarize_btn2.click(fn=lambda p: process_paragraph_2(p)[1], inputs=paragraph_2_dropdown, outputs=summary_textbox_2)
|
| 139 |
summary_textbox_2 = gr.Textbox(label="Summary for PDF 2", lines=2)
|
|
|
|
| 140 |
sentiment_btn2 = gr.Button("Classify Financial Tone from PDF 2")
|
| 141 |
-
sentiment_btn2.click(fn=lambda p: process_paragraph_2(p)[2], inputs=paragraph_2_dropdown, outputs=sentiment_textbox_2)
|
| 142 |
sentiment_textbox_2 = gr.Textbox(label="Classification for PDF 2", lines=1)
|
|
|
|
| 143 |
analyze_btn2 = gr.Button("Analyze Financial Tone on each sentence")
|
| 144 |
-
analyze_btn2.click(fn=lambda p: process_paragraph_2(p)[3], inputs=paragraph_2_dropdown, outputs=fin_spans_2)
|
| 145 |
fin_spans_2 = gr.HighlightedText(label="Financial Tone Analysis for PDF 2")
|
|
|
|
| 146 |
|
| 147 |
demo.launch()
|
|
|
|
| 110 |
selected_paragraph_1 = gr.Textbox(label="Selected Paragraph 1 Content", lines=4)
|
| 111 |
selected_paragraph_1.change(show, paragraph_1_dropdown, selected_paragraph_1)
|
| 112 |
summarize_btn1 = gr.Button("Summarize Text from PDF 1")
|
|
|
|
| 113 |
summary_textbox_1 = gr.Textbox(label="Summary for PDF 1", lines=2)
|
| 114 |
+
summarize_btn1.click(fn=lambda p: process_paragraph_1(p)[1], inputs=paragraph_1_dropdown, outputs=summary_textbox_1)
|
| 115 |
sentiment_btn1 = gr.Button("Classify Financial Tone from PDF 1")
|
|
|
|
| 116 |
sentiment_textbox_1 = gr.Textbox(label="Classification for PDF 1", lines=1)
|
| 117 |
+
sentiment_btn1.click(fn=lambda p: process_paragraph_1(p)[2], inputs=paragraph_1_dropdown, outputs=sentiment_textbox_1)
|
| 118 |
analyze_btn1 = gr.Button("Analyze Financial Tone on each sentence")
|
|
|
|
| 119 |
fin_spans_1 = gr.HighlightedText(label="Financial Tone Analysis for PDF 1")
|
| 120 |
+
analyze_btn1.click(fn=lambda p: process_paragraph_1(p)[3], inputs=paragraph_1_dropdown, outputs=fin_spans_1)
|
| 121 |
|
| 122 |
# Process the selected paragraph from PDF 2
|
| 123 |
with gr.Column():
|
|
|
|
| 135 |
selected_paragraph_2 = gr.Textbox(label="Selected Paragraph 2 Content", lines=4)
|
| 136 |
selected_paragraph_2.change(show, paragraph_2_dropdown, selected_paragraph_2)
|
| 137 |
summarize_btn2 = gr.Button("Summarize Text from PDF 2")
|
|
|
|
| 138 |
summary_textbox_2 = gr.Textbox(label="Summary for PDF 2", lines=2)
|
| 139 |
+
summarize_btn2.click(fn=lambda p: process_paragraph_2(p)[1], inputs=paragraph_2_dropdown, outputs=summary_textbox_2)
|
| 140 |
sentiment_btn2 = gr.Button("Classify Financial Tone from PDF 2")
|
|
|
|
| 141 |
sentiment_textbox_2 = gr.Textbox(label="Classification for PDF 2", lines=1)
|
| 142 |
+
sentiment_btn2.click(fn=lambda p: process_paragraph_2(p)[2], inputs=paragraph_2_dropdown, outputs=sentiment_textbox_2)
|
| 143 |
analyze_btn2 = gr.Button("Analyze Financial Tone on each sentence")
|
|
|
|
| 144 |
fin_spans_2 = gr.HighlightedText(label="Financial Tone Analysis for PDF 2")
|
| 145 |
+
analyze_btn2.click(fn=lambda p: process_paragraph_2(p)[3], inputs=paragraph_2_dropdown, outputs=fin_spans_2)
|
| 146 |
|
| 147 |
demo.launch()
|