Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,22 +1,22 @@
|
|
1 |
-
import streamlit as st
|
2 |
-
from
|
3 |
-
from
|
4 |
-
from
|
5 |
-
|
6 |
-
st.title("π
|
7 |
-
|
8 |
-
uploaded_file = st.file_uploader("Upload a PDF", type=
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
if question:
|
20 |
-
|
21 |
-
|
22 |
-
st.
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from summarize import summarize_text
|
3 |
+
from generate_answers import get_answer
|
4 |
+
from utils import extract_text_from_pdf
|
5 |
+
st.title("By:- Akshat Thakkar , Kartik Raghuvanshi")
|
6 |
+
st.title("π BERT-based Question Answering on PDF (with T5 Summarization)")
|
7 |
+
|
8 |
+
uploaded_file = st.file_uploader("Upload a PDF document", type="pdf")
|
9 |
+
|
10 |
+
if uploaded_file:
|
11 |
+
raw_text = extract_text_from_pdf(uploaded_file)
|
12 |
+
summary = summarize_text(raw_text)
|
13 |
+
|
14 |
+
st.subheader("π Summary of the Document")
|
15 |
+
st.write(summary)
|
16 |
+
|
17 |
+
question = st.text_input("β Ask a Question Based on the Summary")
|
18 |
+
|
19 |
+
if question:
|
20 |
+
answer = get_answer(question, summary)
|
21 |
+
st.subheader("β
Answer")
|
22 |
+
st.write(answer)
|