bart-dataset-v2 / README.md
jbduran's picture
Add MIT license to dataset card metadata
0a678b1 verified
|
Raw
History Blame Contribute Delete
4.69 kB
metadata
license: mit
pretty_name: BART Dataset v2
language:
  - en
size_categories:
  - 100K<n<1M
tags:
  - books
  - historical
  - pre-1930
  - ocr
  - institutional-books
  - pretraining
  - deboilerplated
dataset_info:
  features:
    - name: text
      dtype: string

BART Dataset v2

The second version of the BART pretraining corpus, focused on stripping low-quality text — boilerplate and OCR corruption — out of v1.

Documents 149,745 (93.44% of v1)
Characters 106,274,384,672 (89.50% of v1)
Tokens ~24B (estimated)
Shards 473 (one per v1 shard, same basename)
Source BART Dataset v1
Schema single string column text

Lineage — three cumulative filtering stages over the same corpus:

Institutional Books 1.0v1v2v3

How it was made

This phase of filtering targeted boilerplate text and OCR corruption that snuck through Institutional Books' own filters. It removed useless headers, footers and library stamps, alongside gibberish symbols and antiquated characters, through heuristic regex filters.

We also followed Michael Hla's log-prior filter (from Machina Mirabilis / gpt1900), which estimates a text sequence's unconditional log-prior probability by summing token-level log probabilities, then trims improbable or out-of-distribution tokens. Documents were kept inside a moderate GPT-2 token log-prior band of p2.5–p97.5.

Whole books are preserved as rows, and each source shard maps to one output shard of the same basename — so v1's validation shard, shard_00472.parquet, survives as v2's.

The post-1900 physics keyword filter from Hla's original approach was deliberately skipped, because this corpus intentionally keeps texts up to the 1930s.

A note on the result

We expected a major improvement in validation bits-per-byte. Our models actually saw a decline in performance after this phase — because removing the boilerplate removed most of the easy items for a model to replicate. The repetitive headers, footers and stamps were cheap tokens to predict, and stripping them made the remaining corpus genuinely harder. This is worth knowing before you choose v2 over v1: the text is cleaner, but the benchmark number moves the wrong way.

Filtering summary

Stage Rule
Structural printable character ratio >= 0.85; <= 50 OCR artifacts; >= 500 chars raw and clean
Log-prior mean GPT-2 token log-prior within p2.5–p97.5, i.e. -11.039 to -9.832
Granularity whole books kept as rows — no chunking
Skipped post-1900 physics keyword filter (incompatible with a 1930s cutoff)
Removal reason Documents
prior_high 3,991
prior_low 3,838
ocr_artifacts 2,689
Total removed 10,518 (6.56%)
Log-prior threshold calibration

Thresholds were calibrated on a sample of 3,946 raw documents, of which 3,890 survived structural filtering (56 removed as ocr_artifacts). Estimated prior-based removal from that sample: 5.04%.

Percentile Mean log-prior
1 -11.2520
2.5 (low cut) -11.0390
5 -10.8738
10 -10.7243
25 -10.5201
50 -10.3274
75 -10.1492
90 -9.9888
95 -9.9095
97.5 (high cut) -9.8320
99 -9.7501

Full values in _prior/thresholds.json; per-run detail in cleaning_report.json.

Character accounting
Stage Characters
Raw (v1) 118,745,375,871
After structural clean, before prior filter 114,051,142,521
Kept 106,274,384,672
Kept vs. raw 89.50%

Schema and usage

Single string column named text.

from datasets import load_dataset

ds = load_dataset("jbduran/bart-dataset-v2", split="train", streaming=True)
print(next(iter(ds))["text"][:500])

Artifacts: _prior/ (log-prior thresholds and sample stats), cleaning_report.json (full run report).

Citation

Ultimately derived from Institutional Books 1.0:

@misc{institutionalbooks2025,
  title  = {Institutional Books 1.0: A 242B Token Dataset from Harvard Library's
            Collections, Refined for Accuracy and Usability},
  year   = {2025},
  eprint = {2506.08300},
  archivePrefix = {arXiv}
}