python_dataset / README.md
Playfulbug's picture
Update README.md
d8f187f verified
|
Raw History Blame Contribute Delete
2.41 kB
---
license: apache-2.0
language:
- en
tags:
- code
- python
- pretraining
- programming
- pip
- datasets
- gradio
- keras
- pytorch-lightning
- pytest
- transformers
- ternsorflow
- pytorch
- numpy
- pandas
- matpotlib
- django
size_categories:
- 100K<n<1M
pretty_name: Goodman
---
# Python and Docs Training Dataset
A massive, multi-format code and documentation corpus built from 70+ major open-source Python repositories (including the Pip, Keras, Gradio, Transformers, Datasets, and more).
## Dataset Structure
The dataset is processed using exact BPE token chunking (**512-token chunks** with **zero overlap** via OpenAI's `cl100k_base` tokenizer) while preserving original Python indentation, newlines, and `<|file|>path` document boundaries—eliminating boundary duplication and allowing direct fixed-window pre-training without truncation or padding.
Each record in the JSONL and Parquet shards contains:
- **`id`**: Unique sequential identifier for the 512-token chunk (e.g., `combine_chunk_0`).
- **`source`**: Originating combined corpus file (`combine.txt`).
- **`chunk_index`**: Zero-based sequential index preserving repository-grouped ordering (`Docs -> Code`).
- **`token_count`**: Exact BPE token length (`512` tokens per row; `< 512` only on the final EOF tail row if retained).
- **`content`**: Raw, indentation-preserved block of Python code, type stubs, or documentation separated by `<|file|>path` headers.
*(An accompanying flat binary shard `Python_pretrain.bin` stores the same continuous token stream as headerless `uint32` token IDs for zero-copy `np.memmap` training.)*
## Corpus Breakdown
- **Combined Repository Corpus (`combine.txt`)**: **22,551,967 lines** (~850.3 MB / ~220M+ `cl100k_base` tokens) curated across **74 permissive-license (MIT, Apache-2.0, BSD-3) repositories**, with line lengths capped at `999` characters and test/vendored directories excluded.
- **Documentation (`.md`, `.rst`)**: Repository guides, API references, and technical manuals grouped ahead of each library's source tree.
- **Python Source & Type Stubs (`.py`, `.pyi`)**: Production library implementations, core modules, and type annotations across foundational Python, data science, web, and ML frameworks (including CPython, PyTorch, TensorFlow, NumPy, SciPy, Pandas, Django, FastAPI/Starlette, and Transformers).
## License
Distributed under the **Apache-2.0** open-source license.