Spaces:
Runtime error
Runtime error
Karthikeyan
commited on
Commit
·
86ac1bb
1
Parent(s):
e161238
Update app.py
Browse files
app.py
CHANGED
|
@@ -598,32 +598,38 @@ class KeyValueExtractor:
|
|
| 598 |
def company_names(self,input_text):
|
| 599 |
words = input_text.split("-")
|
| 600 |
return words[1]
|
| 601 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 602 |
def gradio_interface(self):
|
| 603 |
|
| 604 |
with gr.Blocks(css="style.css",theme= 'karthikeyan-adople/hudsonhayes-gray') as app:
|
| 605 |
with gr.Tabs():
|
| 606 |
-
|
| 607 |
-
|
| 608 |
-
|
| 609 |
-
|
| 610 |
-
|
| 611 |
-
|
| 612 |
-
|
| 613 |
-
|
| 614 |
-
|
| 615 |
-
|
| 616 |
-
|
| 617 |
-
|
| 618 |
-
|
| 619 |
-
|
| 620 |
-
|
| 621 |
-
|
| 622 |
-
|
| 623 |
-
|
| 624 |
|
| 625 |
-
|
| 626 |
-
|
| 627 |
|
| 628 |
with gr.TabItem("Finance Tool"):
|
| 629 |
gr.HTML("""<center class="darkblue" style='background-color:rgb(0,1,36); text-align:center;padding:25px;'><center><h1 class ="center">
|
|
|
|
| 598 |
def company_names(self,input_text):
|
| 599 |
words = input_text.split("-")
|
| 600 |
return words[1]
|
| 601 |
+
def clear(self,input_news,result_summary_for_news,key_value_pair_result_for_news,sentiment_plot):
|
| 602 |
+
input_news = None
|
| 603 |
+
result_summary_for_news = None
|
| 604 |
+
key_value_pair_result_for_news = None
|
| 605 |
+
sentiment_plot = None
|
| 606 |
+
return input_news,result_summary_for_news,key_value_pair_result_for_news,sentiment_plot
|
| 607 |
+
|
| 608 |
def gradio_interface(self):
|
| 609 |
|
| 610 |
with gr.Blocks(css="style.css",theme= 'karthikeyan-adople/hudsonhayes-gray') as app:
|
| 611 |
with gr.Tabs():
|
| 612 |
+
with gr.TabItem("Google News"):
|
| 613 |
+
gr.HTML("""<center class="darkblue" style='background-color:rgb(0,1,36); text-align:center;padding:25px;'><center><h1 class ="center">
|
| 614 |
+
<img src="file=logo.png" height="110px" width="280px"></h1></center>
|
| 615 |
+
<br><h1 style="color:#fff">Company performance summarisation and sentiment analysis</h1></center>""")
|
| 616 |
+
with gr.Row(elem_id="col-container"):
|
| 617 |
+
with gr.Column(scale=0.80, min_width=150, ):
|
| 618 |
+
input_news = gr.Textbox(label="NEWS")
|
| 619 |
+
with gr.Column(scale=0.20, min_width=150):
|
| 620 |
+
get_summary_for_news = gr.Button("Analyse")
|
| 621 |
+
clear_btn = gr.ClearButton()
|
| 622 |
+
with gr.Row(elem_id="col-container"):
|
| 623 |
+
with gr.Column(scale=1, min_width=150):
|
| 624 |
+
result_summary_for_news = gr.Textbox(label="Summary", lines = 8)
|
| 625 |
+
with gr.Row(elem_id="col-container"):
|
| 626 |
+
with gr.Column(scale=0.50, min_width=150):
|
| 627 |
+
key_value_pair_result_for_news = gr.Textbox(label="Key Value Pair", lines = 15)
|
| 628 |
+
with gr.Column(scale=0.50, min_width=50):
|
| 629 |
+
sentiment_plot =gr.Plot(label="Sentiment", size=(300, 300))
|
| 630 |
|
| 631 |
+
get_summary_for_news.click(self.main_for_news, input_news, [result_summary_for_news,key_value_pair_result_for_news,sentiment_plot])
|
| 632 |
+
clear_btn.click(self.clear,[input_news,result_summary_for_news,key_value_pair_result_for_news,sentiment_plot],[input_news,result_summary_for_news,key_value_pair_result_for_news,sentiment_plot] )
|
| 633 |
|
| 634 |
with gr.TabItem("Finance Tool"):
|
| 635 |
gr.HTML("""<center class="darkblue" style='background-color:rgb(0,1,36); text-align:center;padding:25px;'><center><h1 class ="center">
|