Dataset Viewer
Auto-converted to Parquet Duplicate
document_id
stringlengths
9
9
page_number
stringlengths
9
9
image
imagewidth (px)
600
600
text
stringlengths
0
4.54k
alto_xml
stringlengths
595
116k
has_image
bool
1 class
has_alto
bool
1 class
markdown
stringlengths
57
8.34k
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
<header>ENVIRONMENTAL PROTECTION</header> Air Pollutants: UK Emissions of Selected Gases from All Sources Million tonnes <img>A line chart titled "Air Pollutants: UK Emissions of Selected Gases from All Sources" showing emissions from 1971 to 1996. The y-axis is labeled "Million tonnes" and ranges from 0 to 10. The ...
[{"column_name": "markdown", "model_id": "nanonets/Nanonets-OCR2-3B", "processing_date": "2025-10-13T17:49:53.367849", "batch_size": 16, "max_tokens": 4096, "gpu_memory_utilization": 0.8, "max_model_len": 8192, "script": "nanonets-ocr2.py", "script_version": "1.0.0", "script_url": "https://huggingface.co/datasets/uv-sc...
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 develop...
[{"column_name": "markdown", "model_id": "nanonets/Nanonets-OCR2-3B", "processing_date": "2025-10-13T17:49:53.367849", "batch_size": 16, "max_tokens": 4096, "gpu_memory_utilization": 0.8, "max_model_len": 8192, "script": "nanonets-ocr2.py", "script_version": "1.0.0", "script_url": "https://huggingface.co/datasets/uv-sc...
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
"<header>Electricity</header>\n\nOperated by SSEB from January 1990\n\n<img>Map of the United Kingdo(...TRUNCATED)
"[{\"column_name\": \"markdown\", \"model_id\": \"nanonets/Nanonets-OCR2-3B\", \"processing_date\": (...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
"<page_number>8</page_number>\nBRITAIN: AN OFFICIAL HANDBOOK\n\nBritain, as in all countries before (...TRUNCATED)
"[{\"column_name\": \"markdown\", \"model_id\": \"nanonets/Nanonets-OCR2-3B\", \"processing_date\": (...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
"Abbey and Priories: p. 1, English Heritage Photo Library; p. 2, Crown Copyright, Historic Scotland;(...TRUNCATED)
"[{\"column_name\": \"markdown\", \"model_id\": \"nanonets/Nanonets-OCR2-3B\", \"processing_date\": (...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)
"[{\"column_name\": \"markdown\", \"model_id\": \"nanonets/Nanonets-OCR2-3B\", \"processing_date\": (...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)
"[{\"column_name\": \"markdown\", \"model_id\": \"nanonets/Nanonets-OCR2-3B\", \"processing_date\": (...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
"<page_number>242</page_number>\nBRITAIN: AN OFFICIAL HANDBOOK\n\nThe National Film Theatre, on the (...TRUNCATED)
"[{\"column_name\": \"markdown\", \"model_id\": \"nanonets/Nanonets-OCR2-3B\", \"processing_date\": (...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 <page_number>261</page_number>\n\nThe British Standards Institution (BSI) is a voluntary n(...TRUNCATED)
"[{\"column_name\": \"markdown\", \"model_id\": \"nanonets/Nanonets-OCR2-3B\", \"processing_date\": (...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\nsignificant contribution to the economy, directly providing o(...TRUNCATED)
"[{\"column_name\": \"markdown\", \"model_id\": \"nanonets/Nanonets-OCR2-3B\", \"processing_date\": (...TRUNCATED)
End of preview. Expand in Data Studio

Document OCR using Nanonets-OCR2-3B

This dataset contains markdown-formatted OCR results from images in NationalLibraryOfScotland/Britain-and-UK-Handbooks-Dataset using Nanonets-OCR2-3B.

Processing Details

Configuration

  • Image Column: image
  • Output Column: markdown
  • Dataset Split: train
  • Batch Size: 16
  • Max Model Length: 8,192 tokens
  • Max Output Tokens: 4,096
  • GPU Memory Utilization: 80.0%

Model Information

Nanonets-OCR2-3B is a state-of-the-art document OCR model that excels at:

  • ๐Ÿ“ LaTeX equations - Mathematical formulas preserved in LaTeX format
  • ๐Ÿ“Š Tables - Extracted and formatted as HTML
  • ๐Ÿ“ Document structure - Headers, lists, and formatting maintained
  • ๐Ÿ–ผ๏ธ Images - Captions and descriptions included in <img> tags
  • โ˜‘๏ธ Forms - Checkboxes rendered as โ˜/โ˜‘
  • ๐Ÿ”– Watermarks - Wrapped in <watermark> tags
  • ๐Ÿ“„ Page numbers - Wrapped in <page_number> tags
  • ๐ŸŒ Multilingual - Supports multiple languages

Dataset Structure

The dataset contains all original columns plus:

  • markdown: The extracted text in markdown format with preserved structure
  • 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 Nanonets OCR2 script:

uv run https://huggingface.co/datasets/uv-scripts/ocr/raw/main/nanonets-ocr2.py \
    NationalLibraryOfScotland/Britain-and-UK-Handbooks-Dataset \
    <output-dataset> \
    --model nanonets/Nanonets-OCR2-3B \
    --image-column image \
    --batch-size 16 \
    --max-model-len 8192 \
    --max-tokens 4096 \
    --gpu-memory-utilization 0.8

Performance

  • Processing Speed: ~0.1 images/second
  • GPU Configuration: vLLM with 80% GPU memory utilization

Generated with ๐Ÿค– UV Scripts

Downloads last month
10