Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -63,31 +63,35 @@ def answer_questions(context, question):
|
|
63 |
# App Interface
|
64 |
with gr.Blocks() as app:
|
65 |
gr.Markdown("<center> <h1>Question Answering with Short and Long Answer Models </h1> </center><hr>")
|
66 |
-
with gr.
|
67 |
-
with gr.
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
with gr.Row():
|
74 |
-
with gr.Column(
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
with gr.Row():
|
79 |
-
with gr.Column(scale=6):
|
80 |
-
long_answer_output = gr.Textbox(lines=3, label="BERT Base Uncased")
|
81 |
-
with gr.Column(scale=2):
|
82 |
-
long_score_output = gr.Number(label="BERT Base Uncased Score")
|
83 |
-
with gr.Row():
|
84 |
-
with gr.Column(scale=6):
|
85 |
-
long_answer_output = gr.Textbox(lines=3, label="RoBERTa Base")
|
86 |
-
with gr.Column(scale=2):
|
87 |
-
long_score_output = gr.Number(label="RoBERTa Base Score")
|
88 |
-
|
89 |
-
|
90 |
-
submit_btn.click(fn=answer_questions, inputs=[context_input, question_input], outputs=[short_answer_output, short_score_output, long_answer_output, long_score_output])
|
91 |
examples='examples'
|
92 |
gr.Examples(examples,[context_input, question_input],[short_answer_output, short_score_output, long_answer_output, long_score_output],answer_questions)
|
93 |
if __name__ == "__main__":
|
|
|
63 |
# App Interface
|
64 |
with gr.Blocks() as app:
|
65 |
gr.Markdown("<center> <h1>Question Answering with Short and Long Answer Models </h1> </center><hr>")
|
66 |
+
with gr.Tab("QA Short Answer"):
|
67 |
+
with gr.Row():
|
68 |
+
with gr.Column():
|
69 |
+
context_input = gr.Textbox(lines=7, label="Context", placeholder="Input Context here...")
|
70 |
+
question_input = gr.Textbox(label="Question", placeholder="Input Question here...")
|
71 |
+
submit_btn = gr.Button("Submit")
|
72 |
+
gr.ClearButton([context_input,question_input])
|
73 |
+
with gr.Column():
|
74 |
+
with gr.Row():
|
75 |
+
with gr.Column(scale=6):
|
76 |
+
short_answer_output = gr.Textbox(lines=3, label="Distil BERT Base Uncased")
|
77 |
+
with gr.Column(scale=2):
|
78 |
+
short_score_output = gr.Number(label="Distil BERT Base Uncased Score")
|
79 |
+
with gr.Row():
|
80 |
+
with gr.Column(scale=6):
|
81 |
+
long_answer_output = gr.Textbox(lines=3, label="BERT Base Uncased")
|
82 |
+
with gr.Column(scale=2):
|
83 |
+
long_score_output = gr.Number(label="BERT Base Uncased Score")
|
84 |
+
with gr.Row():
|
85 |
+
with gr.Column(scale=6):
|
86 |
+
long_answer_output = gr.Textbox(lines=3, label="RoBERTa Base")
|
87 |
+
with gr.Column(scale=2):
|
88 |
+
long_score_output = gr.Number(label="RoBERTa Base Score")
|
89 |
+
with gr.Tab("Long Answer Prediction"):
|
90 |
with gr.Row():
|
91 |
+
with gr.Column():
|
92 |
+
long_question_input = gr.Textbox(label="Question", placeholder="Input Question here...")
|
93 |
+
|
94 |
+
submit_btn.click(fn=answer_questions, inputs=[context_input, question_input], outputs=[distilbert_base_uncased_output, distilbert_base_uncased_score_output, bert_base_uncased_output, bert_base_uncased_output, roberta_base_output, roberta_base_output])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
examples='examples'
|
96 |
gr.Examples(examples,[context_input, question_input],[short_answer_output, short_score_output, long_answer_output, long_score_output],answer_questions)
|
97 |
if __name__ == "__main__":
|