CoolFace
Datasetpublic

ferjorosa/bne-hemeroteca-ocr-xix

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… See the full description on the dataset page: https://huggingface.co/datasets/ferjorosa/bne-hemeroteca-ocr-xix.

sourceHugging Facecc0-1.0updated 9mo agoView on Hugging Face
2likes258downloads
Dataset Card

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.

<details> <summary>Full list of collections included (20 collections)</summary>

<table> <thead> <tr> <th>Collection</th> <th>Split</th> </tr> </thead> <tbody> <tr> <td>Agricultura y ganadería</td> <td>agriculturayganaderia</td> </tr> <tr> <td>Ciencias</td> <td>ciencias</td> </tr> <tr> <td>Cultura</td> <td>cultura</td> </tr> <tr> <td>Deportes</td> <td>deportes</td> </tr> <tr> <td>Derecho</td> <td>derecho</td> </tr> <tr> <td>Economía</td> <td>economia</td> </tr> <tr> <td>Educación</td> <td>educacion</td> </tr> <tr> <td>Fuerzas armadas</td> <td>fuerzasarmadas</td> </tr> <tr> <td>Historia</td> <td>historia</td> </tr> <tr> <td>Industria</td> <td>industria</td> </tr> <tr> <td>Literatura</td> <td>literatura</td> </tr> <tr> <td>Medicina</td> <td>medicina</td> </tr> <tr> <td>Minería</td> <td>mineria</td> </tr> <tr> <td>Música</td> <td>musica</td> </tr> <tr> <td>Navegación</td> <td>navegacion</td> </tr> <tr> <td>Política</td> <td>politica</td> </tr> <tr> <td>Relaciones internacionales</td> <td>relacionesinternacionales</td> </tr> <tr> <td>Religión</td> <td>religion</td> </tr> <tr> <td>Revistas femeninas</td> <td>revistas_femeninas</td> </tr> <tr> <td>Teatro</td> <td>teatro</td> </tr> </tbody> </table>

</details>

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

FieldDescription
imagePage image
textFull OCR text (Markdown format)
issue_uuidUnique identifier for the issue
issue_nameName/Title of the issue
pagePage number
publication_issnISSN of the publication
datePublication date
issue_linkLink to the original issue on BNE website
model_idOCR model used (allenai/olmOCR-2-7B-1025-FP8)

OCR Metadata

FieldDescription
primary_languagePrimary language detected on page
is_tableWhether the page contains tables
is_diagramWhether the page contains diagrams
is_rotation_validWhether page rotation was valid
rotation_correctionDegrees of rotation correction applied
total_input_tokensToken count (input)
total_output_tokensToken count (output)

Citation

bibtex
@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.