Skip to content
RAG Repo

Standardized Project Gutenberg Corpus (SPGC)

The Standardized Project Gutenberg Corpus (SPGC) takes the raw Project Gutenberg collection, tens of thousands of public-domain books, and turns it into something you can analyse straight away. Project Gutenberg's own files carry inconsistent formatting and licence boilerplate wrapped around each text; SPGC strips those headers and footers, applies consistent formatting, and attaches tidy metadata (author, title, language, subject) plus word and token counts (a token is roughly a word or word-piece) for every title. The point is reproducibility: everyone working from SPGC starts from the same clean, uniformly processed snapshot.

There are two ways to get it. The processing code lives on GitHub under the `pgcorpus` project, so you can run the pipeline yourself and regenerate the corpus from a current Gutenberg mirror. Or you can download a prebuilt release from Zenodo, an open research archive, which gives you the counts, cleaned text, and metadata without running anything. The cleaned plain text (`TXT`) and the metadata and count tables (`CSV`) are exactly the shape you want for feeding a chunking and embedding pipeline.

For RAG, SPGC suits literary and historical projects: a question-answering system over classic fiction and non-fiction, a research tool for the digital humanities, or any corpus where you want long-form, well-structured prose without writing your own cleaning code. The consistent per-book metadata also makes it easy to filter by language or subject before you index.

The main caveats are about coverage and currency. Everything here is public domain, which skews the collection towards older works: expect dated language, historical attitudes, and few titles from the last several decades. A snapshot is frozen at the time it was built, so regenerate from GitHub if you need recently added books. On licensing you get a clean split: the book content is public domain, so you can reuse it commercially with no attribution or share-alike obligation, while the processing code is MIT-licensed. If you prefer to pull books live rather than as a fixed corpus, Project Gutenberg's own site and the Gutenberg API cover that, but for reproducible bulk work SPGC saves you the cleanup.

public-domainbooksliteratureresearchcleaned

Related sources