Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ from io import BytesIO
|
|
9 |
|
10 |
def extract_text(pdf_file):
|
11 |
pdfReader = PyPDF2.PdfReader(pdf_file)
|
12 |
-
pageObj = pdfReader.pages[0]
|
13 |
return pageObj.extract_text()
|
14 |
|
15 |
def summarize_text(text):
|
@@ -21,7 +21,7 @@ def summarize_text(text):
|
|
21 |
break
|
22 |
abstract = ". ".join(sentences[start:end+1])
|
23 |
summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
|
24 |
-
summary = summarizer(abstract, max_length=
|
25 |
do_sample=False)
|
26 |
return summary[0]['summary_text']
|
27 |
|
|
|
9 |
|
10 |
def extract_text(pdf_file):
|
11 |
pdfReader = PyPDF2.PdfReader(pdf_file)
|
12 |
+
pageObj = pdfReader.pages[0:1]
|
13 |
return pageObj.extract_text()
|
14 |
|
15 |
def summarize_text(text):
|
|
|
21 |
break
|
22 |
abstract = ". ".join(sentences[start:end+1])
|
23 |
summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
|
24 |
+
summary = summarizer(abstract, max_length=40, min_length=40,
|
25 |
do_sample=False)
|
26 |
return summary[0]['summary_text']
|
27 |
|