Spaces:
Runtime error
Runtime error
shripadbhat
commited on
Commit
•
00a0dbb
1
Parent(s):
4c700e7
Update app.py
Browse files
app.py
CHANGED
@@ -49,18 +49,26 @@ def fetch_answers(question, document ):
|
|
49 |
st.title('Document Question Answering System')
|
50 |
query = st.text_area("Query", "", height=25)
|
51 |
document = st.text_area("Document Text", "", height=100)
|
52 |
-
|
53 |
|
54 |
|
55 |
if st.button("Get Answers From Document"):
|
|
|
56 |
|
57 |
model_name = "MaRiOrOsSi/t5-base-finetuned-question-answering"
|
58 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
59 |
model = AutoModelWithLMHead.from_pretrained(model_name)
|
60 |
|
|
|
|
|
61 |
sentence_segmenter = pysbd.Segmenter(language='en',clean=False)
|
62 |
passage_retreival_model = CrossEncoder('cross-encoder/ms-marco-MiniLM-L-6-v2')
|
63 |
qa_model = pipeline("question-answering",'a-ware/bart-squadv2')
|
64 |
|
|
|
|
|
65 |
st.markdown(fetch_answers(query, document))
|
|
|
|
|
|
|
66 |
|
|
|
49 |
st.title('Document Question Answering System')
|
50 |
query = st.text_area("Query", "", height=25)
|
51 |
document = st.text_area("Document Text", "", height=100)
|
52 |
+
my_bar = st.progress(0)
|
53 |
|
54 |
|
55 |
if st.button("Get Answers From Document"):
|
56 |
+
my_bar.progress(10)
|
57 |
|
58 |
model_name = "MaRiOrOsSi/t5-base-finetuned-question-answering"
|
59 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
60 |
model = AutoModelWithLMHead.from_pretrained(model_name)
|
61 |
|
62 |
+
my_bar.progress(25)
|
63 |
+
|
64 |
sentence_segmenter = pysbd.Segmenter(language='en',clean=False)
|
65 |
passage_retreival_model = CrossEncoder('cross-encoder/ms-marco-MiniLM-L-6-v2')
|
66 |
qa_model = pipeline("question-answering",'a-ware/bart-squadv2')
|
67 |
|
68 |
+
my_bar.progress(75)
|
69 |
+
|
70 |
st.markdown(fetch_answers(query, document))
|
71 |
+
|
72 |
+
my_bar.progress(100)
|
73 |
+
|
74 |
|