File size: 9,651 Bytes
da0cc47
afbc6cf
9f9829f
da0cc47
 
 
 
 
 
 
 
 
61d4a5b
da0cc47
 
afbc6cf
 
da0cc47
 
afbc6cf
da0cc47
 
afbc6cf
 
 
 
 
 
 
 
da0cc47
afbc6cf
 
da0cc47
afbc6cf
 
 
da0cc47
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
afbc6cf
 
da0cc47
afbc6cf
 
da0cc47
 
afbc6cf
da0cc47
afbc6cf
da0cc47
afbc6cf
 
 
da0cc47
afbc6cf
 
 
 
da0cc47
afbc6cf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
da0cc47
 
 
afbc6cf
 
da0cc47
 
 
5793349
afbc6cf
 
da0cc47
 
afbc6cf
da0cc47
afbc6cf
 
da0cc47
afbc6cf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61d4a5b
afbc6cf
 
da0cc47
afbc6cf
da0cc47
afbc6cf
 
 
 
 
 
da0cc47
afbc6cf
 
 
 
 
da0cc47
afbc6cf
 
da0cc47
afbc6cf
da0cc47
afbc6cf
 
 
da0cc47
afbc6cf
 
 
da0cc47
9f9829f
 
 
 
 
da0cc47
afbc6cf
da0cc47
afbc6cf
 
 
 
 
 
 
 
 
 
da0cc47
afbc6cf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
---
pretty_name: Personal Codex Model Training Corpus
license: mit
language:
- code
annotations_creators:
- no-annotation
language_creators:
- found
source_datasets:
- original
size_categories:
- 10K<n<100K
task_categories:
- text-generation
task_ids:
- language-modeling
tags:
- code
- text
- source-code
- code-completion
- code-generation
- causal-language-modeling
- continued-pretraining
- fine-tuning
- coding-assistant
- software-engineering
- repository-level
- multilingual-code
- deduplicated
- provenance-aware
- parquet
- datasets
- typescript
- python
- javascript
configs:
- config_name: default
  data_files:
  - split: train
    path: data/train-*.parquet
  - split: valid
    path: data/valid-*.parquet
dataset_info:
  features:
  - name: text
    dtype: string
  - name: repo
    dtype: string
  - name: path
    dtype: string
  - name: language
    dtype: string
  - name: sha
    dtype: string
  - name: chunk_index
    dtype: int32
  - name: n_tokens
    dtype: int32
  splits:
  - name: train
    num_examples: 15226
    num_bytes: 46393834
  - name: valid
    num_examples: 3135
    num_bytes: 9543076
---

# Personal Codex Model Training Corpus

## Overview

Personal Codex Model Training Corpus is a provenance-aware, repository-level dataset for causal
language modeling, code completion, continued pretraining, and coding assistant adaptation. It is
built from source files present in local Git repository checkouts at a defined collection point.

The dataset prioritizes broad, authentic software-engineering coverage while retaining enough
metadata to audit every emitted chunk. It is not an instruction dataset, benchmark, or collection
of verified solutions. Each record represents source text as it existed in a repository checkout,
after filtering, chunking, secret screening, and global deduplication.

## Dataset profile

| Metric | Value |
| --- | ---: |
| Total examples | 18,361 |
| Training examples | 15,226 |
| Validation examples | 3,135 |
| Emitted lines | 1,305,187 |
| Nonblank emitted lines | 1,153,093 |
| Approximate lexical tokens | 12,472,126 |
| UTF-8 source text | 50.5 MiB |
| Source files with retained chunks | 7,913 |
| Repositories with retained rows | 58 |

Line, byte, and token totals measure emitted training chunks. The configured chunk overlap can
repeat text at chunk boundaries. These figures describe training volume, not unique repository
lines of code or model-tokenizer counts.

## Language and format distribution

The `language` value is assigned from a controlled extension and exact-filename mapping. Markdown,
configuration, schema, and build-system files are retained because they are part of real software
engineering workflows and frequently contain executable examples or machine-consumed structure.

| Language or format | Examples | Share |
| --- | ---: | ---: |
| Markdown | 6,559 | 35.7% |
| TypeScript | 6,170 | 33.6% |
| JSON | 2,828 | 15.4% |
| Python | 1,532 | 8.3% |
| XML Schema | 354 | 1.9% |
| JavaScript | 218 | 1.2% |
| CSS | 144 | 0.8% |
| YAML | 112 | 0.6% |
| MDX | 93 | 0.5% |
| SQL | 69 | 0.4% |
| Shell | 60 | 0.3% |
| HTML | 53 | 0.3% |
| Git Ignore | 44 | 0.2% |
| Text | 31 | 0.2% |
| Swift | 15 | 0.1% |
| TeX | 14 | 0.1% |
| Java | 13 | 0.1% |
| TOML | 9 | 0.0% |
| Dockerfile | 6 | 0.0% |
| Git Attributes | 4 | 0.0% |
| Web Manifest | 4 | 0.0% |
| Prettier Ignore | 4 | 0.0% |
| Prettier | 4 | 0.0% |
| Docker Ignore | 3 | 0.0% |
| XML | 3 | 0.0% |
| EditorConfig | 2 | 0.0% |
| INI | 2 | 0.0% |
| Handlebars | 2 | 0.0% |
| Batch | 2 | 0.0% |
| Procfile | 1 | 0.0% |
| JSON Lines | 1 | 0.0% |
| Runpod Ignore | 1 | 0.0% |
| Prisma | 1 | 0.0% |
| ESLint Ignore | 1 | 0.0% |
| Makefile | 1 | 0.0% |
| SCSS | 1 | 0.0% |

## Intended uses

Appropriate uses include:

- continued pretraining or domain adaptation of causal language models
- code completion and repository-aware coding assistant experiments
- tokenizer, chunking, deduplication, and corpus composition research
- retrieval and provenance experiments using repository and path metadata
- controlled studies of personalization on repository-disjoint validation data

The dataset is not suitable as a correctness benchmark, a secure-code reference, a software
license classifier, or evidence of authorship and repository ownership.

## Load the dataset

Install a compatible version of `datasets`, then load the full corpus:

```python
from datasets import load_dataset

dataset = load_dataset("JulianAT/personal-codex-model")
print(dataset)
print(dataset["train"].features)
```

Stream examples without downloading the complete dataset:

```python
from datasets import load_dataset

stream = load_dataset("JulianAT/personal-codex-model", split="train", streaming=True)
first_example = next(iter(stream))
```

## Schema

| Field | Type | Description |
| --- | --- | --- |
| `text` | string | Source-code or repository-text chunk used as the modeling target. |
| `repo` | string | Source repository name at collection time. |
| `path` | string | Repository-relative source path. |
| `language` | string | Language or format inferred from the configured mapping. |
| `sha` | string | SHA-256 digest of the emitted `text`. |
| `chunk_index` | int32 | Zero-based chunk position within the source file. |
| `n_tokens` | int32 | Tokenizer-independent lexical token estimate. |

## Dataset construction

The builder applies the following deterministic pipeline:

1. Discover configured Git repository checkouts.
2. Walk supported source, documentation, schema, configuration, and build files.
3. Exclude ignored, sensitive, generated, vendored, binary, oversized, and unsupported content.
4. Decode retained files as UTF-8 and reject unreadable or empty payloads.
5. Reject complete files containing high-confidence credential signatures.
6. Chunk source text to approximately 896 lexical tokens with an overlap of
   64 lexical tokens.
7. Remove exact duplicate chunks by SHA-256.
8. Remove near-duplicate chunks with MinHash LSH.
9. Assign repositories, rather than individual rows, to deterministic train and validation splits.

This repository-level split prevents a source repository from appearing in both splits. It reduces
direct leakage from repeated project structure and repository-specific conventions.

## Deduplication and quality controls

Near-duplicate detection uses `datasketch.MinHashLSH` with
128 permutations, token 5-grams, and a Jaccard
threshold of 0.85. The current build retained
18,361 chunks after dropping
1,470 exact duplicates and
1,027 near duplicates.

The file walk excludes Git metadata, ignored paths, dependency and environment directories, build
outputs, vendored and generated directories, lockfiles, minified files, symlinks, binary or
non-UTF-8 payloads, files above 1,048,576 bytes, and unsupported formats.
Credential screening covers high-confidence private-key, platform-token, cloud-key, API-key, and
JWT patterns.

These controls reduce common leakage and duplication risks. They do not constitute a formal proof
that every row is safe, original, correct, or free of sensitive information.

## Provenance, privacy, and licensing

Every record retains repository, path, language, chunk position, and content-hash metadata. This
supports traceability inside the published corpus without publishing local checkout locations or
builder credentials.

Some contributing repositories were private at collection time. Public publication was explicitly
enabled by the dataset maintainer. Users should still treat repository names, paths, comments, and
source text as potentially identifying information.

The packaged dataset is released under the MIT License. The included
`LICENSE` file contains the complete terms. This dataset-level license does not supersede separate
licenses, notices, or obligations that may apply to code from contributing repositories. Users are
responsible for source-specific compliance when redistributing code, releasing trained models, or
using generated output.

## Limitations

- Source is collected from working-tree snapshots, not from deleted Git history.
- Repository contents can include incomplete, insecure, outdated, experimental, or generated-like
  code that survives the configured filters.
- Extension-based language labels do not perform parser-level language verification.
- Lexical token estimates are not equivalent to tokens from a production model tokenizer.
- MinHash is approximate and can retain related text or remove independently written similar text.
- Chunk overlap increases emitted volume and can repeat boundary lines.
- The dataset contains no correctness, security, quality, preference, or authorship labels.
- Repository-disjoint validation measures transfer across included repositories, not general coding
  ability across unrelated ecosystems.

## Reproducibility and audit artifacts

`statistics.json` records build parameters, split assignments, row and token counts, language
distribution, filter decisions, and deduplication totals. `dataset_infos.json` records the feature
schema and split sizes. The Parquet shards are the canonical Hub loader source.

The Hub publication intentionally omits local Arrow and JSONL copies because they duplicate the
Parquet payload. It also omits source checkouts, local filesystem paths, author-email configuration,
and training artifacts.

## Citation

```bibtex
@misc{personal_codex_model_training_corpus,
  author       = {JulianAT},
  title        = {Personal Codex Model Training Corpus},
  year         = {2026},
  howpublished = {Hugging Face Datasets},
  url          = {https://huggingface.co/datasets/JulianAT/personal-codex-model}
}
```