rushi-k commited on
Commit
563bf73
1 Parent(s): fa21aad

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -6,11 +6,11 @@ import os
6
 
7
  # Function to process the PDF and categorize text
8
  def process_pdf(file):
9
- reader = PyPDF2.PdfFileReader(file)
10
  categorized_text = []
11
 
12
- for page_num in range(reader.numPages):
13
- page = reader.getPage(page_num)
14
  text = page.extract_text()
15
 
16
  if "Introduction" in text:
 
6
 
7
  # Function to process the PDF and categorize text
8
  def process_pdf(file):
9
+ reader = PyPDF2.PdfReader(file)
10
  categorized_text = []
11
 
12
+ for page_num in range(len(reader.pages)):
13
+ page = reader.pages[page_num]
14
  text = page.extract_text()
15
 
16
  if "Introduction" in text: