Text Loaders
PDFLoader
This notebook will demonstrate how to use the PDFLoader
to load text from a pdf file.
from flushai.integrations import PDFLoader
Initialization
loader = PDFLoader()
Retrieving Text
Let’s say we have a pdf file about a short story about little red riding hood that we want to fetch the text from.
story = loader.load(pdf_path="redridinghood.pdf")
print(story)
'''
Once upon a time, in a dense, untamed forest there lived a creature
whose name whispered fear into the hearts of all: the Big Bad Wolf.
This wolf was not ordinary; his fur was as dark as the midnight sky,
eyes glowing like embers, and a howl that could chill the bone.
Legends spoke of his cunning and ferocity, but little did they know,
the wolf harbored a secret that no one could have guessed...
'''
We can then pass this in to any text-to-image or text-to-text (LLM) model.