nurindahpratiwi
commited on
Commit
·
149d18b
1
Parent(s):
dce9346
fix line
Browse files
app.py
CHANGED
@@ -25,8 +25,10 @@ def preprocess_pdf(file):
|
|
25 |
final_text = final_text + text.page_content
|
26 |
return final_text
|
27 |
|
|
|
|
|
28 |
# Language Model pipeline
|
29 |
-
def language_model_pipeline(filepath
|
30 |
summarization_pipeline = pipeline(
|
31 |
'summarization',
|
32 |
model=model,
|
@@ -51,7 +53,6 @@ def main():
|
|
51 |
st.title("PDF Summarization App using Language Model")
|
52 |
|
53 |
uploaded_file = st.file_uploader("Upload your PDF file", type=['pdf'])
|
54 |
-
maxlength = st.number_input("Length of token", min_value=32, max_value=1024, step=32, placeholder="Type a number (min 32)...")
|
55 |
|
56 |
if uploaded_file is not None:
|
57 |
if st.button("Summarize"):
|
@@ -63,7 +64,7 @@ def main():
|
|
63 |
st.success("File Uploaded")
|
64 |
|
65 |
with col2:
|
66 |
-
summarized_result = language_model_pipeline(filepath
|
67 |
st.info("Summarization Complete")
|
68 |
st.success(summarized_result)
|
69 |
|
|
|
25 |
final_text = final_text + text.page_content
|
26 |
return final_text
|
27 |
|
28 |
+
maxlength = st.number_input("Length of token", min_value=32, max_value=1024, step=32, placeholder="Type a number (min 32)...")
|
29 |
+
|
30 |
# Language Model pipeline
|
31 |
+
def language_model_pipeline(filepath):
|
32 |
summarization_pipeline = pipeline(
|
33 |
'summarization',
|
34 |
model=model,
|
|
|
53 |
st.title("PDF Summarization App using Language Model")
|
54 |
|
55 |
uploaded_file = st.file_uploader("Upload your PDF file", type=['pdf'])
|
|
|
56 |
|
57 |
if uploaded_file is not None:
|
58 |
if st.button("Summarize"):
|
|
|
64 |
st.success("File Uploaded")
|
65 |
|
66 |
with col2:
|
67 |
+
summarized_result = language_model_pipeline(filepath)
|
68 |
st.info("Summarization Complete")
|
69 |
st.success(summarized_result)
|
70 |
|