Mary12 commited on
Commit
cd07ca3
·
1 Parent(s): 33b63e4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -17,12 +17,13 @@ def remove_references(text):
17
 
18
 
19
  def extract_text_from_pdf(file_path):
20
- reader = PdfReader(file_path)
21
- text = ""
22
- for page in reader.pages[2:]:
23
- text += page.extract_text() + "\n"
24
-
25
- return text
 
26
 
27
 
28
  def model(model_name):
 
17
 
18
 
19
  def extract_text_from_pdf(file_path):
20
+ text = ""
21
+ with open(file_path, "rb") as pdf_file:
22
+ pdf_reader = PyPDF2.PdfReader(pdf_file)
23
+ for page in pdf_reader.pages:
24
+ text += page.extract_text() + "\n"
25
+ return text
26
+
27
 
28
 
29
  def model(model_name):