langchain.document_loaders.pdf.BasePDFLoader¶

class langchain.document_loaders.pdf.BasePDFLoader(file_path: str)[source]¶

Bases: BaseLoader, ABC

Base loader class for PDF files.

Defaults to check for local file, but if the file is a web path, it will download it to a temporary file, use it, then clean up the temporary file after completion

Initialize with a file path.

Methods

__init__(file_path)

Initialize with a file path.

lazy_load()

A lazy loader for Documents.

load()

Load data into Document objects.

load_and_split([text_splitter])

Load Documents and split into chunks.

Attributes

source

lazy_load() Iterator[Document]¶

A lazy loader for Documents.

abstract load() List[Document]¶

Load data into Document objects.

load_and_split(text_splitter: Optional[TextSplitter] = None) List[Document]¶

Load Documents and split into chunks. Chunks are returned as Documents.

Parameters

text_splitter – TextSplitter instance to use for splitting documents. Defaults to RecursiveCharacterTextSplitter.

Returns

List of Documents.

property source: str¶