Loader class for Kaggle Invoices dataset. More...

Public Member Functions | |
| __init__ (self, MinioManager minio_manager, Augmentor augmentor, int seed=42, bool apply_ocr=False) | |
| Constructor for KaggleInvoicesLoader class. | |
| pd.DataFrame | load_dataset (self, int chunk_size=100, Optional[int] total_samples=None, bool apply_augmentation=True, int augmentation_factor=3) |
| Loads and processes the Kaggle Invoices dataset. | |
Public Attributes | |
| minio_manager | |
| augmentor | |
| seed | |
| apply_ocr | |
Protected Member Functions | |
| _extract_invoice_id (self, text) | |
| Extracts invoice ID from text description. | |
| _load_pdf_as_image (self, directory, invoice_id) | |
| Loads a PDF file and converts it to an image. | |
Loader class for Kaggle Invoices dataset.
This class provides methods for loading and processing invoice images from the Kaggle platform. It handles data downloading, PDF conversion, augmentation, and integration with MinIO storage for document classification tasks.
| classification.datasets.loader_kaggle_invoices.KaggleInvoicesLoader.__init__ | ( | self, | |
| MinioManager | minio_manager, | ||
| Augmentor | augmentor, | ||
| int | seed = 42, |
||
| bool | apply_ocr = False |
||
| ) |
Constructor for KaggleInvoicesLoader class.
| minio_manager | MinIO manager instance for data storage |
| augmentor | Augmentor instance for data augmentation |
| seed | Random seed for reproducibility |
|
protected |
Extracts invoice ID from text description.
| text | Text description containing invoice ID |
Extract invoice ID from text description
|
protected |
Loads a PDF file and converts it to an image.
| directory | Directory containing PDF files |
| invoice_id | ID of the invoice to load |
Load a PDF file and convert it to an image
| pd.DataFrame classification.datasets.loader_kaggle_invoices.KaggleInvoicesLoader.load_dataset | ( | self, | |
| int | chunk_size = 100, |
||
| Optional[int] | total_samples = None, |
||
| bool | apply_augmentation = True, |
||
| int | augmentation_factor = 3 |
||
| ) |
Loads and processes the Kaggle Invoices dataset.
| chunk_size | Number of samples to process in each chunk |
| total_samples | Total number of samples to load (None for all) |
| apply_augmentation | Whether to apply data augmentation |
| augmentation_factor | Number of augmented versions to create per image |
| classification.datasets.loader_kaggle_invoices.KaggleInvoicesLoader.apply_ocr |
| classification.datasets.loader_kaggle_invoices.KaggleInvoicesLoader.augmentor |
| classification.datasets.loader_kaggle_invoices.KaggleInvoicesLoader.minio_manager |
| classification.datasets.loader_kaggle_invoices.KaggleInvoicesLoader.seed |