Summarize / test.py
IsakNordgren's picture
fler exempel och förbättrad prompt. Testar steg-för-steg-prompting
a7a9d9e
raw
history blame contribute delete
391 Bytes
import PyPDF2
def extract_text_from_pdf(pdf_path):
# Open the PDF file
with open(pdf_path, 'rb') as file:
reader = PyPDF2.PdfReader(file)
text = ''
# Iterate through each page
for page in reader.pages:
text += page.extract_text()
return text
pdf_path = 'Examples/Kris.pdf'
print(extract_text_from_pdf(pdf_path))