Datasets:
text
stringlengths 1.25k
27.9M
|
|---|
"Transcribed from the 1913 Chapman & Hall, Ltd. edition by David Price,\r\nemail ccx074@pglaf.org\r\(...TRUNCATED)
|
"Produced by Ron Swanson\r\n\r\n\r\n\r\n\r\n\r\n[Illustration: The Sanitarium at Battle Creek, Mich.(...TRUNCATED)
|
"Produced by Jeroen Hellingman and the Online Distributed\r\nProofreading Team at https://www.pgdp.n(...TRUNCATED)
|
"Produced by Steve Harris, Charles Franks and the Online\r\nDistributed Proofreading Team. HTML vers(...TRUNCATED)
|
"Produced by Gary R. Young\r\n\r\n\r\n\r\n\r\n\r\nTAMBURLAINE THE GREAT,\r\n\r\nIN TWO PARTS.\r\n\r\(...TRUNCATED)
|
"A Concise Dictionary of Middle English\r\n\r\n\r\nBY THE\r\n\r\nREV. A. L. MAYHEW, M.A.\r\nOF WADHA(...TRUNCATED)
|
"THE WENDIGO\r\n\r\nAlgernon Blackwood\r\n\r\n1910\r\n\r\n\r\n\r\n\r\nI\r\n\r\n\r\nA considerable nu(...TRUNCATED)
|
"Transcribed from the 1886 Cassell & Company edition by David Price, email\r\nccx074@pglaf.org\r\n\r(...TRUNCATED)
|
"Der Briefwechsel zwischen\r\n Friedrich Engels und Karl Marx\r\n\r\n Erster Band\r\n\r\n\r\n\r\n\r\(...TRUNCATED)
|
"HARD TIMES\r\n AND\r\n REPRINTED PIECES {0}\r\n\r\n\r\n * * * * *\r\n\r\n By CHARLES DICKENS\r\n\r\(...TRUNCATED)
|
Gutenberg Public Domain Text Corpus
Cleaned snapshot of 57,117 public-domain works from Project Gutenberg obtained through the Gutendex API. Each document is the body text of a single title (authors deceased ≤ 1899), stored as UTF‑8 strings in 33 Zstd-compressed Parquet shards. Boilerplate headers/footers are stripped, whitespace is lightly normalized, and texts shorter than 1,000 characters or with an ASCII ratio below 50 % are removed.
- Documents: 57,117
- Characters: 22,122,271,753 (≈5.5 B tokens using a 4-char heuristic)
- Average length: 387,315 characters
- Median length: 308,079 characters
- 95th percentile length: 1,020,612 characters
- Languages: Primarily English with additional Western European languages passing the ASCII threshold.
Files
shard_00000.parquet…shard_00032.parquet: Book texts in a singletextcolumn, Zstd level 1, row groups of 1,024 rows. Each shard targets ~5 × 10⁸ characters.processing_report.txt(optional): Collection statistics and throughput metrics generated during the download.checkpoint_processed_books.txt(optional): List of Gutenberg IDs already processed for resumable runs.
Dataset Structure
Data Instances
Each row consists of a full book after cleaning:
{
"text": "AMERICAN NOTES FOR GENERAL CIRCULATION ... (full book text)"
}
Data Fields
text(string): UTF-8 encoded body content without Gutenberg boilerplate. Maximum observed length 27,942,687 characters.
Data Splits
No predefined splits. All documents belong to a single training split; define custom splits as needed.
Usage
Hugging Face Datasets
from datasets import load_dataset
dataset = load_dataset(
"parquet",
data_files={"train": "shard_*.parquet"},
split="train"
)
print(len(dataset)) # 57117
print(dataset[0]["text"][:500])
PyArrow
import pyarrow.parquet as pq
table = pq.read_table("shard_00000.parquet")
texts = table.column("text").to_pylist()
Fine-tuning Example (Transformers)
from datasets import load_dataset
from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("EleutherAI/gpt-neo-125M")
dataset = load_dataset("parquet", data_files={"train": "shard_*.parquet"}, split="train")
def preprocess(batch):
return tokenizer(batch["text"], truncation=True, padding="max_length", max_length=1024)
tokenized = dataset.map(preprocess, batched=True, remove_columns=["text"])
Reproducing the Dataset
To recreate this corpus, iterate over https://gutendex.com/books/?author_year_end=1899, download the UTF-8 plain text for each title, strip the standard Project Gutenberg boilerplate markers, collapse repeated whitespace (four or more consecutive newlines → triple newlines), filter out texts shorter than 1,000 characters or with fewer than 50 % ASCII characters, and batch the remaining documents into Parquet shards targeting ~500 M characters each using Zstandard compression. A resumable, high-concurrency Python pipeline with requests, pyarrow, tqdm, and psutil was used for the original collection, but any equivalent tooling can be substituted.
Considerations
Social Impact
Provides an accessible corpus of long-form prose for open research and language-model experimentation, especially for extended context training.
Biases and Limitations
- Dominated by Western canon authors whose works entered the public domain by 1899; social views and representation are limited and dated.
- Minimal language filtering means some non-English texts may be truncated if diacritics trigger the ASCII ratio filter.
- No metadata (title, author, year) accompanies the texts; merge Gutendex metadata separately if required.
- Duplicate editions or translations may appear because no deduplication beyond Gutendex cataloging was performed.
License
Works are believed to be in the public domain in the United States. When redistributing, acknowledge Project Gutenberg and review their terms of use. Ensure compliance with copyright law in your jurisdiction before using the dataset commercially.
Citation
- Project Gutenberg. Project Gutenberg [Data set]. https://www.gutenberg.org/
- Albert, K. (2020). Gutendex [API]. https://gutendex.com/
Maintainers
Dataset curated by the repository maintainer. For questions or issues, please open a ticket where the dataset is hosted or reach out via the provided contact channel.
Loading from Remote Hosting
from datasets import load_dataset
dataset = load_dataset(
"parquet",
data_files={"train": "https://path.to/shards/shard_*.parquet"}
)
Replace https://path.to/shards/ with the hosting URL of the Parquet shards.
- Downloads last month
- 2