Spaces:
Runtime error
Runtime error
samarthagarwal23
commited on
Commit
•
d4f9cd8
1
Parent(s):
a7c5578
Update app.py
Browse files
app.py
CHANGED
@@ -78,7 +78,7 @@ def final_qa_pipeline(file, query):
|
|
78 |
|
79 |
if len(lvl1) > 0:
|
80 |
fnl_rank = qa_ranker(query, [l["docs"] for l in lvl1], top_k_ranker)
|
81 |
-
return (fnl_rank[0]["answer"], np.round(fnl_rank[0]["score"],3),
|
82 |
#for fnl_ in fnl_rank:
|
83 |
# print("\n")
|
84 |
# print_colored(fnl_['doc'], fnl_['start'], fnl_['end'])
|
@@ -99,5 +99,7 @@ iface = gr.Interface(
|
|
99 |
inputs = [gr.inputs.File(label="input pdf file"), gr.inputs.Textbox(label="Question:")],
|
100 |
outputs = [gr.outputs.Textbox(label="Answer"), gr.outputs.Textbox(label="Score"), gr.outputs.HTML(label="Reference text")],
|
101 |
examples=examples,
|
|
|
|
|
102 |
)
|
103 |
iface.launch()
|
|
|
78 |
|
79 |
if len(lvl1) > 0:
|
80 |
fnl_rank = qa_ranker(query, [l["docs"] for l in lvl1], top_k_ranker)
|
81 |
+
return (fnl_rank[0]["answer"], np.round(fnl_rank[0]["score"],3), fnl_rank[0]['doc'])
|
82 |
#for fnl_ in fnl_rank:
|
83 |
# print("\n")
|
84 |
# print_colored(fnl_['doc'], fnl_['start'], fnl_['end'])
|
|
|
99 |
inputs = [gr.inputs.File(label="input pdf file"), gr.inputs.Textbox(label="Question:")],
|
100 |
outputs = [gr.outputs.Textbox(label="Answer"), gr.outputs.Textbox(label="Score"), gr.outputs.HTML(label="Reference text")],
|
101 |
examples=examples,
|
102 |
+
title = "Question Answering on company annual reports",
|
103 |
+
description = "Upload annual report pdf and ask model a question."
|
104 |
)
|
105 |
iface.launch()
|