Update app.py
Browse files
app.py
CHANGED
@@ -12,17 +12,13 @@ def load_questions():
|
|
12 |
return questions
|
13 |
questions = load_questions()
|
14 |
|
15 |
-
|
16 |
-
with open(file.name) as f:
|
17 |
-
text = f.read()
|
18 |
-
return text
|
19 |
-
|
20 |
def mainFun(query,file):
|
21 |
text=''
|
22 |
with open(file.name) as f:
|
23 |
text = f.read()
|
24 |
-
|
25 |
-
return text,answer_p,summarize_text(
|
26 |
|
27 |
|
28 |
|
@@ -36,4 +32,18 @@ with demo:
|
|
36 |
answer = gr.Textbox(lines=2)
|
37 |
summarize = gr.Textbox(lines=2)
|
38 |
b1.click(mainFun, inputs=[selected_ques,txt_file], outputs=[text,answer,summarize])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
demo.launch()
|
|
|
12 |
return questions
|
13 |
questions = load_questions()
|
14 |
|
15 |
+
answer_main=''
|
|
|
|
|
|
|
|
|
16 |
def mainFun(query,file):
|
17 |
text=''
|
18 |
with open(file.name) as f:
|
19 |
text = f.read()
|
20 |
+
answer_main,answer_p=quad(query,file)
|
21 |
+
return text,answer_p,summarize_text(answer_main)
|
22 |
|
23 |
|
24 |
|
|
|
32 |
answer = gr.Textbox(lines=2)
|
33 |
summarize = gr.Textbox(lines=2)
|
34 |
b1.click(mainFun, inputs=[selected_ques,txt_file], outputs=[text,answer,summarize])
|
35 |
+
|
36 |
+
b2=gr.Button("Get NER")
|
37 |
+
label_ner = gr.Label()
|
38 |
+
b1.click(fin_ner,inputs=answer_main,outputs=gr.HighlightedText())
|
39 |
+
|
40 |
+
b3=gr.Button("Get CLAIM")
|
41 |
+
label_claim = gr.Label()
|
42 |
+
|
43 |
+
b4=gr.Button("Get SUSTAINABILITY")
|
44 |
+
label_sus = gr.Label()
|
45 |
+
|
46 |
+
b5=gr.Button("Get FLS")
|
47 |
+
label_fls = gr.Label()
|
48 |
+
|
49 |
demo.launch()
|