anirudh1112/corrected-tobacco-dataset-with-ocr
Corrected Tobacco3482 Dataset This repository contains a cleaned and corrected version of the Tobacco3482 dataset. It addresses significant labeling errors found in the original source that negatively impact model performance. π Dataset Context The original Tobacco3482 dataset is a staple for document image classification, but it is known to contain noisy labels. This version integrates corrections provided by the research community to ensure a higher standardβ¦ See the full description on the dataset page: https://huggingface.co/datasets/anirudh1112/corrected-tobacco-dataset-with-ocr.
license: cc-by-4.0 task_categories:
- image-classification
- text-classification tags:
- ocr
- document-understanding
- tobacco3482 size_categories:
- 1K<n<10K ---
Corrected Tobacco3482 Dataset
This repository contains a cleaned and corrected version of the Tobacco3482 dataset. It addresses significant labeling errors found in the original source that negatively impact model performance.
π Dataset Context
The original Tobacco3482 dataset is a staple for document image classification, but it is known to contain noisy labels. This version integrates corrections provided by the research community to ensure a higher standard for multi-modal evaluation.
Source Comparison
π οΈ Dataset Creation & Cleaning
It was discovered that the original dataset contained numerous errors. This version was built using the following pipeline:
- Alignment: Downloaded the HuggingFace dataset and the Gordon Lim correction CSV.
- Filtering: Removed instances with multiple labels or empty labels to ensure a clean, single-label classification task.
- Intersection: Verified the intersection between the physical image files and the correction metadata.
- OCR Processing: Integrated HOCR data alongside images for multi-modal (Vision + NLP) tasks.
π Folder Structure
The dataset is organized into standard train, test, and val splits, compatible with the Hugging Face datasets library:
corrected_tobacco_data/
βββ README.md
βββ train/
β βββ metadata.jsonl # Contains file_name, label, and OCR text
β βββ image_train.jpg
β βββ image_train.hocr
βββ val/
β βββ metadata.jsonl
β βββ image_val.jpg
β βββ image_val.hocr
βββ test/
βββ metadata.jsonl
βββ image_test.jpg
βββ image_test.hocrπ How to Use
You can load this dataset directly using the π€ Datasets library:
from datasets import load_dataset
dataset = load_dataset("your-username/your-repo-name")
# Accessing an example
print(dataset['train'][0]['text']) # Access OCR text
dataset['train'][0]['image'] # Access PIL ImageAcknowledgements
Special thanks to Gordon Lim for the label corrections and the original contributors of the Tobacco3482 dataset.
