Spaces:
Runtime error
Runtime error
Vasanthengineer4949
commited on
Commit
•
2511bf8
1
Parent(s):
e85e4f8
Initial Prototype version Reader code also updated
Browse files- Reader.ipynb +0 -0
- app.py +29 -0
Reader.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|
app.py
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from transformers import pipeline
|
3 |
+
|
4 |
+
|
5 |
+
st.write("""
|
6 |
+
|
7 |
+
# Question Answering System - Squad_V2
|
8 |
+
|
9 |
+
A simple QA system that answers questions from the given context.
|
10 |
+
|
11 |
+
Ask me a question and I'll try to answer it.
|
12 |
+
|
13 |
+
There are lots of room for imporvements. This is just an initial version.
|
14 |
+
|
15 |
+
""")
|
16 |
+
|
17 |
+
que = st.text_input("Ask me a question", '')
|
18 |
+
content = st.text_area("Enter Context", '')
|
19 |
+
|
20 |
+
if que != "":
|
21 |
+
model_name = "Vasanth/bert-base-uncased-qa-squad2"
|
22 |
+
question_answerer = pipeline("question-answering", model=model_name, tokenizer=model_name)
|
23 |
+
answer = question_answerer(
|
24 |
+
question= que,
|
25 |
+
context= content
|
26 |
+
)
|
27 |
+
st.write(answer["answer"])
|
28 |
+
|
29 |
+
|