mdonigian commited on
Commit
43d9520
·
verified ·
1 Parent(s): 16020ea

Upload folder using huggingface_hub

Browse files
README.md CHANGED
@@ -24,76 +24,122 @@ optimised for training a 500M parameter model focused on structured data output
24
 
25
  - **Total code files:** 5,203,508
26
  - **Total tokens:** 3.9B (target: 3.5B)
 
 
27
  - **Source:** bigcode/starcoderdata
28
  - **Classifier:** [mdonigian/code-curator-v1](https://huggingface.co/mdonigian/code-curator-v1) (UniXcoder-base, multi-task)
29
  - **Curation:** Per-language-slice filtering + compression ratio pre-filter + MinHash deduplication
30
 
31
  ## Filtering Strategy
32
 
33
- Each language slice has its own filtering strategy and token budget:
 
 
 
34
 
35
- 1. **Schema languages** (JSON/YAML/SQL/protobuf/GraphQL): ~800M tokens, light filter (quality floor only)
36
- 2. **TypeScript** (relevance 2): ~600M tokens, relevance classifier
37
- 3. **Python** (relevance 2): ~600M tokens, relevance classifier
38
- 4. **Rust/Go/Java** (relevance ≥ 2): ~600M tokens, relevance classifier
39
- 5. **Jupyter notebooks**: ~400M tokens, passthrough (already structured)
40
- 6. **GitHub Issues** (technical): ~500M tokens, keyword filter
41
 
42
- Pre-filtering applied to all slices:
43
- - zlib compression ratio < 0.10 catches extreme repetition
44
- - Quality floor: drop files with predicted quality 1 (broken/gibberish)
45
- - MinHash LSH deduplication with line-level 5-gram shingles
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
 
47
  ## Language Slice Distribution
48
 
49
- | Slice | Strategy | Target | Actual | % |
50
- |-------|----------|--------|--------|---|
51
- | schema_languages | light_filter | 800M | 799M | 99.9% |
52
- | typescript | relevance_filter | 600M | 598M | 99.7% |
53
- | python | relevance_filter | 600M | 594M | 99.1% |
54
- | rust_go_java | relevance_filter | 600M | 485M | 80.8% |
55
- | jupyter | relevance_filter | 400M | 0M | 0.0% |
56
- | github_issues | keyword_filter | 500M | 426M | 85.2% |
57
- | general_code | light_filter | 1000M | 999M | 99.9% |
 
 
 
 
 
 
 
58
 
 
 
 
 
 
 
59
 
60
- ## Content Group Distribution
61
 
62
- | Group | % of Tokens | Tokens | Files |
63
- |-------|-------------|--------|-------|
64
- | Library/Package | 27.7% | 1,079,381,502 | 1,075,672 |
65
- | Application | 1.4% | 56,360,750 | 118,200 |
66
- | Script/CLI | 0.5% | 17,853,662 | 24,871 |
67
- | Test Code | 2.3% | 91,370,763 | 48,003 |
68
- | Config/Data/Generated/Other | 68.1% | 2,656,726,472 | 3,936,762 |
69
 
 
 
 
 
 
 
 
70
 
71
- ## Structured Data Relevance Distribution
72
 
73
- The strongest classifier signal (Spearman 0.81). SD2+ files contain significant
74
- structured data patterns (API endpoints, JSON parsing, schema definitions, etc.).
 
 
 
 
 
75
 
76
  | Level | Range | Target % | Actual % | Files |
77
  |-------|-------|----------|----------|-------|
78
- | SD0 | [0.0, 0.5) | 10.0% | 70.1% | 3,649,912 |
79
  | SD1 | [0.5, 1.5) | 20.0% | 0.0% | 0 |
80
- | SD2 | [1.5, 2.5) | 35.0% | 0.9% | 49,213 |
81
- | SD3 | [2.5, 3.5) | 35.0% | 28.9% | 1,504,383 |
82
 
83
 
84
- ## Quality Distribution
85
-
86
- Quality mean: 1.13, Median: 0.00.
87
 
88
  | Level | Description | Files |
89
  |-------|-------------|-------|
90
- | 1 | Broken/gibberish | 3,649,912 |
91
  | 2 | Functional but poor | 42,668 |
92
  | 3 | Decent | 129,945 |
93
  | 4 | Good | 1,380,674 |
94
  | 5 | Excellent | 309 |
95
 
96
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
  ## Programming Languages
98
 
99
  | Language | % Tokens | Files |
@@ -136,19 +182,25 @@ Each row contains:
136
  | `lang` | string | Programming language |
137
  | `size` | int | File size in bytes |
138
  | `token_count` | int | Estimated token count (size // 4) |
139
- | `quality` | float | Code quality score (1-5) |
140
- | `structured_data` | float | Structured data relevance (0-3) |
141
- | `content_type` | string | Content type (9 classes) |
142
- | `language_slice` | string | Language slice (schema_languages, typescript, python, etc.) |
143
- | `relevance_score` | float | Composite relevance score |
 
 
 
144
 
145
  ## Methodology
146
 
147
- 1. **Classification:** Single multi-task UniXcoder-base model with three heads runs
148
- on each code file. Stores raw float scores for maximum flexibility.
149
- 2. **Pre-filtering:** zlib compression ratio filter removes repetitive boilerplate
 
 
150
  before GPU inference.
151
- 3. **Filtering:** Quality floor + priority-based sampling targeting high structured
152
- data relevance and balanced content type distribution.
153
- 4. **Deduplication:** MinHash LSH (128 perms, 5-line shingles, 0.7 Jaccard threshold).
154
- Highest-relevance code file kept from each cluster.
 
 
24
 
25
  - **Total code files:** 5,203,508
26
  - **Total tokens:** 3.9B (target: 3.5B)
27
+ - **Classifier-scored files:** 1,553,596 (1.7B tokens)
28
+ - **Non-classified files:** 3,649,912 (2.2B tokens) — filtered by heuristics, not the classifier
29
  - **Source:** bigcode/starcoderdata
30
  - **Classifier:** [mdonigian/code-curator-v1](https://huggingface.co/mdonigian/code-curator-v1) (UniXcoder-base, multi-task)
31
  - **Curation:** Per-language-slice filtering + compression ratio pre-filter + MinHash deduplication
32
 
33
  ## Filtering Strategy
34
 
35
+ Different language groups need different curation approaches. Not every slice
36
+ goes through the GPU classifier — schema languages and GitHub issues are filtered
37
+ with cheaper heuristics because the classifier was trained on general-purpose code
38
+ and isn't the right tool for inherently structured formats.
39
 
40
+ **All slices** share these pre-filters:
41
+ - zlib compression ratio < 0.10 (catches extreme repetition)
42
+ - MinHash LSH deduplication (128 perms, 5-line shingles, 0.7 Jaccard threshold)
 
 
 
43
 
44
+ ### Classifier-Scored Slices (relevance_filter)
45
+
46
+ These languages were scored by the multi-task classifier. Files were ranked by
47
+ structured data relevance and filtered to keep only those with relevance 2.0
48
+ and quality ≥ 1.5, sampled down to the per-slice token budget:
49
+
50
+ - **TypeScript**: ~600M tokens — strong type system, filter by SD relevance ≥ 2
51
+ - **Python**: ~600M tokens — filter by SD relevance ≥ 2
52
+ - **Rust/Go/Java**: ~600M tokens — strongly typed, filter by SD relevance ≥ 2
53
+ - **Jupyter notebooks**: ~400M tokens — filter by SD relevance ≥ 2
54
+
55
+ ### Non-Classified Slices
56
+
57
+ These languages were **not** run through the classifier. Their `quality`,
58
+ `structured_data`, and `content_type` columns contain default placeholder values
59
+ (0.0 / "unclassified") and should be ignored:
60
+
61
+ - **Schema languages** (JSON/YAML/SQL/protobuf/thrift/XSLT): ~800M tokens — inherently structured data formats; quality floor + random sample to budget
62
+ - **GitHub Issues** (technical): ~500M tokens — keyword filter matching structured-data topics (JSON, schema, API, protobuf, gRPC, etc.)
63
+ - **General code** (78 other languages): ~1B tokens — random sample for language diversity; quality floor only
64
 
65
  ## Language Slice Distribution
66
 
67
+ | Slice | Strategy | Languages | Target | Actual | % of Target |
68
+ |-------|----------|-----------|--------|--------|-------------|
69
+ | schema_languages | light_filter | json, yaml, sql, protocol-buffer +2 more | 800M | 799M | 99.9% |
70
+ | typescript | relevance_filter | typescript | 600M | 598M | 99.7% |
71
+ | python | relevance_filter | python | 600M | 594M | 99.1% |
72
+ | rust_go_java | relevance_filter | rust, go, java | 600M | 485M | 80.8% |
73
+ | jupyter | relevance_filter | jupyter-scripts-dedup-filtered | 400M | 0M | 0.0% |
74
+ | github_issues | keyword_filter | github-issues-filtered-structured | 500M | 426M | 85.2% |
75
+ | general_code | light_filter | ada, agda, alloy, antlr +74 more | 1000M | 999M | 99.9% |
76
+
77
+
78
+ ## Classifier-Scored Slices — Detail
79
+
80
+ The quality and structured data scores below apply **only** to the 1,553,596 files
81
+ (1.7B tokens) that went through the classifier. Non-classified slices
82
+ are excluded from these statistics.
83
 
84
+ | Slice | Files | Tokens | Avg Quality | Avg SD Relevance |
85
+ |-------|-------|--------|-------------|------------------|
86
+ | typescript | 841,426 | 598M | 3.81 | 2.88 |
87
+ | python | 567,721 | 594M | 3.71 | 2.73 |
88
+ | rust_go_java | 144,438 | 485M | 3.97 | 3.07 |
89
+ | jupyter | 11 | 0M | 3.11 | 2.23 |
90
 
 
91
 
92
+ ### Content Group Distribution (classifier-scored files only)
 
 
 
 
 
 
93
 
94
+ | Group | % of Classified Tokens | Tokens | Files |
95
+ |-------|-----------------------|--------|-------|
96
+ | Library/Package | 64.3% | 1,079,381,502 | 1,075,672 |
97
+ | Application | 3.4% | 56,360,750 | 118,200 |
98
+ | Script/CLI | 1.1% | 17,853,662 | 24,871 |
99
+ | Test Code | 5.5% | 91,370,763 | 48,003 |
100
+ | Config/Data/Generated/Other | 25.8% | 432,393,146 | 286,850 |
101
 
 
102
 
103
+ ### Structured Data Relevance (classifier-scored files only)
104
+
105
+ The strongest classifier signal (Spearman 0.81 on held-out data). SD2+ files
106
+ contain significant structured data patterns (API endpoints, JSON parsing,
107
+ schema definitions, etc.).
108
+
109
+ Quality mean: 3.79, Median: 3.88.
110
 
111
  | Level | Range | Target % | Actual % | Files |
112
  |-------|-------|----------|----------|-------|
113
+ | SD0 | [0.0, 0.5) | 10.0% | 0.0% | 0 |
114
  | SD1 | [0.5, 1.5) | 20.0% | 0.0% | 0 |
115
+ | SD2 | [1.5, 2.5) | 35.0% | 3.2% | 49,213 |
116
+ | SD3 | [2.5, 3.5) | 35.0% | 96.8% | 1,504,383 |
117
 
118
 
119
+ ### Quality Distribution (classifier-scored files only)
 
 
120
 
121
  | Level | Description | Files |
122
  |-------|-------------|-------|
123
+ | 1 | Broken/gibberish | 0 |
124
  | 2 | Functional but poor | 42,668 |
125
  | 3 | Decent | 129,945 |
126
  | 4 | Good | 1,380,674 |
127
  | 5 | Excellent | 309 |
128
 
129
 
130
+ ## Non-Classified Slices — Detail
131
+
132
+ These slices were filtered using heuristics. The classifier columns (`quality`,
133
+ `structured_data`, `content_type`) are set to defaults and **do not reflect
134
+ actual code quality** — the filtering was done by other means:
135
+
136
+ | Slice | Strategy | Files | Tokens | How Filtered |
137
+ |-------|----------|-------|--------|-------------|
138
+ | schema_languages | light_filter | 2,203,233 | 799M | Quality floor (≥1.5) + token budget, randomly sampled |
139
+ | github_issues | keyword_filter | 485,384 | 426M | Keyword match for structured-data topics + quality floor |
140
+ | general_code | light_filter | 961,295 | 999M | Quality floor (≥1.5) + token budget, randomly sampled |
141
+
142
+
143
  ## Programming Languages
144
 
145
  | Language | % Tokens | Files |
 
182
  | `lang` | string | Programming language |
183
  | `size` | int | File size in bytes |
184
  | `token_count` | int | Estimated token count (size // 4) |
185
+ | `quality` | float | Code quality score 1-5 (**classifier-scored slices only**; 0.0 for non-classified) |
186
+ | `structured_data` | float | Structured data relevance 0-3 (**classifier-scored slices only**; 0.0 for non-classified) |
187
+ | `content_type` | string | Content type 9 classes (**classifier-scored slices only**; "unclassified" for non-classified) |
188
+ | `language_slice` | string | Language slice name (use this to filter by curation strategy) |
189
+ | `relevance_score` | float | Composite relevance score (**classifier-scored slices only**; 0.0 for non-classified) |
190
+
191
+ > **Tip:** To work with only classifier-scored data, filter on
192
+ > `language_slice` in `{"typescript", "python", "rust_go_java", "jupyter"}`.
193
 
194
  ## Methodology
195
 
196
+ 1. **Download:** All language folders from `bigcode/starcoderdata`.
197
+ 2. **Classification:** Multi-task UniXcoder-base model (3 heads: quality, SD relevance,
198
+ content type) runs on TypeScript, Python, Rust, Go, Java, and Jupyter files.
199
+ Schema languages, GitHub issues, and general code skip this step.
200
+ 3. **Pre-filtering:** zlib compression ratio filter removes repetitive boilerplate
201
  before GPU inference.
202
+ 4. **Filtering:** Per-slice strategy relevance-based ranking for classified languages,
203
+ keyword matching for GitHub issues, random sampling for schema/general code. All
204
+ slices enforce a quality floor.
205
+ 5. **Deduplication:** MinHash LSH (128 perms, 5-line shingles, 0.7 Jaccard threshold).
206
+ Highest-relevance file kept from each cluster.
dataset_stats.json CHANGED
@@ -2,41 +2,38 @@
2
  "total_documents": 5203508,
3
  "total_tokens": 3901693149,
4
  "num_output_files": 6,
 
 
5
  "group_distribution": {
6
  "library": {
7
  "display_name": "Library/Package",
8
  "docs": 1075672,
9
  "tokens": 1079381502,
10
- "pct_tokens": 27.66,
11
- "pct_of_total": 27.66
12
  },
13
  "application": {
14
  "display_name": "Application",
15
  "docs": 118200,
16
  "tokens": 56360750,
17
- "pct_tokens": 1.44,
18
- "pct_of_total": 1.44
19
  },
20
  "script": {
21
  "display_name": "Script/CLI",
22
  "docs": 24871,
23
  "tokens": 17853662,
24
- "pct_tokens": 0.46,
25
- "pct_of_total": 0.46
26
  },
27
  "test": {
28
  "display_name": "Test Code",
29
  "docs": 48003,
30
  "tokens": 91370763,
31
- "pct_tokens": 2.34,
32
- "pct_of_total": 2.34
33
  },
34
  "low_value": {
35
  "display_name": "Config/Data/Generated/Other",
36
- "docs": 3936762,
37
- "tokens": 2656726472,
38
- "pct_tokens": 68.09,
39
- "pct_of_total": 68.09
40
  }
41
  },
42
  "content_type_distribution": {
@@ -51,23 +48,23 @@
51
  "other": 0
52
  },
53
  "quality_distribution": {
54
- "1": 3649912,
55
  "2": 42668,
56
  "3": 129945,
57
  "4": 1380674,
58
  "5": 309
59
  },
60
  "quality_stats": {
61
- "mean": 1.131,
62
- "std": 1.75,
63
- "median": 0.0
64
  },
65
  "sd_distribution": {
66
  "SD0": {
67
  "range": "[0.0, 0.5)",
68
- "docs": 3649912,
69
- "tokens": 2224333326,
70
- "pct": 70.14,
71
  "target_pct": 10.0
72
  },
73
  "SD1": {
@@ -81,21 +78,21 @@
81
  "range": "[1.5, 2.5)",
82
  "docs": 49213,
83
  "tokens": 55140562,
84
- "pct": 0.95,
85
  "target_pct": 35.0
86
  },
87
  "SD3": {
88
  "range": "[2.5, 3.5)",
89
  "docs": 1504383,
90
  "tokens": 1622219261,
91
- "pct": 28.91,
92
  "target_pct": 35.0
93
  }
94
  },
95
  "sd_stats": {
96
- "mean": 0.849,
97
- "std": 1.306,
98
- "median": 0.0
99
  },
100
  "top_languages": [
101
  {
@@ -223,7 +220,9 @@
223
  "actual_tokens": 598255831,
224
  "docs": 841426,
225
  "pct_of_target": 99.7,
226
- "pct_of_total": 15.3
 
 
227
  },
228
  "python": {
229
  "description": "Python \u2014 filter by structured data relevance \u2265 2",
@@ -235,7 +234,9 @@
235
  "actual_tokens": 594491555,
236
  "docs": 567721,
237
  "pct_of_target": 99.1,
238
- "pct_of_total": 15.2
 
 
239
  },
240
  "rust_go_java": {
241
  "description": "Rust/Go/Java \u2014 strongly typed, filter by structured data relevance \u2265 2",
@@ -249,7 +250,9 @@
249
  "actual_tokens": 484584034,
250
  "docs": 144438,
251
  "pct_of_target": 80.8,
252
- "pct_of_total": 12.4
 
 
253
  },
254
  "jupyter": {
255
  "description": "Jupyter notebooks \u2014 filter by structured data relevance \u2265 2",
@@ -261,7 +264,9 @@
261
  "actual_tokens": 28403,
262
  "docs": 11,
263
  "pct_of_target": 0.0,
264
- "pct_of_total": 0.0
 
 
265
  },
266
  "github_issues": {
267
  "description": "GitHub issues (technical) \u2014 keyword filter for structured data topics",
 
2
  "total_documents": 5203508,
3
  "total_tokens": 3901693149,
4
  "num_output_files": 6,
5
+ "classified_documents": 1553596,
6
+ "classified_tokens": 1677359823,
7
  "group_distribution": {
8
  "library": {
9
  "display_name": "Library/Package",
10
  "docs": 1075672,
11
  "tokens": 1079381502,
12
+ "pct_tokens": 64.35
 
13
  },
14
  "application": {
15
  "display_name": "Application",
16
  "docs": 118200,
17
  "tokens": 56360750,
18
+ "pct_tokens": 3.36
 
19
  },
20
  "script": {
21
  "display_name": "Script/CLI",
22
  "docs": 24871,
23
  "tokens": 17853662,
24
+ "pct_tokens": 1.06
 
25
  },
26
  "test": {
27
  "display_name": "Test Code",
28
  "docs": 48003,
29
  "tokens": 91370763,
30
+ "pct_tokens": 5.45
 
31
  },
32
  "low_value": {
33
  "display_name": "Config/Data/Generated/Other",
34
+ "docs": 286850,
35
+ "tokens": 432393146,
36
+ "pct_tokens": 25.78
 
37
  }
38
  },
39
  "content_type_distribution": {
 
48
  "other": 0
49
  },
50
  "quality_distribution": {
51
+ "1": 0,
52
  "2": 42668,
53
  "3": 129945,
54
  "4": 1380674,
55
  "5": 309
56
  },
57
  "quality_stats": {
58
+ "mean": 3.788,
59
+ "std": 0.432,
60
+ "median": 3.875
61
  },
62
  "sd_distribution": {
63
  "SD0": {
64
  "range": "[0.0, 0.5)",
65
+ "docs": 0,
66
+ "tokens": 0,
67
+ "pct": 0.0,
68
  "target_pct": 10.0
69
  },
70
  "SD1": {
 
78
  "range": "[1.5, 2.5)",
79
  "docs": 49213,
80
  "tokens": 55140562,
81
+ "pct": 3.17,
82
  "target_pct": 35.0
83
  },
84
  "SD3": {
85
  "range": "[2.5, 3.5)",
86
  "docs": 1504383,
87
  "tokens": 1622219261,
88
+ "pct": 96.83,
89
  "target_pct": 35.0
90
  }
91
  },
92
  "sd_stats": {
93
+ "mean": 2.844,
94
+ "std": 0.19,
95
+ "median": 2.844
96
  },
97
  "top_languages": [
98
  {
 
220
  "actual_tokens": 598255831,
221
  "docs": 841426,
222
  "pct_of_target": 99.7,
223
+ "pct_of_total": 15.3,
224
+ "quality_mean": 3.81,
225
+ "sd_mean": 2.88
226
  },
227
  "python": {
228
  "description": "Python \u2014 filter by structured data relevance \u2265 2",
 
234
  "actual_tokens": 594491555,
235
  "docs": 567721,
236
  "pct_of_target": 99.1,
237
+ "pct_of_total": 15.2,
238
+ "quality_mean": 3.71,
239
+ "sd_mean": 2.73
240
  },
241
  "rust_go_java": {
242
  "description": "Rust/Go/Java \u2014 strongly typed, filter by structured data relevance \u2265 2",
 
250
  "actual_tokens": 484584034,
251
  "docs": 144438,
252
  "pct_of_target": 80.8,
253
+ "pct_of_total": 12.4,
254
+ "quality_mean": 3.97,
255
+ "sd_mean": 3.07
256
  },
257
  "jupyter": {
258
  "description": "Jupyter notebooks \u2014 filter by structured data relevance \u2265 2",
 
264
  "actual_tokens": 28403,
265
  "docs": 11,
266
  "pct_of_target": 0.0,
267
+ "pct_of_total": 0.0,
268
+ "quality_mean": 3.11,
269
+ "sd_mean": 2.23
270
  },
271
  "github_issues": {
272
  "description": "GitHub issues (technical) \u2014 keyword filter for structured data topics",
group_distribution.png CHANGED

Git LFS Details

  • SHA256: 4bfd1a7eb14d8d7fa7a63f0457891820a713cffcbf7f4bfd38767a544ee8adb8
  • Pointer size: 130 Bytes
  • Size of remote file: 60.9 kB

Git LFS Details

  • SHA256: 0e9222cefbebd9701c435fb6024ac35e85a573e7b0d89835ab5c0ca58967a982
  • Pointer size: 130 Bytes
  • Size of remote file: 67.1 kB
quality_sd_heatmap.png CHANGED

Git LFS Details

  • SHA256: a9e8d747ee9d77f5640a60856342a758679b15924c404b3df52d9635ad0151e2
  • Pointer size: 130 Bytes
  • Size of remote file: 82.3 kB

Git LFS Details

  • SHA256: 93dd0b3905415204206e4735bb10604e6f2177e4f93f63b56c0c9b81d91231d5
  • Pointer size: 130 Bytes
  • Size of remote file: 80.7 kB
sd_distribution.png CHANGED

Git LFS Details

  • SHA256: 6c44ecba14c5339d4c4cc96611e361d9b572ef4ca2faa88580a0a130ae3f1bb0
  • Pointer size: 130 Bytes
  • Size of remote file: 46.1 kB

Git LFS Details

  • SHA256: 29ca7428750e4308b5ee953bd4754b29563b8a804265b02c3e217a332dc3d1e6
  • Pointer size: 130 Bytes
  • Size of remote file: 44.2 kB