nyuuzyou commited on
Commit
553bff1
·
verified ·
1 Parent(s): 22d2fc5

Add files using upload-large-folder tool

Browse files
README.md ADDED
@@ -0,0 +1,239 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - machine-generated
4
+ language_creators:
5
+ - found
6
+ language:
7
+ - code
8
+ - zh
9
+ - en
10
+ license: other
11
+ multilinguality:
12
+ - multilingual
13
+ pretty_name: GitCode Code Dataset
14
+ size_categories:
15
+ - 10M<n<100M
16
+ source_datasets:
17
+ - original
18
+ task_categories:
19
+ - text-generation
20
+ tags:
21
+ - code
22
+ - chinese
23
+ configs:
24
+ - config_name: default
25
+ data_files:
26
+ - split: train
27
+ path: "data/*.parquet"
28
+ default: true
29
+ dataset_info:
30
+ features:
31
+ - name: code
32
+ dtype: string
33
+ - name: repo_name
34
+ dtype: string
35
+ - name: path
36
+ dtype: string
37
+ - name: language
38
+ dtype: string
39
+ - name: license
40
+ dtype: string
41
+ - name: size
42
+ dtype: int64
43
+ ---
44
+
45
+ # GitCode Code Dataset
46
+
47
+ ## Dataset Description
48
+
49
+ This dataset was compiled from code repositories hosted on [GitCode](https://gitcode.com), a code hosting platform in China backed by CSDN (China Software Developer Network). GitCode serves as a domestic alternative to GitHub, widely used by Chinese developers, students, and enterprises for hosting open-source projects and educational resources, making this dataset particularly valuable for training code models with Chinese language understanding and Chinese coding conventions.
50
+
51
+ ### Dataset Summary
52
+
53
+ | Statistic | Value |
54
+ |-----------|-------|
55
+ | **Total Files** | 48,142,567 |
56
+ | **Total Repositories** | 85,632 |
57
+ | **Total Size** | 40 GB (compressed Parquet) |
58
+ | **Programming Languages** | 537 |
59
+ | **File Format** | Parquet with Zstd compression (34 files) |
60
+
61
+ ### Key Features
62
+
63
+ - **Chinese code corpus**: Contains code from over 85,000 repositories, many featuring Chinese comments, documentation, and variable names
64
+ - **Diverse language coverage**: Spans 537 programming languages identified by [go-enry](https://github.com/go-enry/go-enry) (based on GitHub Linguist rules)
65
+ - **Rich metadata**: Includes repository name, file path, detected language, license information, and file size
66
+ - **Open-source and educational projects**: Includes code from individual developers, students, and Chinese enterprises
67
+ - **Quality filtered**: Extensive filtering to remove vendor code, build artifacts, generated files, and low-quality content
68
+
69
+ ### Languages
70
+
71
+ The dataset includes 537 programming languages. The top 30 languages by file count:
72
+
73
+ | Rank | Language | File Count |
74
+ |------|----------|------------|
75
+ | 1 | C++ | 9,513,619 |
76
+ | 2 | C | 8,220,317 |
77
+ | 3 | Java | 5,362,924 |
78
+ | 4 | Python | 3,428,302 |
79
+ | 5 | TypeScript | 3,166,959 |
80
+ | 6 | JavaScript | 2,540,280 |
81
+ | 7 | HTML | 1,578,824 |
82
+ | 8 | Kotlin | 1,413,651 |
83
+ | 9 | C# | 1,232,638 |
84
+ | 10 | Go | 1,159,708 |
85
+ | 11 | Rust | 812,959 |
86
+ | 12 | Dart | 767,731 |
87
+ | 13 | TSX | 749,355 |
88
+ | 14 | PHP | 663,953 |
89
+ | 15 | Shell | 629,436 |
90
+ | 16 | Vue | 563,754 |
91
+ | 17 | Makefile | 471,588 |
92
+ | 18 | CMake | 460,428 |
93
+ | 19 | CSS | 381,628 |
94
+ | 20 | Ruby | 350,213 |
95
+ | 21 | Objective-C | 347,251 |
96
+ | 22 | LLVM | 297,591 |
97
+ | 23 | Unix Assembly | 291,826 |
98
+ | 24 | Swift | 206,725 |
99
+ | 25 | Objective-C++ | 160,526 |
100
+ | 26 | Scala | 157,367 |
101
+ | 27 | QML | 157,088 |
102
+ | 28 | Lua | 149,114 |
103
+ | 29 | SCSS | 141,661 |
104
+ | 30 | GLSL | 129,124 |
105
+
106
+ ### Licenses
107
+
108
+ The dataset includes files from repositories with various licenses. Repositories with restrictive licenses (CC-BY-ND variants, Commons Clause, SSPL) were excluded:
109
+
110
+ | License | File Count |
111
+ |---------|------------|
112
+ | unknown | 23,567,463 |
113
+ | apache-2.0 | 8,722,445 |
114
+ | mit | 7,743,613 |
115
+ | gpl-2.0 | 3,528,526 |
116
+ | agpl-3.0 | 2,300,580 |
117
+ | lgpl | 1,013,654 |
118
+ | bsd-3-clause | 528,980 |
119
+ | gpl-3.0 | 305,332 |
120
+ | public-domain | 163,493 |
121
+ | bsd-2-clause | 94,426 |
122
+ | bsd | 69,967 |
123
+ | isc | 36,117 |
124
+ | unlicense | 28,411 |
125
+ | cc0-1.0 | 26,799 |
126
+ | mpl-2.0 | 9,459 |
127
+ | Other licenses | ~5,000 |
128
+
129
+ ## Dataset Structure
130
+
131
+ ### Data Fields
132
+
133
+ | Field | Type | Description |
134
+ |-------|------|-------------|
135
+ | `code` | string | Content of the source file (UTF-8 encoded) |
136
+ | `repo_name` | string | Name of the GitCode repository (format: `username/repo`) |
137
+ | `path` | string | Path of the file within the repository (relative to repo root) |
138
+ | `language` | string | Programming language as identified by [go-enry](https://github.com/go-enry/go-enry) |
139
+ | `license` | string | License of the repository (SPDX identifier or "unknown") |
140
+ | `size` | int64 | Size of the source file in bytes |
141
+
142
+ ### Data Format
143
+
144
+ - **Format**: Apache Parquet with Zstd compression
145
+ - **File Structure**: 34 files (`gitcode_0000.parquet` to `gitcode_0033.parquet`)
146
+
147
+ ### Data Splits
148
+
149
+ All examples are in the train split. There is no validation or test split.
150
+
151
+ ### Example Data Point
152
+
153
+ ```
154
+ {
155
+ 'code': '#!/bin/sh\n# defines variable\ngit=`ls -d */` && path=`pwd` && gitpath=$path/$git\n...',
156
+ 'repo_name': '00fly/git-auto-push',
157
+ 'path': 'all-in-one-cron-push.sh',
158
+ 'language': 'Shell',
159
+ 'license': 'apache-2.0',
160
+ 'size': 546
161
+ }
162
+ ```
163
+
164
+ ## Dataset Creation
165
+
166
+ ### Pipeline Overview
167
+
168
+ The dataset was created through a multi-stage pipeline:
169
+
170
+ 1. **User Discovery**: Collecting usernames via GitCode API
171
+ 2. **Repository Discovery**: Fetching repository lists for each user via GitCode API
172
+ 3. **Repository Cloning**: Using Git partial clone with blob size filtering
173
+ 4. **Content Extraction**: Extracting and filtering source code files
174
+ 5. **Parquet Generation**: Writing filtered records to Parquet shards with Zstd compression
175
+
176
+ ### Language Detection
177
+
178
+ Programming languages are detected using [go-enry](https://github.com/go-enry/go-enry), a Go port of GitHub's Linguist library. Only files classified as **Programming** or **Markup** language types are included (Data and Prose types are excluded).
179
+
180
+ ### License Detection
181
+
182
+ Licenses are detected by:
183
+ 1. Scanning for license files (`LICENSE`, `LICENSE.txt`, `LICENSE.md`, `COPYING`, etc.)
184
+ 2. Matching license text against known patterns (MIT, Apache 2.0, GPL variants, BSD, Creative Commons, etc.)
185
+ 3. Defaulting to "unknown" if no license can be detected
186
+
187
+ **Blocked Licenses**: The following restrictive licenses are excluded from the dataset:
188
+ - `cc-by-nd`, `cc-by-nd-2.0`, `cc-by-nd-3.0`, `cc-by-nd-4.0` (Creative Commons No-Derivatives)
189
+ - `commons-clause`
190
+ - `sspl`, `sspl-1.0` (Server Side Public License)
191
+
192
+ ### File Filtering
193
+
194
+ Extensive filtering is applied to ensure data quality:
195
+
196
+ #### Size Limits
197
+ | Limit | Value |
198
+ |-------|-------|
199
+ | Max single file size | 1 MB |
200
+ | Max line length | 1,000 characters |
201
+
202
+ #### Excluded Directories
203
+ - **Configuration**: `.git/`, `.github/`, `.gitlab/`, `.vscode/`, `.idea/`
204
+ - **Vendor/Dependencies**: `node_modules/`, `vendor/`, `third_party/`, `bower_components/`
205
+ - **Build Output**: `build/`, `dist/`, `out/`, `bin/`, `target/`, `__pycache__/`, `.next/`, `.nuxt/`, `coverage/`, `.nyc_output/`
206
+
207
+ #### Excluded Files
208
+ - **Lock Files**: `package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`, `Cargo.lock`, `go.sum`, `composer.lock`, `Gemfile.lock`, `poetry.lock`, `Pipfile.lock`
209
+ - **Minified Files**: Any file containing `.min.` in the name
210
+ - **Binary Files**: `.exe`, `.dll`, `.so`, `.dylib`, `.a`, `.o`, `.obj`, `.lib`, `.jar`, `.class`, `.pyc`, `.pyo`, `.wasm`, `.zip`, `.tar`, `.gz`, `.bz2`, `.7z`, `.rar`, `.png`, `.jpg`, `.jpeg`, `.gif`, `.bmp`, `.ico`, `.svg`, `.webp`, `.mp3`, `.mp4`, `.avi`, `.mov`, `.wav`, `.pdf`, `.doc`, `.docx`, `.xls`, `.xlsx`, `.ttf`, `.otf`, `.woff`, `.woff2`, `.eot`
211
+
212
+ #### Content Filtering
213
+ - **UTF-8 Validation**: Files must be valid UTF-8 encoded text
214
+ - **Binary Detection**: Files detected as binary by go-enry are excluded
215
+ - **Generated Files**: Files with generation markers in the first 500 bytes are excluded:
216
+ - `generated by`, `do not edit`, `auto-generated`, `autogenerated`, `automatically generated`, `@generated`, `<auto-generated`, `this file is generated`
217
+ - **Empty Files**: Files that are empty or contain only whitespace are excluded
218
+ - **Long Lines**: Files with any line exceeding 1,000 characters are excluded
219
+ - **go-enry Filters**: Additional filtering using go-enry's `IsVendor()`, `IsImage()`, `IsDotFile()`, and `IsGenerated()` functions
220
+ - **Documentation-only Repos**: Repositories containing only documentation files (no actual code) are skipped
221
+
222
+ ### Source Data
223
+
224
+ All data originates from public repositories hosted on [GitCode](https://gitcode.com).
225
+
226
+ ## Considerations for Using the Data
227
+
228
+ ### Personal and Sensitive Information
229
+
230
+ The dataset may contain:
231
+ - Email addresses in code comments or configuration files
232
+ - API keys or credentials that were accidentally committed
233
+ - Personal information in comments or documentation
234
+
235
+ Users should exercise caution and implement appropriate filtering when using this data.
236
+
237
+ ### Licensing Information
238
+
239
+ This dataset is a collection of source code from repositories with various licenses. Any use of all or part of the code gathered in this dataset must abide by the terms of the original licenses, including attribution clauses when relevant. The license field in each data point indicates the license of the source repository.
data/gitcode_0000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:221e9e106617ae2cb5a29f53eb89bf5787caa165aa3fc4da4d12648741a90cb9
3
+ size 1255388509
data/gitcode_0001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cab2e7930b2e85b454c4a1e53959340c88941a58024ad31506337a9de25ca2b0
3
+ size 1069364162
data/gitcode_0002.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e80b00b65e6dbab2543f7db066d70a270b6c57f378eb3410c91f23a57c9340a2
3
+ size 1217743905
data/gitcode_0003.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:daaa5c6f559c2b0ea225bd6428cce385e25a2451e6ab7dcc5ef919c146fcbda8
3
+ size 1191177439
data/gitcode_0004.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6d5df1479d91a10616911b1231303fdf2263da22ed6dfa5543df8a35d6d434ae
3
+ size 1253791616
data/gitcode_0005.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:913969f9eb2636f78a44719d172d333cea2f5fe99412c3ce30df8f28cbf42af3
3
+ size 1319185926
data/gitcode_0006.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b0a2130e94f606cabc7691e2d221c7bae001464f1f61409b3143fa79ac73eaa2
3
+ size 1310785459
data/gitcode_0007.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a55ce250748e6e3c140da3bf3fdb2a64bc1dce898a5c77959e1500118b3ab6ca
3
+ size 1282723182
data/gitcode_0008.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e60eb0cabac60bc89d3e2c7801392dda1ee3072a8a80fdc1b1fd602d00d96308
3
+ size 1323345972
data/gitcode_0009.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5b129d41471d79131e123e8ee4dcfa38b3c7a3c8e54e57ee33f7442a4f1bb370
3
+ size 1318369951
data/gitcode_0010.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b2a4de0d20446a7a0f648deaf5362f181592e4182d7144b5e23d524159ef8c47
3
+ size 1330170391
data/gitcode_0011.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d8924aec97e661e1a8755713f2d637391dd09a16845baace9a2d915c7499025d
3
+ size 1315413752
data/gitcode_0012.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:98b0aa1a46ee45e9b77634c5811382c0a611c69ebd6e11d479fa58b62985ccad
3
+ size 1297825744
data/gitcode_0013.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dfbecfc7e22b0155ac0269807cc2a9a178d5d1091497d233d4ba0c313d59ad72
3
+ size 1302897646
data/gitcode_0014.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e1f593b046d8969a8f3e456e93b8c4f9c7769e43c77f307c719eb51392e3fd41
3
+ size 1213573944
data/gitcode_0015.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b094d8dba12492e6cbe61da1bf3e9092b6e41a539931e542e7800e2a6519d1db
3
+ size 1217641609
data/gitcode_0016.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1293f1c262a7407b96abdb6fd7378d40b971d59730df79fcab98e18d994c8245
3
+ size 1186846588
data/gitcode_0017.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a75098da746283eb21ee27d494fa5095b0832c99ce9ab85c5cefccebc851ef70
3
+ size 1273793153
data/gitcode_0018.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:59ce1746a43b3359dea76074c64bd4a7adf2bc6e055e8ee564677913d6827599
3
+ size 1250898884
data/gitcode_0019.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:700f3d007302633f7d00558c8af95af0c0a8e0d87ddff63b7817e0e85a649f5d
3
+ size 1263157012
data/gitcode_0020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5598d6098f727e1e3831f98d7985214c704a4b0c910f106ccebd0275c30e8fdd
3
+ size 1242914685
data/gitcode_0021.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ff5e77fc5bb6feb50f5b09d8cc7b22b359bf7fcccccc5a2bbeffc5a02c682f43
3
+ size 1260227225
data/gitcode_0022.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f97bf5fca5dff3adfbef792a899968e58c7e92f8f076ab13344b7e033286ab02
3
+ size 1307400809
data/gitcode_0023.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:56708c17d90acbbeb146738043385282cc256ec3d94901bf4fb0dd945c9361c3
3
+ size 1306187670
data/gitcode_0024.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:844fc615791f46a8ddbe574b397211a1df81a0a348897b8a5ba10d6da91f9530
3
+ size 1231813899
data/gitcode_0025.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2c19327ca616775f43cd65a0a2a67ff2cfb5f3732c13cede709d7cb6fe5f2143
3
+ size 1196513866
data/gitcode_0026.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7adcffbddd46e601603ed6002b27fab89f6cc9fa506adb275e9db5a71a8367f1
3
+ size 1296471729
data/gitcode_0027.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:385c22532b9ec95736644c30d390fe6f690558687137c060eb0b33e831115a8f
3
+ size 1257784339
data/gitcode_0028.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ceaed39f484edc94aa5a3508f3278ab1d4bc32a06eb9ac82686b04f56c180b11
3
+ size 1143695646
data/gitcode_0029.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a6a5d17796c4bad9f02b125b79492eef49ebc8d5426534e9d8611ef269de1f8e
3
+ size 1318022896
data/gitcode_0030.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:69f614584743ab4f2f7a6a3678ca0f3ed2026b91f439d365855d3a90a1a7b218
3
+ size 1238340637
data/gitcode_0031.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:903bf3c9913feb5b111efbd7a1c5da0543e7e61b2ef9268ab47098991ddccea7
3
+ size 1231959473
data/gitcode_0032.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:88648253409b6337016ed1b55c504c9789fe307d42831d333182d7baf901b5cf
3
+ size 1284604199
data/gitcode_0033.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c2765b46faf270e3f00afd863ee569f0874ff3af17d67e3f8eb17f44bf3a4a01
3
+ size 710650112