Dataset Viewer
Auto-converted to Parquet Duplicate
document_id
stringclasses
50 values
page_number
stringlengths
9
9
image
imagewidth (px)
600
600
text
stringlengths
0
5.19k
alto_xml
stringlengths
595
133k
has_image
bool
1 class
has_alto
bool
1 class
markdown
stringlengths
0
38.6k
inference_info
stringclasses
1 value
204486115
204788144
ENVIRONMENTAL PROTECTION Air Pollutants: UK Emissions of Selected Gases from All Sources Million tonnes Source: National Environmental Technology Centre regulations for emissions such as carbon dioxide, hydrocarbons, oxides of nitrogen and particulate matter. Three EC Directives agreed during the UK Presidency, and whi...
<?xml version="1.0" encoding="UTF-8"?> <alto xmlns="http://www.loc.gov/standards/alto/v3/alto.xsd"><Description><MeasurementUnit>pixel</MeasurementUnit><sourceImageInformation><fileName>./data/pdfs/204486115.pdf</fileName></sourceImageInformation><OCRProcessing ID="IdOcr"><ocrProcessingStep><processingDateTime>Wed Nov ...
true
true
# Air Pollutants: UK Emissions of Selected Gases from All Sources ![image](image_1.png) **Sources:** National Environmental Technology Centre --- ### Regulations for Emissions Regulations for emissions such as carbon dioxide, hydrocarbons, oxides of nitrogen and particulate matter. Three EC Directives agreed durin...
[{"model_id": "lightonai/LightOnOCR-0.9B-32k-1025", "model_name": "LightOnOCR", "vocab_size": "32k", "column_name": "markdown", "timestamp": "2025-10-24T12:34:40.393921", "temperature": 0.2, "top_p": 0.9, "max_tokens": 6500, "target_size": 1288}]
204486117
204805723
26: SCIENCE, ENGINEERING AND TECHNOLOGY Activities such as these are important in assuring continued interest in SET among young people making educational and career choices. They also help to enhance the public’s ability to relate to scientific issues in general and to make informed judgments about scientific developm...
<?xml version="1.0" encoding="UTF-8"?> <alto xmlns="http://www.loc.gov/standards/alto/v3/alto.xsd"><Description><MeasurementUnit>pixel</MeasurementUnit><sourceImageInformation><fileName>./data/pdfs/204486117.pdf</fileName></sourceImageInformation><OCRProcessing ID="IdOcr"><ocrProcessingStep><processingDateTime>Wed Nov ...
true
true
# 26: SCIENCE, ENGINEERING AND TECHNOLOGY Activities such as these are important in assuring continued interest in SET among young people making educational and career choices. They also help to enhance the public's ability to relate to scientific issues in general and to make informed judgments about scientific devel...
[{"model_id": "lightonai/LightOnOCR-0.9B-32k-1025", "model_name": "LightOnOCR", "vocab_size": "32k", "column_name": "markdown", "timestamp": "2025-10-24T12:34:40.393921", "temperature": 0.2, "top_p": 0.9, "max_tokens": 6500, "target_size": 1288}]
189742219
189881032
"Peterhead ■\nChapelcross\n▲ Dinorwig \\\nA Ffestiniog\n• Trawsfynydd\nRatcliffe-on-Soar\nRhei(...TRUNCATED)
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<alto xmlns=\"http://www.loc.gov/standards/alto/v3/alto(...TRUNCATED)
true
true
"# Electricity\n\n![image](image_1.png)\n\n- **Orkney Islands**\n- **Shetland Islands**\n\n**Legend:(...TRUNCATED)
"[{\"model_id\": \"lightonai/LightOnOCR-0.9B-32k-1025\", \"model_name\": \"LightOnOCR\", \"vocab_siz(...TRUNCATED)
204486089
204586555
"8\nBRITAIN: AN OFFICIAL HANDBOOK\nBritain, as in all countries before the development of medical sc(...TRUNCATED)
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<alto xmlns=\"http://www.loc.gov/standards/alto/v3/alto(...TRUNCATED)
true
true
"8 BRITAIN: AN OFFICIAL HANDBOOK\n\nBritain, as in all countries before the development of medical s(...TRUNCATED)
"[{\"model_id\": \"lightonai/LightOnOCR-0.9B-32k-1025\", \"model_name\": \"LightOnOCR\", \"vocab_siz(...TRUNCATED)
204486116
204791459
"Abbeys and Priories: p. 1, English Heritage Photo Library; p. 2, Crown Copyright, Historic\nScotlan(...TRUNCATED)
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<alto xmlns=\"http://www.loc.gov/standards/alto/v3/alto(...TRUNCATED)
true
true
"Abbeys and Priorities: p. 1, English Heritage Photo Library; p. 2, Crown Copyright, Historic Scotla(...TRUNCATED)
"[{\"model_id\": \"lightonai/LightOnOCR-0.9B-32k-1025\", \"model_name\": \"LightOnOCR\", \"vocab_siz(...TRUNCATED)
189742213
189840602
"6\nSocial Welfare\nThe British social welfare system comprises the National Health Service, the\npe(...TRUNCATED)
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<alto xmlns=\"http://www.loc.gov/standards/alto/v3/alto(...TRUNCATED)
true
true
"# 6 Social Welfare\n\nThe British social welfare system comprises the National Health Service, the (...TRUNCATED)
"[{\"model_id\": \"lightonai/LightOnOCR-0.9B-32k-1025\", \"model_name\": \"LightOnOCR\", \"vocab_siz(...TRUNCATED)
204486104
204702331
"Acknowledgment is made for photographs to: General Council\nof British Shipping for National Sea Tr(...TRUNCATED)
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<alto xmlns=\"http://www.loc.gov/standards/alto/v3/alto(...TRUNCATED)
true
true
"Acknowledgment is made for photographs to: General Council of British Shipping for National Sea Tra(...TRUNCATED)
"[{\"model_id\": \"lightonai/LightOnOCR-0.9B-32k-1025\", \"model_name\": \"LightOnOCR\", \"vocab_siz(...TRUNCATED)
204486092
204614323
"242\nBRITAIN: AN OFFICIAL HANDBOOK\nSociety of Film and\nTelevision Arts\nAssistance to\nBritish Fi(...TRUNCATED)
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<alto xmlns=\"http://www.loc.gov/standards/alto/v3/alto(...TRUNCATED)
true
true
"242\n\nBRITAIN: AN OFFICIAL HANDBOOK\n\nThe National Film Theatre, on the south bank of the Thames,(...TRUNCATED)
"[{\"model_id\": \"lightonai/LightOnOCR-0.9B-32k-1025\", \"model_name\": \"LightOnOCR\", \"vocab_siz(...TRUNCATED)
204486095
205332263
"INDUSTRY\n261\nThe British Standards Institution (BSI) is a voluntary non-profit-making\nbody incor(...TRUNCATED)
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<alto xmlns=\"http://www.loc.gov/standards/alto/v3/alto(...TRUNCATED)
true
true
"# INDUSTRY\n\nThe British Standards Institution (BSI) is a voluntary non-profit-making body incorpo(...TRUNCATED)
"[{\"model_id\": \"lightonai/LightOnOCR-0.9B-32k-1025\", \"model_name\": \"LightOnOCR\", \"vocab_siz(...TRUNCATED)
204486111
204752329
"BRITAIN 1995: AN OFFICIAL HANDBOOK\nsignificant contribution to the economy,\ndirectly providing ov(...TRUNCATED)
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<alto xmlns=\"http://www.loc.gov/standards/alto/v3/alto(...TRUNCATED)
true
true
"# BRITAIN 1995: AN OFFICIAL HANDBOOK\n\n## Agriculture, Forestry and Fishing\n\nAbout 75 per cent o(...TRUNCATED)
"[{\"model_id\": \"lightonai/LightOnOCR-0.9B-32k-1025\", \"model_name\": \"LightOnOCR\", \"vocab_siz(...TRUNCATED)
End of preview. Expand in Data Studio

Document OCR using LightOnOCR-0.9B-32k-1025

This dataset contains OCR results from images in NationalLibraryOfScotland/Britain-and-UK-Handbooks-Dataset using LightOnOCR, a fast and compact 1B OCR model.

Processing Details

Configuration

  • Image Column: image
  • Output Column: markdown
  • Dataset Split: train
  • Batch Size: 4096
  • Target Image Size: 1288px (longest dimension)
  • Max Model Length: 8,192 tokens
  • Max Output Tokens: 6,500
  • Temperature: 0.2
  • Top P: 0.9
  • GPU Memory Utilization: 93.0%

Model Information

LightOnOCR is a fast, compact OCR model that excels at:

  • Production Speed - 5.71 pages/second on H100 GPU
  • 🎯 Compact Size - Only 1B parameters
  • 📐 LaTeX formulas - Mathematical notation in LaTeX format
  • 📊 Tables - Extracted and formatted as markdown
  • 📝 Document structure - Hierarchy and layout preservation
  • 🌍 Multilingual - Optimized for European languages
  • 🔤 Flexible vocabulary - 151k/32k/16k token variants

Vocabulary Variants

  • 151k tokens: Full vocabulary, supports all languages
  • 32k tokens: European languages optimized (~12% faster decoding)
  • 16k tokens: European languages optimized (~12% faster decoding)

Dataset Structure

The dataset contains all original columns plus:

  • markdown: The extracted text in markdown format with LaTeX formulas
  • inference_info: JSON list tracking all OCR models applied to this dataset

Usage

from datasets import load_dataset
import json

# Load the dataset
dataset = load_dataset("{output_dataset_id}", split="train")

# Access the markdown text
for example in dataset:
    print(example["markdown"])
    break

# View all OCR models applied to this dataset
inference_info = json.loads(dataset[0]["inference_info"])
for info in inference_info:
    print(f"Column: {info['column_name']} - Model: {info['model_id']}")

Reproduction

This dataset was generated using the uv-scripts/ocr LightOnOCR script:

uv run https://huggingface.co/datasets/uv-scripts/ocr/raw/main/lighton-ocr.py \
    NationalLibraryOfScotland/Britain-and-UK-Handbooks-Dataset \
    <output-dataset> \
    --vocab-size 32k \
    --image-column image \
    --batch-size 4096

Performance

  • Processing Speed: ~2.46 images/second
  • Benchmark Score: 76.1% overall (across diverse document types)
  • Optimization: Native resolution ViT + lightweight decoder

Generated with 🤖 UV Scripts

Downloads last month
8