Spaces:
Build error
Build error
Commit ·
b5214cf
1
Parent(s): df82c16
Update utils.py
Browse files
utils.py
CHANGED
|
@@ -2,7 +2,7 @@ import re
|
|
| 2 |
import requests
|
| 3 |
import docx2txt
|
| 4 |
from io import StringIO
|
| 5 |
-
from PyPDF2 import
|
| 6 |
|
| 7 |
from bs4 import BeautifulSoup
|
| 8 |
from nltk.tokenize import sent_tokenize
|
|
@@ -103,7 +103,7 @@ def preprocess_text_for_abstractive_summarization(tokenizer, text):
|
|
| 103 |
|
| 104 |
|
| 105 |
def read_pdf(file):
|
| 106 |
-
pdfReader =
|
| 107 |
count = pdfReader.numPages
|
| 108 |
all_page_text = ""
|
| 109 |
for i in range(count):
|
|
|
|
| 2 |
import requests
|
| 3 |
import docx2txt
|
| 4 |
from io import StringIO
|
| 5 |
+
from PyPDF2 import PdfReader
|
| 6 |
|
| 7 |
from bs4 import BeautifulSoup
|
| 8 |
from nltk.tokenize import sent_tokenize
|
|
|
|
| 103 |
|
| 104 |
|
| 105 |
def read_pdf(file):
|
| 106 |
+
pdfReader = PdfReader(file)
|
| 107 |
count = pdfReader.numPages
|
| 108 |
all_page_text = ""
|
| 109 |
for i in range(count):
|