ferjorosa's picture
Upload README.md with huggingface_hub
34be1d8 verified
|
Raw History Blame Contribute Delete
5.14 kB
metadata
license: cc0-1.0
task_categories:
  - image-to-text
  - text-retrieval
  - text-generation
language:
  - es
tags:
  - historical
  - magazines
  - spain
  - cultural-heritage
  - hemeroteca
  - archive
  - bne
  - ocr
  - 19th-century
  - pretraining
size_categories:
  - 100K<n<1M

BNE Hemeroteca OCR Dataset (19th Century)

This dataset provides full-text OCR and high-resolution page images for 19th-century Spanish publications sourced from the Biblioteca Nacional de España (BNE) - Hemeroteca Digital. It consists of over 830,000 pages from approximately 40,000 documents, totaling roughly 800 million text tokens.

Note on Temporal Coverage: Although the selected publications originated in the 19th century, some long-running titles extend into the early 20th century. To apply a strict temporal filter, please use the date column.

Methodology

This dataset was built starting from the bne-hemeroteca-publications dataset. We filtered publications using the date column to focus on those from the 19th century, and selected 20 thematic collections (see full list below). Newspapers were intentionally excluded as their multi-column layouts did not perform well in manual OCR tests.

For each selected publication, we downloaded the corresponding issue PDFs from BNE, converted pages to images, and processed them with allenai/olmOCR-2-7B-1025-FP8 to extract text in markdown format.

Full list of collections included (20 collections)
Collection Split
Agricultura y ganadería agricultura_y_ganaderia
Ciencias ciencias
Cultura cultura
Deportes deportes
Derecho derecho
Economía economia
Educación educacion
Fuerzas armadas fuerzas_armadas
Historia historia
Industria industria
Literatura literatura
Medicina medicina
Minería mineria
Música musica
Navegación navegacion
Política politica
Relaciones internacionales relaciones_internacionales
Religión religion
Revistas femeninas revistas_femeninas
Teatro teatro

Use Cases

  • OCR benchmarking and fine-tuning: Use the existing OCR output as a baseline. Review and correct samples to generate ground truth for training improved OCR models on historical Spanish documents.

  • Text retrieval and RAG: Since the original PDFs are scanned images, this dataset unlocks full-text search. Build retrieval-augmented generation (RAG) systems to query historical Spanish press.

  • LLM pretraining: Use the generated text for general pretraining or to build time-capsule language models trained exclusively on 19th century text, capturing the language, topics, and worldview of that era.

Efficient Data Loading

If you are only interested in the text or metadata for early exploration (skipping the large images), we provide a script to download only specific columns efficiently.

Fields

Page Data

Field Description
image Page image
text Full OCR text (Markdown format)
issue_uuid Unique identifier for the issue
issue_name Name/Title of the issue
page Page number
publication_issn ISSN of the publication
date Publication date
issue_link Link to the original issue on BNE website
model_id OCR model used (allenai/olmOCR-2-7B-1025-FP8)

OCR Metadata

Field Description
primary_language Primary language detected on page
is_table Whether the page contains tables
is_diagram Whether the page contains diagrams
is_rotation_valid Whether page rotation was valid
rotation_correction Degrees of rotation correction applied
total_input_tokens Token count (input)
total_output_tokens Token count (output)

Citation

@dataset{bne_hemeroteca_ocr_xix,
  title={BNE Hemeroteca OCR Dataset (19th Century)},
  author={Fernando Rodriguez},
  year={2025},
  url={https://huggingface.co/datasets/ferjorosa/bne-hemeroteca-ocr-xix},
  note={Processed with olmOCR from Hemeroteca Digital (BNE) archives}
}

License

CC0 1.0 (Public Domain). Original content provided by the Biblioteca Nacional de España.