File size: 974 Bytes
647c3c5
 
 
 
 
 
3baac71
647c3c5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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,
        )