meettilavat's picture
Add files using upload-large-folder tool
81f9d19 verified
metadata
pretty_name: Internet Archive Historical Texts - Chunked (0001-1899)
tags:
  - internet-archive
  - historical-texts
  - ocr
  - pre-training
language:
  - en
task_categories:
  - text-generation
size_categories:
  - 100M<n<1B
license: other

Internet Archive Historical Texts - Chunked (0001-1899)

TL;DR

  • 163 million text chunks extracted from historical public-domain documents sourced from the Internet Archive
  • Content dated 0001-1899, sorted by download popularity to prioritize high-quality, frequently accessed materials
  • 2,445 Zstandard-compressed Parquet shards totaling ~217 GB on disk, ~594 billion characters uncompressed
  • Optimized chunk size of ~3,600 characters (target: 4,000) for efficient language model training
  • Cleaned OCR text with disclaimer removal, artifact filtering, and whitespace normalization
  • Primarily English content with traces of other European languages

Quick Stats

Metric Value
Total text chunks ~163,365,120
Total characters ~593,707,573,963 (593.7B)
Parquet shards 2,445
On-disk size (compressed) 216.9 GB
Average chunk size 3,634 chars
Median chunk size 3,808 chars
Chunk size range 102 - 7,928 chars
Target chunk size 4,000 chars
Primary language English (~97%)

Dataset Description

Overview

This dataset contains chunked historical texts from the Internet Archive, preprocessed for language model training. The source materials span from year 0001 to 1899 and were selected based on download counts to ensure quality and relevance. Long documents have been split into manageable chunks of approximately 4,000 characters each, making the dataset ideal for:

  • Pre-training language models on historical English text
  • Fine-tuning models for historical document understanding
  • Historical NLP research and analysis
  • OCR quality assessment and improvement

Chunk Statistics

Percentile Chunk Size (chars)
P25 3,497
P50 (Median) 3,808
P75 3,948
P90 3,987
P95 3,996
P99 4,002

The distribution shows most chunks cluster around the 4,000 character target, with a small tail of shorter chunks from the end of documents or naturally brief sections.

Data Format

Each Parquet shard contains:

  • Column: text (string)
  • Row group size: 1,024 rows
  • Compression: Zstandard (level 3)
  • Typical chunks per shard: 60,000-70,000

Files are named sequentially: shard_00000.parquet through shard_02444.parquet

Preprocessing Pipeline

The dataset underwent extensive cleaning to maximize quality:

  1. Disclaimer Removal: Stripped Internet Archive, Google Books, and JSTOR boilerplate
  2. OCR Artifact Filtering: Removed page numbers, annotations, and noise patterns
  3. Text Normalization: Standardized whitespace, fixed common OCR errors
  4. Quality Filters:
    • Minimum chunk length: 100 characters
    • Chunks split at natural paragraph boundaries when possible
    • Aggressive deduplication of boilerplate content
  5. Chunking Strategy:
    • Target size: 4,000 characters
    • Smart splitting on paragraph breaks to preserve context
    • Large paragraphs split on sentence boundaries
    • Minimum chunk size enforced to avoid fragmentary text

Content Examples

The following are real, unedited samples from the dataset showing the variety of content and text quality:

Example 1: Literary - Historical Poetry (Edmund Spenser's Epithalamion)

Ring ye the bells, ye yong men of the tow no.
And leave your wonted labors for this day :
This day is holy - do ye write it downe,
That ye for ever it remember may, -
This day the sun is in his chiefest hight,
With Barnaby the bright.
From whence declining daily by degrees,
He somewhat loseth of his heat and light,
When once the Crab behind his back he see.«
But for this time it ill -ordained was
POEMS OF LOVE.

To choose the longest day in all the yeare,
A.nd shortest night, when longest fitter
weare ;
Yet never day so long but late would passe.
Ring ye the hells, to make it weare away,
And bonfires make all day ;
And daunce about them, and about them sing,
That all the woods may answer, and theyr echo ring.

Example 2: Literary Criticism - Analysis of Historical Writing Style

Often does he declare that he purposely varies his diction,
lest the reader should be disgusted by its sameness; anx-
iously careful to avoid repetition, even in the structure of his
phrases. It may be said, however, that generally, in his
earlier works, (for he was apparently very young when he
wrote his History of the Kings,) his style is rather laboured ;
though, perhaps, even this may have originated in an anxiety
that his descriptions should be full ; or, to use his own ex-
pression, that posterity should be wholly and perfectly in-
formed. That his diction is liighly antithetical, and his
sentences artfully poised, will be readily allowed; and per-
haps the best index to his meaning, where he may be occa-
sionally obscure, is the nicely-adjusted balance of his phrase.
That he gradually improved his style, and in riper years,
where he describes the transactions of his own times, became
terse, elegant, and polished, no one will attempt to dispute.

Example 3: Religious/Historical - Biography of Father Gallitzin

There was one person, much nearer the scene of action,
who alone appears to have had the necessary force and firm-
ness, the indomitable courage, and the all-mastering will to
face and to thoroughly conquer the storm the others dared
not meet; it was the place for Father Gallitzin's immense
faith and magnificent spirit; he alone appears endowed with
that lion like nature, fortified by long trials and experienced
in the wickedness of rebellious man,-, inspired and strength-
ened beyond all human force by the battle cry forever in his
ears : God wills it, which fears not, single handed, to meet a
legion of enemies. But a superior wisdom so ordered it that
the evil thing should have its day and run its course.

Example 4: Historical Legal Text - Irish and European Land Tenure

The Irish, tenures throw considerable light upon many ob-
onThoseof* scure points in the tenures of the rest of Europe in medieval
Europe, times ; for instance there can be no doubt that hereditary tenan-
cies, the " Erbpacht" of the Germans, and the Emphyteusis of
the later Roman Empire, co-existed all through the middle ages
in Italy, Germany, France, and Flanders, with a system of
villenage analogous to the Irish Fuidirship. Marini and
Mabillon mention tenants of the former class under the name
of libellarii from the sixth to the thirteenth centuries;351
they were numerous also in Germany in the ninth century.

The greater part of the occupiers of land in France in the ninth
century were in the position of Ceiles, holding by limited ser-
vice, is proved by documents forbidding the raising of rents.
The serfs proper we know held their land in the greater part
of Germany as an inheritance from the thirteenth century.355

Example 5: Biographical - Judge Sir John Williams

{)ublic at large became aware of his match-
ess talents in that branch of an advocate's
duty. Professional success followed "the
Queen's trial." Mr. Williams then got into
Parliament, sitting for Lincoln, Winchel-
sea, and Ilchester, on the Liberal interest,
and distinguished his Parliamentary career
by his advocacy of Chancery Reform. A
change of the Ministry at length procured
for him that professional position to which
he had been for some years fairly entitled.
He received a silk gown, and soon after
the accession of William IV her Majesty,
now Queen Dowager, appointed him her
Attorney-General. In Feb. 1834 he be-
came one of the Barons of the Exche-
quer, and having sat in that court only
one term was transferred to the Court of
King's Bench, where he remained until
the period of his lamented death.

Example 6: Technical - Railroad Coupler Specifications (1899)

3. To propose specifications for couplers. This part of the subject has received
very careful consideration. It has been difficult to reconcile the diametrically
opposite opinions which have been expressed by various railroad men and manu-
facturers. It is believed, however, that rigid specifications and tests will do much
to weed out the poorer makes of couplers at present being furnished, and it is rec-
ommended that in the future all couplers be purchased subject to the provisions of
the following standard specifications and tests.

A. B. &• C. R. R. CO.
Specifications for M. C. B. Automatic Car Couplers.

After September 1, 1899, aH M. C. B. automatic car couplers purchased by or
used in the construction of cars for the above-named company must meet the require-
ments of the following specifications.

Example 7: Theological - Church Doctrine Discussion

teacheth, that in this mystery there is not in the bread a substantial
but a sacramental change, according to the which the outward ele-
ments take the name of what they represent, and are changed in
such a sort that they still retain their former natural substance.
"The bread," saith he, "is made worthy to be honoured with the
name of the Flesh of Christ by the consecration of the priest, yet the
Flesh retains the proprieties of its incorruptible nature, as the bread
doth its natural substance. Before the bread be sanctified, we call
it bread; but, when it is consecrated by the divine grace, it deserves
to be called the Lord's Body, though the substance of the bread still
remains'."' When Bellarmine could not answer this testimony of
that great doctor, he thought it enough to deny that this epistle is
S. Chrysostom's'*: but both he and Possevin do vainly contend that
it is not extant among the works of Chrysostom.

Example 8: Literary - 19th Century Novel (Character Description)

Had she been less evenly balanced, had her
soul been less true, her heart less tender, she
might in time have frozen the woman complete!),
and crystallized into the artiste only - or - but
to think of Judith Moore sullying her wings is
sacrilege.

She was full of womanly tenderness and
womanly vanities. She had a thousand little
tricks of coquetry and as many balms to care
their smart. She took a good deal of satis fac
tion out of her pretty gowns and her finger
nails, and the contemplation of her little feet
becomingly shod had been known to dry her
tears. She was essentially the woman of the
past, the woman who created a " type " distinct
from man; the womanly woman, not the hybrid
creature of modern cultivation ; the woman of
romance.

Example 9: Historical Records - Marriage Registry (OCR artifacts visible)

Michael Darey and Aan Cusack.
George Omensetter and Margaret Sainer.
Wilhehn Denzel, wid% and Elizabeth Jansou.
Thomas Butbis and Pattj" Post.
Peter Lengfelder and Barbara Birkenbeiler.
Andrew McFarlene, wid% and Sarah Lakorn, wid.
Carl Himmelreich and Susanna Funck.
John Tallentire and Elizabeth Shade.
Joseph Bolton and Sarah Hofty.
George Fried. Wendt and Sarah Charlotte Eichbaum.
Jacob Chur, wid^ and Wendeling Margar. Dorneck.
Adam Hyner and Elizabeth Wears (Wehrs).
Gideon Cox and Susanna Shevely.

Note: "wid%" artifacts are OCR errors for "widower" or "widow"

Example 10: Reference/Directory - Business Listings (1899)

STORES, OFFICES AND LOFTS.
BUFFALO, N Y. - Wood & Bradne/
Mutual Life Bldg. Buffalo, have plans In
progress for remodeling the 5-sty brick
business block, 35x200, to include stores,
offices, arcade billiard and pool room, at
319 Main st, through from Main to Wash-
ington sts. for Dr. and Conrad E. Witt-
laufer, 1234 Delaware av, Buffalo, owne'\
ROCHESTER, N. Y. - Gordon & Madden.
300 Sibley Block, Rochester, have work-
ing plans in progress for addition to the
2-sty brick and tile School No. 27, in Cen-
tral Park, cor 1st st, for the City of Roch-
ester, Board of Education, J. S. Mullen, 37
Exchange st, Rochester, owner. Cost, $16,000.

Example 11: Historical Encyclopedia - Roman Emperor Diocletian

DiocLrnixcs. Caios Valerius Jovtus, a cele-
brated Roman emperor, born of an obscure family ia
Dalmatia, at the town of Dioclea or Doclea, from
which town be derived bis first name, which was
probably Doclea, afterward lengthened to the more
harmonious Greek form of Dioclea, and at length,
after his accession to the empire, to the Roman form
of Diocleti&nus. He likewise, on this occasion, as-
sumed the patrician name of Valerius. Some, how-
ever, make him to nave been born at Salona. Hie
birth year also i» differently given. The common
account says 245 A.D., but other statements make
bin tea years older. He waa first a common soldier,
and by merit and success gradually rose to rank.

Example 12: Poetry - Personification of Winter

Some call me their foe, but I hone and intend
To make it appear, I am truly your friend ;
You may think mv deportment is furly and bluff,
But I mean it for good when I handle you rough.

My fnow when descending it covers your fields,
The beft of manuring confcftdly yields.
While its fmooth fhiuing furface aiiords you a fpace
For your fleighs and your fledges to drive at full chace.

My ice, how reviving in heat does it feem,
It cools all your liquors and fwteten.s your cream ;
On ^Etna's tall fummit 'lis gadier'd, and thence
O'er Italy does its refrefhment difpeuf*.

Note: This example shows period spelling conventions and some OCR artifacts (fnow=snow, fpace=space)

Usage

Loading the Dataset

Using PyArrow (Recommended)

import pyarrow.dataset as ds
import pyarrow.compute as pc

# Load all shards as a single dataset
dataset = ds.dataset("shard_*.parquet", format="parquet")

# Efficient streaming with multi-threading
scanner = dataset.scanner(
    columns=["text"],
    use_threads=True,
    batch_size=4096
)

for batch in scanner.to_batches():
    texts = batch["text"].to_pylist()
    # Process texts...

Using Pandas

import pandas as pd

# Load a single shard
df = pd.read_parquet("shard_00000.parquet")
print(df.head())

# Load all shards (requires sufficient RAM)
import glob
files = sorted(glob.glob("shard_*.parquet"))
df = pd.concat([pd.read_parquet(f) for f in files])

Using HuggingFace Datasets

from datasets import load_dataset

# Load from local path
dataset = load_dataset("parquet", data_files="shard_*.parquet")

# Iterate efficiently
for example in dataset["train"]:
    text = example["text"]
    # Process text...

Computing Statistics

Quick script to verify the dataset:

import pyarrow.dataset as ds
import pyarrow.compute as pc

dataset = ds.dataset("shard_*.parquet", format="parquet")
scanner = dataset.scanner(columns=["text"], use_threads=True)

count = 0
total_chars = 0

for batch in scanner.to_batches():
    lengths = pc.utf8_length(batch["text"])
    count += batch.num_rows
    total_chars += pc.sum(lengths).as_py()

print(f"Chunks: {count:,}")
print(f"Characters: {total_chars:,}")
print(f"Avg size: {total_chars // count:,} chars")

Language Distribution

Based on sampling 200 documents across the dataset using langdetect:

Language ISO Code Percentage
English en ~97%
French fr ~1%
Dutch nl ~0.5%
Other European various ~1.5%

Known Limitations

  • OCR Errors: Despite cleaning, some OCR artifacts remain, especially in older or lower-quality scans
  • Historical Spelling: Texts preserve original spelling and grammar, which may differ from modern conventions
  • Content Bias: Download-based sorting skews toward popular topics (legal texts, classics, frequently referenced works)
  • No Metadata: Author, title, publication year, and other bibliographic data are not included in the chunks
  • Language Imbalance: Heavily English-dominant due to Internet Archive's collection composition
  • Chunk Boundaries: While optimized for readability, some chunks may split mid-thought

Ethical Considerations

  • All source materials are from Internet Archive's public domain collection
  • Users should verify the public domain status in their jurisdiction before commercial use
  • Historical texts may contain outdated or offensive viewpoints that do not reflect modern values
  • Recommended for research and model training; review outputs before production deployment

Citation

If you use this dataset, please cite:

@dataset{internet_archive_chunked_1899,
  title={Internet Archive Historical Texts - Chunked (0001-1899)},
  year={2025},
  publisher={Internet Archive},
  note={Processed and chunked from Internet Archive public domain texts dated 0001-1899, sorted by download count}
}

Please also acknowledge the Internet Archive for the source materials:

@misc{internetarchive,
  title={Internet Archive},
  howpublished={\url{https://archive.org}},
  note={Accessed: 2025}
}

Technical Details

Shard Creation

  • Row group size: 1,024 chunks per group
  • Compression: Zstandard level 3 (balance of speed and compression)
  • Target shard size: ~250M characters per shard
  • Write batch size: 10,000 rows

Performance Tips

  • Enable Arrow memory mapping for zero-copy reads on supported filesystems
  • Use use_threads=True in PyArrow scanners to leverage multi-core CPUs
  • Stream batches with to_reader() instead of materializing entire dataset
  • For sampling, use pc.utf8_slice_codeunits() to avoid loading full multi-megabyte chunks

Storage Recommendations

  • SSD/NVMe: Recommended for training pipelines
  • Compression ratio: ~2.7x (594GB uncompressed → 217GB compressed)
  • Random access: Each shard is independently readable

Version History

  • v1.0 (2025): Initial release with 2,445 shards, 163M chunks, 594B characters

License

This dataset contains materials from the Internet Archive's public domain collection. While the source materials are in the public domain, users should:

  • Verify the legal status of specific works in their jurisdiction
  • Comply with Internet Archive's Terms of Use
  • Review individual works for any usage restrictions

The preprocessing scripts and this dataset compilation are provided as-is for research and educational purposes.

Suitability for Historical Language Modeling

Would this dataset create an LLM representative of a person from 1899?

Short answer: Partially, with significant caveats.

Strengths:

  • Authentic historical vocabulary and phrasing - The texts use period-appropriate language, spelling conventions, and sentence structures
  • Diverse subject matter - Includes legal documents, literature, religious texts, biographical materials, scientific works, poetry, and commercial records
  • Representative of educated/literate discourse - Reflects how educated people wrote in the 19th century and earlier
  • Rich contextual knowledge - Contains historical events, social norms, and cultural references from the period

Limitations:

  • Not conversational/spoken language - These are published works, not everyday speech or personal correspondence
  • Heavy OCR artifacts - Despite cleaning, remnants like "wid%" (widow), formatting errors, and garbled text persist
  • Bias toward formal/academic writing - Overrepresents legal texts, religious works, and scholarly materials
  • Limited personal voice - Lacks diaries, letters, informal notes that would reflect casual 1899 communication
  • Skewed by download popularity - Popular classics and reference works are overrepresented
  • Temporal mixing - Contains texts from across 1,900 years (0001-1899), not just the 1890s

Text Quality Assessment:

From sampled chunks, the dataset contains:

  1. Legal/Administrative (30-40%) - Court cases, legislation, property records, business directories
  2. Literary (20-30%) - Poetry (Shakespeare, Spenser), novels, historical narratives
  3. Religious/Theological (15-20%) - Sermons, biblical commentary, church records
  4. Historical/Biographical (10-15%) - Historical accounts, biographical sketches, chronicles
  5. Technical/Reference (10-15%) - Specifications, mathematical tables, encyclopedic entries
  6. Marriage/Death Records (5-10%) - Lists of names and vital statistics

OCR Quality Issues Observed:

  • Formatting artifacts: "wid%" for widow, "wull" for will, "tke" for the
  • Table data corruption (numbers in columns)
  • Character substitution: "honour" (correct historical spelling vs. OCR error - hard to distinguish)
  • Spacing issues and paragraph breaks

Recommendation for Creating a "1899 Person" LLM:

This dataset would be most effective when:

  1. Combined with other sources:

    • Personal letters and diaries from 1890s
    • Newspaper articles (more conversational)
    • Period fiction dialogue
    • Oral history transcriptions
  2. Used with heavy post-processing:

    • Additional OCR error correction
    • Filtering to focus on 1880s-1899 materials only
    • Weighting toward more conversational genres
    • Removing heavily corrupted chunks
  3. Contextualized as formal written English:

    • Best for modeling formal 19th-century writing style
    • Good for historical knowledge and cultural references
    • Not ideal for casual conversation simulation

Final Assessment: This dataset provides excellent historical language patterns and knowledge but would produce an LLM that writes like a 19th-century author or scholar, not necessarily how an average person from 1899 would speak. For that, you'd need substantial supplementary data from informal sources.

The dataset's value lies in teaching historical vocabulary, grammatical structures, cultural context, and the formal register of 19th-century English - making it a strong foundation that requires augmentation for truly representative historical persona modeling.

Contact & Contributions

For issues, suggestions, or questions about this dataset:

  • Check the Internet Archive for source material questions
  • Report data quality issues through the dataset repository

Acknowledgments

  • Internet Archive for preserving and providing access to historical texts
  • PyArrow team for high-performance data processing tools
  • The open-source community for OCR and text processing tools