Dataset Viewer
The dataset viewer is not available for this dataset.
Cannot get the config names for the dataset.
Error code:   ConfigNamesError
Exception:    RuntimeError
Message:      Dataset scripts are no longer supported, but found portugues_ocr_dataset.py
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/dataset/config_names.py", line 67, in compute_config_names_response
                  config_names = get_dataset_config_names(
                      path=dataset,
                      token=hf_token,
                  )
                File "/usr/local/lib/python3.14/site-packages/datasets/inspect.py", line 161, in get_dataset_config_names
                  dataset_module = dataset_module_factory(
                      path,
                  ...<4 lines>...
                      **download_kwargs,
                  )
                File "/usr/local/lib/python3.14/site-packages/datasets/load.py", line 1182, in dataset_module_factory
                  raise e1 from None
                File "/usr/local/lib/python3.14/site-packages/datasets/load.py", line 1142, in dataset_module_factory
                  raise RuntimeError(f"Dataset scripts are no longer supported, but found {filename}")
              RuntimeError: Dataset scripts are no longer supported, but found portugues_ocr_dataset.py

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

πŸ“˜ Portuguese OCR Dataset

This dataset contains scanned image-text pairs in European Portuguese, curated manually for Optical Character Recognition (OCR) tasks. It includes literary sentences and historical excerpts.

πŸ“¦ Dataset Overview

  • Total Samples: 10,000
  • Image Shape: (10000, 100, 1200, 3) β€” color images with height 100 and width 1200 pixels
  • Text Example:
    "E mais avante o Estreito que se arreia"

πŸ“‚ Dataset Structure

The dataset is stored in a single HDF5 file (dataset.h5), which includes:

  • images: a NumPy array of grayscale image data (from PNG files)
  • texts: a list of UTF-8 encoded strings, corresponding to each image

Each sample pairs an image and its corresponding transcription.

πŸ“Š Dataset Statistics

  • Format: HDF5 (dataset.h5)
  • Total samples: ~10,000
  • Average image size: 224x224 pixels (if preprocessed)
  • Language: European Portuguese
  • Source: literary and historic texts

πŸ’Ύ How to Load

To use this dataset with the Hugging Face Datasets library:

from datasets import load_dataset
import h5py

# Load from Hugging Face
dataset_path = "mazafard/portugues_ocr_dataset"
h5_file = load_dataset(dataset_path, data_files="dataset.h5", split="train")

# Alternatively, open the HDF5 file directly
with h5py.File("dataset.h5", "r") as f:
    images = f["images"][:]        # NumPy array of images
    texts = f["texts"][:]          # List of transcriptions

🧠 Use Cases

  • Fine-tuning OCR models like microsoft/trocr-base-printed
  • Document digitization
  • Research in Portuguese language modeling and handwritten/printed recognition

πŸ“œ License

MIT License β€” free for academic and commercial use with attribution.

πŸ“¦ How to Inspect dataset.h5

You can extract metadata from the HDF5 file using h5py:

import h5py

with h5py.File("dataset.h5", "r") as f:
    print("Keys:", list(f.keys()))  # ['images', 'texts']
    print("Number of samples:", len(f["texts"]))
    print("Image shape:", f["images"].shape)
    print("Example text:", f["texts"][0])

⚠️ Note

This dataset uses synthetic text-image pairs for printed OCR. Handwritten or scanned documents are not included.

Downloads last month
63