Update app.py
Browse files
app.py
CHANGED
@@ -21,11 +21,16 @@ def mainFun(query,file):
|
|
21 |
return text,answer_p,summarize_text(answer_main)
|
22 |
|
23 |
def mainFun2(temp):
|
24 |
-
return fin_ner(temp)
|
25 |
-
#return temp
|
26 |
-
|
27 |
|
|
|
|
|
28 |
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
|
31 |
demo = gr.Blocks()
|
@@ -34,6 +39,7 @@ with demo:
|
|
34 |
text = gr.Textbox(lines=10)
|
35 |
selected_ques=gr.Dropdown(choices=questions,label='SEARCH QUERY')
|
36 |
b1 = gr.Button("Analyze File")
|
|
|
37 |
answer = gr.Textbox(lines=2)
|
38 |
summarize = gr.Textbox(lines=2)
|
39 |
b1.click(mainFun, inputs=[selected_ques,txt_file], outputs=[text,answer,summarize])
|
@@ -42,14 +48,16 @@ with demo:
|
|
42 |
label_ner = gr.HighlightedText()
|
43 |
b2.click(mainFun2,inputs=answer,outputs=label_ner)
|
44 |
|
45 |
-
|
46 |
b3=gr.Button("Get CLAIM")
|
47 |
-
label_claim = gr.
|
|
|
48 |
|
49 |
b4=gr.Button("Get SUSTAINABILITY")
|
50 |
label_sus = gr.Label()
|
|
|
51 |
|
52 |
b5=gr.Button("Get FLS")
|
53 |
label_fls = gr.Label()
|
|
|
54 |
|
55 |
demo.launch()
|
|
|
21 |
return text,answer_p,summarize_text(answer_main)
|
22 |
|
23 |
def mainFun2(temp):
|
24 |
+
return fin_ner(temp.split('Probability:')[0])
|
|
|
|
|
25 |
|
26 |
+
def mainFun3(temp):
|
27 |
+
return score_fincat(temp.split('Probability:')[0])
|
28 |
|
29 |
+
def mainFun4(temp):
|
30 |
+
return get_sustainability(temp.split('Probability:')[0])
|
31 |
+
|
32 |
+
def mainFun5(temp):
|
33 |
+
return fls(temp.split('Probability:')[0])
|
34 |
|
35 |
|
36 |
demo = gr.Blocks()
|
|
|
39 |
text = gr.Textbox(lines=10)
|
40 |
selected_ques=gr.Dropdown(choices=questions,label='SEARCH QUERY')
|
41 |
b1 = gr.Button("Analyze File")
|
42 |
+
|
43 |
answer = gr.Textbox(lines=2)
|
44 |
summarize = gr.Textbox(lines=2)
|
45 |
b1.click(mainFun, inputs=[selected_ques,txt_file], outputs=[text,answer,summarize])
|
|
|
48 |
label_ner = gr.HighlightedText()
|
49 |
b2.click(mainFun2,inputs=answer,outputs=label_ner)
|
50 |
|
|
|
51 |
b3=gr.Button("Get CLAIM")
|
52 |
+
label_claim = gr.HighlightedText()
|
53 |
+
b3.click(mainFun3,inputs=answer,outputs=label_claim)
|
54 |
|
55 |
b4=gr.Button("Get SUSTAINABILITY")
|
56 |
label_sus = gr.Label()
|
57 |
+
b4.click(mainFun4,inputs=answer,outputs=label_sus)
|
58 |
|
59 |
b5=gr.Button("Get FLS")
|
60 |
label_fls = gr.Label()
|
61 |
+
b5.click(mainFun5,inputs=answer,outputs=label_fls)
|
62 |
|
63 |
demo.launch()
|