File size: 759 Bytes
d24f707
5ad2a61
d24f707
eb8b098
 
5ad2a61
eb8b098
9842783
b36e6d7
eb8b098
8d22985
 
 
3efe6ba
 
 
41918c9
 
 
eb8b098
41918c9
 
 
00a0dbb
d24f707
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import streamlit as st
from question_answering import QuestionAnswering

st.title('Document Question Answering System')
st.write("Loading the models...")
qa = QuestionAnswering()
st.write('Models Loaded')


document_text = st.text_area("Document Text", "", height=100)
query = st.text_input("Query")


#if st.button("Get Answers From Document"):
if len(document_text.strip()) > 0 and len(query.strip()) > 0:
    st.write('Fetching answer...')
    answers_lines = qa.fetch_answers(query, document_text).splitlines()
    answer_first = answers_lines[0]
    reference_first = answers_lines[1]
    st.write('Check the answer below...with reference text')
    st.header("ANSWER: "+answer_first)
    st.subheader("REFERENCE: "+reference_first)
    #st.markdown()