RAG-Chatbot / loader.py
Aaravkumar's picture
Upload 7 files
cb1f2f8 verified
Raw
History Blame Contribute Delete
348 Bytes
import PyPDF2
class Loader:
"""
loads the text from the pdf files
"""
def __init__(self,file_path):
self.file = file_path
def load(self):
reader = PyPDF2.PdfReader(self.file)
text = ""
for page in reader.pages:
text = text + page.extract_text()
return text