langchain.document_loaders.parsers.pdf
.PDFPlumberParser¶
- class langchain.document_loaders.parsers.pdf.PDFPlumberParser(text_kwargs: Optional[Mapping[str, Any]] = None, dedupe: bool = False, extract_images: bool = False)[source]¶
Parse PDF with PDFPlumber.
Initialize the parser.
- Parameters
text_kwargs – Keyword arguments to pass to
pdfplumber.Page.extract_text()
dedupe – Avoiding the error of duplicate characters if dedupe=True.
Methods
__init__
([text_kwargs, dedupe, extract_images])Initialize the parser.
lazy_parse
(blob)Lazily parse the blob.
parse
(blob)Eagerly parse the blob into a document or documents.
- __init__(text_kwargs: Optional[Mapping[str, Any]] = None, dedupe: bool = False, extract_images: bool = False) None [source]¶
Initialize the parser.
- Parameters
text_kwargs – Keyword arguments to pass to
pdfplumber.Page.extract_text()
dedupe – Avoiding the error of duplicate characters if dedupe=True.
- parse(blob: Blob) List[Document] ¶
Eagerly parse the blob into a document or documents.
This is a convenience method for interactive development environment.
Production applications should favor the lazy_parse method instead.
Subclasses should generally not over-ride this parse method.
- Parameters
blob – Blob instance
- Returns
List of documents