import h5py | |
import datasets | |
_CITATION = """\ | |
@misc{portuguesocr2025, | |
title={Portuguese OCR Dataset}, | |
author={Mohammadreza Asadollahifard, M.}, | |
year={2025}, | |
howpublished={\\url{https://huggingface.co/datasets/mazafard/portugues_ocr_dataset}}, | |
} | |
""" | |
_DESCRIPTION = """\ | |
A dataset for Optical Character Recognition (OCR) in European Portuguese. | |
Contains 10,000 printed text image samples with corresponding text labels. | |
""" | |
_HOMEPAGE = "https://huggingface.co/datasets/mazafard/portugues_ocr_dataset" | |
class PortuguesOcrDataset(datasets.GeneratorBasedBuilder): | |
def _info(self): | |
return datasets.DatasetInfo( | |
description=_DESCRIPTION, | |
features=datasets.Features({ | |
"image": datasets.Array3D(shape=(100, 1200, 3), dtype="uint8"), | |
"text": datasets.Value("string"), | |
}), | |
supervised_keys=("image", "text"), | |
homepage=_HOMEPAGE, | |
citation=_CITATION, | |
) | |