Datasets:
document_id stringclasses 233
values | page_number int32 1 618 | file_identifier stringlengths 9 9 | image imagewidth (px) 600 600 | text stringlengths 0 10.9k | alto_xml stringlengths 714 431k | has_image bool 1
class | has_alto bool 1
class | document_metadata stringclasses 219
values | has_metadata bool 1
class | exam_type stringclasses 106
values | exam_year stringdate 1888-01-01 00:00:00 1963-01-01 00:00:00 | exam_reference stringclasses 20
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
143486138 | 1 | 143116563 | Circular No. 20.
Scottish Education Department;
Letters should be addressed—
“ The Secretary,
Whitehall,
London, S.W.l.”
SCOTTISH EDUCATION DEPARTMENT,
WHITEHALL,
LONDON, S.W.l.
loth January 1920.
SIR,
I AM to remind you that it is the duty of every Education
Authority to prepare and submit for the approval of the
Depa... | <?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/c_125883965/i_143486138/168499299.23.pdf</fileName></sourceImageInformation><OCRProcessing ID="IdOcr"><ocrProcessingStep><... | true | true | Scottish Education Department - 1920 - GEB.16 | true | Scottish Education Department | 1920 | GEB.16 | |
143486138 | 2 | 143116575 | 2
receive, as soon as may be, and if possible not later than
March 3Jst, a formal statement showing clearly —
(a) The number of children (if any) residing beyond a radius
of three miles from the nearest school in the various
parts of your Authority’s area, and the provision
which is being made, or has been made, for th... | <?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/c_125883965/i_143486138/168499299.23.pdf</fileName></sourceImageInformation><OCRProcessing ID="IdOcr"><ocrProcessingStep><... | true | true | Scottish Education Department - 1920 - GEB.16 | true | Scottish Education Department | 1920 | GEB.16 | |
143486138 | 3 | 143116587 | 3
Authority of his district for such financial assistance as he may
require towards maintenance and towards payment of fees, and
it will be necessary, if the scheme does not already provide
for the 'granting of such assistance, to amend it accordingly
forthwith.
I have the honour to be,
Sir,
Your obedient Servant,
To t... | <?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/c_125883965/i_143486138/168499299.23.pdf</fileName></sourceImageInformation><OCRProcessing ID="IdOcr"><ocrProcessingStep><... | true | true | Scottish Education Department - 1920 - GEB.16 | true | Scottish Education Department | 1920 | GEB.16 | |
143486138 | 4 | 143116599 | <?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/c_125883965/i_143486138/168499299.23.pdf</fileName></sourceImageInformation><OCRProcessing ID="IdOcr"><ocrProcessingStep><... | true | true | Scottish Education Department - 1920 - GEB.16 | true | Scottish Education Department | 1920 | GEB.16 | ||
143486136 | 1 | 143116443 | "0!PMi\nCrOfS -23,\nCircular No. 3.\nSCOTTISH EDUCATION DEPARTMENT,\n8th April, 1919.\nEDUCATION (SC(...TRUNCATED) | "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<alto xmlns=\"http://www.loc.gov/standards/alto/v3/alto(...TRUNCATED) | true | true | Education (Scotland) Act, 1918 - 1919 - GEB.16 | true | Education (Scotland) Act, 1918 | 1918 | GEB.16 | |
143486136 | 2 | 143116455 | "2\nuntil 16th May, on and after which day the new Authorities\nwill assume responsibility in accord(...TRUNCATED) | "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<alto xmlns=\"http://www.loc.gov/standards/alto/v3/alto(...TRUNCATED) | true | true | Education (Scotland) Act, 1918 - 1919 - GEB.16 | true | Education (Scotland) Act, 1918 | 1918 | GEB.16 | |
143486136 | 3 | 143116467 | "3\nAPPENDIX I.\nOrder made by the Scottish Education Department\non 20th February, 1919, fixing App(...TRUNCATED) | "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<alto xmlns=\"http://www.loc.gov/standards/alto/v3/alto(...TRUNCATED) | true | true | Education (Scotland) Act, 1918 - 1919 - GEB.16 | true | Education (Scotland) Act, 1918 | 1918 | GEB.16 | |
143486136 | 4 | 143116479 | "Section 32\nSection 33\nThe First Sche-\ndule.\nSCHEDULE—continued.\nSubsection (1) so\nfar as re(...TRUNCATED) | "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<alto xmlns=\"http://www.loc.gov/standards/alto/v3/alto(...TRUNCATED) | true | true | Education (Scotland) Act, 1918 - 1919 - GEB.16 | true | Education (Scotland) Act, 1918 | 1918 | GEB.16 | |
143486136 | 5 | 143116491 | "5\nAPPENDIX II.\nOrder made by the Scottish Education Department\non 18th March, 1919, fixing Appoi(...TRUNCATED) | "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<alto xmlns=\"http://www.loc.gov/standards/alto/v3/alto(...TRUNCATED) | true | true | Education (Scotland) Act, 1918 - 1919 - GEB.16 | true | Education (Scotland) Act, 1918 | 1918 | GEB.16 | |
143486136 | 6 | 143116503 | "SCHEDULE—continued.\nSection 9\nSection 10\nSection 11\nSection 12\nSection 13\nSection 20\nSecti(...TRUNCATED) | "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<alto xmlns=\"http://www.loc.gov/standards/alto/v3/alto(...TRUNCATED) | true | true | Education (Scotland) Act, 1918 - 1919 - GEB.16 | true | Education (Scotland) Act, 1918 | 1918 | GEB.16 |
Scottish School Exam Papers Dataset
Dataset Description
This dataset contains digitised Scottish school examination papers from the National Library of Scotland's (NLS) digital collections. The papers represent historical educational assessment materials that have been processed with Optical Character Recognition (OCR) to extract text content alongside the original page images.
Dataset Summary
- Source: National Library of Scotland - Scottish School Exam Papers
- Format: Image-text pairs with OCR output
- Processing: Converted from ALTO XML and JPG images to Hugging Face dataset format
- Contents: Historical Scottish school examination papers with both scanned images and extracted text
Dataset Structure
Data Fields
Each record in the dataset contains the following fields:
document_id(string): Unique identifier for the exam paper documentpage_number(int): Sequential page number within the document (1, 2, 3, etc.)file_identifier(string): Original file identifier from the NLS datasetimage(image): Scanned image of the exam paper pagetext(string): OCR-extracted text from the pagealto_xml(string): Raw ALTO XML containing detailed OCR informationhas_image(bool): Whether the page has an associated image filehas_alto(bool): Whether the page has associated ALTO OCR datadocument_metadata(string): Full metadata description from inventory (e.g., "Leaving Certificate - 1888 - P.P.1888 XLI")has_metadata(bool): Whether metadata is available for this documentexam_type(string): Type of examination (e.g., "Leaving Certificate", "Scottish Education Department")exam_year(string): Year of the examination (extracted from metadata)exam_reference(string): Reference number from the metadata (if available)
Data Statistics
The dataset includes examination papers with varying levels of OCR quality and completeness. Some pages may have images without corresponding OCR text, typically due to:
- Poor scan quality
- Handwritten content
- Complex layouts or mathematical notation
- Degraded original documents
Usage
Loading the Dataset
from datasets import load_dataset
# Load the dataset
dataset = load_dataset("davanstrien/Scottish-School-Exam-Papers")
# Access the data
for example in dataset['train']:
print(f"Document: {example['document_id']}")
print(f"Page: {example['page_number']}")
print(f"Text preview: {example['text'][:200]}...")
# Display image if needed
example['image'].show()
break
Filtering for Complete Records
To work only with pages that have both images and OCR text:
# Filter for complete records
complete_pages = dataset.filter(lambda x: x['has_image'] and x['has_alto'])
print(f"Complete pages: {len(complete_pages)}")
Working with ALTO XML
The ALTO XML contains detailed OCR information including:
- Text positioning and layout
- Confidence scores
- Character-level bounding boxes
import xml.etree.ElementTree as ET
# Parse ALTO XML for detailed OCR information
def parse_alto_details(alto_xml):
root = ET.fromstring(alto_xml)
ns = {'alto': 'http://www.loc.gov/standards/alto/v3/alto.xsd'}
# Extract text lines with positioning
for textline in root.findall('.//alto:TextLine', ns):
line_text = []
for string_elem in textline.findall('./alto:String', ns):
content = string_elem.get('CONTENT', '')
if content:
line_text.append(content)
if line_text:
print(' '.join(line_text))
Dataset Creation
Source Data
The original data comes from the National Library of Scotland's digitisation programme, as part of their 'One Third Digital' strategic aim. These items were digitised as part of a a larger project to digitise all Scottish exam papers to 2006. The exam papers represent various subjects, years, and educational levels from Scotland's educational history.
Processing Pipeline
Original Format: The source data consists of:
- High-resolution JPG scans of exam papers
- ALTO XML files containing OCR output
- METS metadata files with page ordering information
- Inventory CSV with document-level metadata
Conversion Process: Using the custom
convert_scottish_exams.pyscript:- Parsed METS XML files to extract proper page ordering
- Paired image files with their corresponding ALTO XML
- Extracted plain text from ALTO XML while preserving line breaks
- Mapped file identifiers to sequential page numbers (1, 2, 3, etc.)
- Extracted exam type and year from metadata descriptions
- Preserved all metadata associations and added structured fields
Considerations for Using this Data
Historical Context
These examination papers represent historical educational practices and may contain:
- Outdated terminology or perspectives
- Historical biases in educational content
- References to historical events and contexts
OCR Quality
The quality of text extraction varies based on:
- Original document condition
- Print quality and typography
- Presence of handwritten annotations
- Mathematical or scientific notation
Recommended Use Cases
- Historical education research
- OCR system evaluation and improvement
- Educational content analysis
- Digital humanities research
- Training data for historical document processing
Additional Information
Licensing
Please refer to the National Library of Scotland's terms of use for the original data. Users should comply with NLS's licensing terms when using this dataset.
Citation
If you use this dataset, please cite both the original source and this Hugging Face dataset:
@misc{nls_scottish_exams,
title={Scottish School Exam Papers},
author={National Library of Scotland},
howpublished={\url{https://data.nls.uk/data/digitised-collections/scottish-exams/}},
}
### Acknowledgments
Dataset converted to Hugging Face format by [davanstrien](https://huggingface.co/davanstrien)
- Downloads last month
- 47