Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -395,9 +395,9 @@ function refresh() {
|
|
395 |
|
396 |
# Define custom colors for the labels
|
397 |
color_map = {
|
398 |
-
"
|
399 |
-
"
|
400 |
-
"
|
401 |
}
|
402 |
|
403 |
|
@@ -464,8 +464,8 @@ with gr.Blocks(theme='gradio/soft',js=js_func) as demo:
|
|
464 |
# Summarize the selected paragraph from PDF 1
|
465 |
summarize_btn1.click(fn=lambda p: process_paragraph_1_sum(p), inputs=paragraph_1_dropdown, outputs=summary_textbox_1)
|
466 |
|
467 |
-
sentiment_btn1 = gr.Button("Classify Financial Tone from PDF 1")
|
468 |
-
sentiment_textbox_1 = gr.Label(label="Classification
|
469 |
|
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)
|
@@ -499,8 +499,8 @@ with gr.Blocks(theme='gradio/soft',js=js_func) as demo:
|
|
499 |
# Summarize the selected paragraph from PDF 2
|
500 |
summarize_btn2.click(fn=lambda p: process_paragraph_2_sum(p), inputs=paragraph_2_dropdown, outputs=summary_textbox_2)
|
501 |
|
502 |
-
sentiment_btn2 = gr.Button("Classify Financial Tone from PDF 2")
|
503 |
-
sentiment_textbox_2 = gr.Label(label="Classification
|
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)
|
|
|
395 |
|
396 |
# Define custom colors for the labels
|
397 |
color_map = {
|
398 |
+
"POSITIVE": "#00FF00", # Green for positive
|
399 |
+
"NEUTRAL": "#0000FF", # Blue for neutral
|
400 |
+
"NEGATIVE": "#FF0000" # Red for negative
|
401 |
}
|
402 |
|
403 |
|
|
|
464 |
# Summarize the selected paragraph from PDF 1
|
465 |
summarize_btn1.click(fn=lambda p: process_paragraph_1_sum(p), inputs=paragraph_1_dropdown, outputs=summary_textbox_1)
|
466 |
|
467 |
+
sentiment_btn1 = gr.Button("Classify Financial Tone for paragraph from PDF 1")
|
468 |
+
sentiment_textbox_1 = gr.Label(label="Classification from PDF 1")
|
469 |
|
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)
|
|
|
499 |
# Summarize the selected paragraph from PDF 2
|
500 |
summarize_btn2.click(fn=lambda p: process_paragraph_2_sum(p), inputs=paragraph_2_dropdown, outputs=summary_textbox_2)
|
501 |
|
502 |
+
sentiment_btn2 = gr.Button("Classify Financial Tone for paragraph from PDF 2")
|
503 |
+
sentiment_textbox_2 = gr.Label(label="Classification from PDF 2")
|
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)
|