PdfPlumberExtractor
DashAI.back.models.RAG.extractors.PdfPlumberExtractor
PDF text extractor using the pdfplumber library.
Builds on pdfminer.six with word and table detection, so it can keep tabular content readable instead of flattening it into a run of numbers.
Parameters
- password : string, default=
- Password for encrypted PDFs. Leave empty for unencrypted files.
- x_tolerance : number, default=
3.0 - Horizontal distance, in points, below which two characters belong to the same word. Lower it when words run together.
- y_tolerance : number, default=
3.0 - Vertical distance, in points, below which two characters belong to the same line. Raise it when a line is split in two.
- layout : boolean, default=
False - Pad the output with whitespace so it mirrors the position of the text on the page. Preserves columns at the cost of extra whitespace.
- extract_tables : boolean, default=
False - Append each detected table after the page text, as tab separated rows. Useful for documents whose data lives in tables.
Methods
extract(self, file_path: str) -> str
PdfPlumberExtractorExtract text from the given file.
get_credential(self, name: str)
ConfigObjectResolve a registered credential component by name.
Parameters
- name : str
- Credential component class name (e.g. "HuggingFaceCredential").
Returns
- BaseCredential
- An instance of the requested credential component.
get_metadata(cls) -> Dict[str, object]
BaseExtractorReturn metadata for registry — primarily supported_file_types.
get_schema(cls) -> dict
ConfigObjectGenerates the component related Json Schema.
Returns
- dict
- Dictionary representing the Json Schema of the component.
validate_and_transform(self, raw_data: dict) -> dict
ConfigObjectIt takes the data given by the user to initialize the model and returns it with all the objects that the model needs to work.
Parameters
- raw_data : dict
- A dictionary with the data provided by the user to initialize the model.
Returns
- dict
- A validated dictionary with the necessary objects.