Hk4crprasad commited on
Commit
2b17f5a
·
verified ·
1 Parent(s): 20d8851

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -461,13 +461,12 @@ history=[
461
  ]
462
 
463
  def get_pdf_text(pdf_docs):
464
- text = ""
465
- for pdf in pdf_docs:
466
- pdf_reader = fitz.open(pdf)
467
- for page_num in range(pdf_reader.page_count):
468
- page = pdf_reader[page_num]
469
- text += page.get_text()
470
- return text
471
 
472
  def get_text_chunks(text):
473
  text_splitter = RecursiveCharacterTextSplitter(chunk_size=10000, chunk_overlap=1000)
 
461
  ]
462
 
463
  def get_pdf_text(pdf_docs):
464
+ text=""
465
+ for pdf in pdf_docs:
466
+ pdf_reader= PdfReader(pdf)
467
+ for page in pdf_reader.pages:
468
+ text+= page.extract_text()
469
+ return text
 
470
 
471
  def get_text_chunks(text):
472
  text_splitter = RecursiveCharacterTextSplitter(chunk_size=10000, chunk_overlap=1000)