Datasets:

Modalities:
Text
ArXiv:
Libraries:
Datasets
License:
NamCyan commited on
Commit
854bb4d
·
1 Parent(s): 4eb3e75

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +314 -0
README.md CHANGED
@@ -1,3 +1,317 @@
1
  ---
 
 
 
 
 
 
 
2
  license: mit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ language:
3
+ - code
4
+ - en
5
+ multilinguality:
6
+ - multiprogramming languages
7
+ task_categories:
8
+ - text-generation
9
  license: mit
10
+ dataset_info:
11
+ features:
12
+ - name: identifier
13
+ dtype: string
14
+ - name: repo
15
+ dtype: string
16
+ - name: path
17
+ dtype: string
18
+ - name: language
19
+ dtype: string
20
+ - name: code
21
+ dtype: string
22
+ - name: code_tokens
23
+ dtype: string
24
+ - name: original_docstring
25
+ dtype: string
26
+ - name: comment
27
+ dtype: string
28
+ - name: docstring_tokens
29
+ dtype: string
30
+ - name: docstring
31
+ dtype: string
32
+ - name: original_string
33
+ dtype: string
34
+ pretty_name: The Vault Function
35
+ viewer: true
36
  ---
37
+
38
+
39
+
40
+ ## Table of Contents
41
+ - [Dataset Description](#dataset-description)
42
+ - [Dataset Summary](#dataset-summary)
43
+ - [Supported Tasks](#supported-tasks)
44
+ - [Languages](#languages)
45
+ - [Dataset Structure](#dataset-structure)
46
+ - [Data Instances](#data-instances)
47
+ - [Data Fields](#data-fields)
48
+ - [Data Splits](#data-splits)
49
+ - [Dataset Statistics](#dataset-statistics)
50
+ - [Usage](#usage)
51
+ - [Additional Information](#additional-information)
52
+ - [Licensing Information](#licensing-information)
53
+ - [Citation Information](#citation-information)
54
+ - [Contributions](#contributions)
55
+
56
+
57
+ ## Dataset Description
58
+
59
+ - **Repository:** [FSoft-AI4Code/TheVault](https://github.com/FSoft-AI4Code/TheVault)
60
+ - **Paper:** [The Vault: A Comprehensive Multilingual Dataset for Advancing Code Understanding and Generation](https://arxiv.org/abs/2305.06156)
61
+ - **Contact:** [email protected]
62
+ - **Website:** https://www.fpt-aicenter.com/ai-residency/
63
+
64
+ <p align="center">
65
+ <img src="https://raw.githubusercontent.com/FSoft-AI4Code/TheVault/main/assets/the-vault-4-logo-png.png" width="300px" alt="logo">
66
+ </p>
67
+
68
+ <div align="center">
69
+
70
+ # The Vault: A Comprehensive Multilingual Dataset for Advancing Code Understanding and Generation
71
+ </div>
72
+
73
+
74
+ ## Dataset Summary
75
+ The Vault dataset is a comprehensive, large-scale, multilingual parallel dataset that features high-quality code-text pairs derived from The Stack, the largest permissively-licensed source code dataset.
76
+
77
+ We provide The Vault which contains code snippets from 10 popular programming languages such as Java, JavaScript, Python, Ruby, Rust, Golang, C#, C++, C, and PHP. This dataset provides multiple code-snippet levels, metadata, and 11 docstring styles for enhanced usability and versatility.
78
+
79
+ ## Supported Tasks
80
+ The Vault can be used for pretraining LLMs or downstream code-text interaction tasks. A number of tasks related to code understanding and geneartion can be constructed using The Vault such as *code summarization*, *text-to-code generation* and *code search*.
81
+
82
+ ## Languages
83
+ The natural language text (docstring) is in English.
84
+
85
+ 10 programming languages are supported in The Vault: `Python`, `Java`, `JavaScript`, `PHP`, `C`, `C#`, `C++`, `Go`, `Ruby`, `Rust`
86
+
87
+ C and Go are not contained in this repo due to the nonexistence of traditional classes in these languages.
88
+
89
+ ## Dataset Structure
90
+ ### Data Instances
91
+ ```
92
+ {
93
+
94
+ "hexsha": "5c47f0b4c173a8fd03e4e633d9b3dd8211e67ad0",
95
+ "repo": "neumanna94/beepboop",
96
+ "path": "js/scripts.js",
97
+ "license": [
98
+ "MIT"
99
+ ],
100
+ "language": "JavaScript",
101
+ "identifier": "beepBoopSelector",
102
+ "original_string": "function beepBoopSelector(inputString, bbFunction){\n if(bbFunction==1){\n return beepBoop(inputString);\n } else if(bbFunction==2){\n return beepBoop2(inputString);\n } else if(bbFunction==3){\n return beepBoop3(inputString);\n } else {\n }\n}",
103
+ "original_docstring": "//Determines what beepBoop function to use",
104
+ "docstring": "Determines what beepBoop function to use",
105
+ "docstring_tokens": [
106
+ "Determines",
107
+ "what",
108
+ "beepBoop",
109
+ "function",
110
+ "to",
111
+ "use"
112
+ ],
113
+ "code": "function beepBoopSelector(inputString, bbFunction){\n if(bbFunction==1){\n return beepBoop(inputString);\n } else if(bbFunction==2){\n return beepBoop2(inputString);\n } else if(bbFunction==3){\n return beepBoop3(inputString);\n } else {\n }\n}",
114
+ "code_tokens": [
115
+ "function",
116
+ "beepBoopSelector",
117
+ "(",
118
+ "inputString",
119
+ ",",
120
+ "bbFunction",
121
+ ")",
122
+ "{",
123
+ "if",
124
+ "(",
125
+ "bbFunction",
126
+ "==",
127
+ "1",
128
+ ")",
129
+ "{",
130
+ "return",
131
+ "beepBoop",
132
+ "(",
133
+ "inputString",
134
+ ")",
135
+ ";",
136
+ "}",
137
+ "else",
138
+ "if",
139
+ "(",
140
+ "bbFunction",
141
+ "==",
142
+ "2",
143
+ ")",
144
+ "{",
145
+ "return",
146
+ "beepBoop2",
147
+ "(",
148
+ "inputString",
149
+ ")",
150
+ ";",
151
+ "}",
152
+ "else",
153
+ "if",
154
+ "(",
155
+ "bbFunction",
156
+ "==",
157
+ "3",
158
+ ")",
159
+ "{",
160
+ "return",
161
+ "beepBoop3",
162
+ "(",
163
+ "inputString",
164
+ ")",
165
+ ";",
166
+ "}",
167
+ "else",
168
+ "{",
169
+ "}",
170
+ "}"
171
+ ],
172
+
173
+ "short_docstring": "Determines what beepBoop function to use",
174
+ "short_docstring_tokens": [
175
+ "Determines",
176
+ "what",
177
+ "beepBoop",
178
+ "function",
179
+ "to",
180
+ "use"
181
+ ],
182
+ "comment": [],
183
+ "parameters": [
184
+ {
185
+ "param": "inputString",
186
+ "type": null
187
+ },
188
+ {
189
+ "param": "bbFunction",
190
+ "type": null
191
+ }
192
+ ],
193
+ "docstring_params": {
194
+ "returns": [],
195
+ "raises": [],
196
+ "params": [
197
+ {
198
+ "identifier": "inputString",
199
+ "type": null,
200
+ "docstring": null,
201
+ "docstring_tokens": [],
202
+ "default": null,
203
+ "is_optional": null
204
+ },
205
+ {
206
+ "identifier": "bbFunction",
207
+ "type": null,
208
+ "docstring": null,
209
+ "docstring_tokens": [],
210
+ "default": null,
211
+ "is_optional": null
212
+ }
213
+ ],
214
+ "outlier_params": [],
215
+ "others": []
216
+ }
217
+ }
218
+
219
+ ```
220
+ ### Data Fields
221
+
222
+ Data fields for function level:
223
+ - **hexsha** (string): the unique git hash of file
224
+ - **repo** (string): the owner/repo
225
+ - **path** (string): the full path to the original file
226
+ - **license** (list): licenses in the repo
227
+ - **language** (string): the programming language
228
+ - **identifier** (string): the function or method name
229
+ - **original_string** (string): original version of function/class node
230
+ - **original_docstring** (string): the raw string before tokenization or parsing
231
+ - **code** (string): the part of the original that is code
232
+ - **code_tokens** (list): tokenized version of `code`
233
+ - **short_docstring** (string): short, brief summarization (first line of the docstring)
234
+ - **short_docstring_tokens** (list): tokenized version of `short_docstring
235
+ - **docstring** (string): the top-level comment or docstring (docstring version without param’s doc, return, exception fields, etc)
236
+ - **docstring_tokens** (list): tokenized version of docstring
237
+ - **comment** (list): list of comments (line) inside the function/class
238
+ - **parameters** (list): List of parameters and its type (type can be None)
239
+ - **docstring_params** (dict): Dictionary of the parsed information from docstring
240
+
241
+ See [here](https://github.com/FSoft-AI4Code/TheVault/blob/main/data/README.md) for more details and examples.
242
+
243
+ ### Data Splits
244
+
245
+ In this repo, The Vault is divided into 5 subsets, where three training versions are split based on size of the full training set, and the remains are validation set and test set (approximate 20,000 samples in each). The statistic for languages in each split set is illustrated in the following section.
246
+
247
+ Before split, the dataset is deduplicated. There are 3 versions of training set that are small (5%), medium (20%) and large (100%).
248
+
249
+ ## Dataset Statistics
250
+
251
+ - Compare to other benchmarks
252
+
253
+ | Dataset | #Language | #Code-text pair |
254
+ |:--------------------------|----------:|-----------------:|
255
+ | PyMT5 | 1 | ≈ 7,700,000 |
256
+ | CoDesc | 1 | 4,211,516 |
257
+ | CodeSearchNet | 6 | 2,326,976 |
258
+ | CodeSearchNet (CodeXGLUE) | 6 | 1,005,474 |
259
+ | Deepcom | 1 | 424,028 |
260
+ | CONCODE | 1 | 2,184,310 |
261
+ | Funcom | 1 | 2,149,121 |
262
+ | CodeT5 | 8 | 3,158,313 |
263
+ | **The Vault** | **10** | **34,098,775** |
264
+
265
+ - Statistic for split sets
266
+
267
+ | | train/small | train/medium | train/full | validation | test | total |
268
+ |:-----------|------------:|-------------:|-----------:|-----------:|-------:|--------------:|
269
+ |Python | 370,657 | 1,952,110 | 7,772,647 | 30,992 | 21,652 | 7,825,291 |
270
+ |Java | 351,213 | 1,612,366 | 6,629,193 | 22,677 | 15,552 | 6,667,422 |
271
+ |JavaScript | 82,931 | 404,729 | 1,640,416 | 22,044 | 21,108 | 1,683,568 |
272
+ |PHP | 236,638 | 1,155,476 | 4,656,371 | 21,375 | 19,010 | 4,696,756 |
273
+ |C | 105,978 | 381,207 | 1,639,319 | 27,525 | 19,122 | 1,685,966 |
274
+ |C# | 141,090 | 783,166 | 3,305,891 | 24,787 | 19,638 | 3,350,316 |
275
+ |C++ | 87,420 | 410,907 | 1,671,268 | 20,011 | 18,169 | 1,709,448 |
276
+ |Go | 267,535 | 1,319,547 | 5,109,020 | 19,102 | 25,314 | 5,153,436 |
277
+ |Ruby | 23,921 | 112,574 | 424,339 | 17,338 | 19,908 | 461,585 |
278
+ |Rust | 35,367 | 224,015 | 825,130 | 16,716 | 23,141 | 864,987 |
279
+ |TOTAL | 1,702,750 | 8,356,097 |33,673,594 |222,567 |202,614 |**34,098,775** |
280
+
281
+ ## Usage
282
+ You can load The Vault dataset using datasets library: ```pip install datasets```
283
+
284
+ ```python
285
+ from datasets import load_dataset
286
+
287
+ # Load full function level dataset (34M samples)
288
+ dataset = load_dataset("Fsoft-AIC/the-vault-class")
289
+
290
+ # specific language (e.g. Python)
291
+ dataset = load_dataset("Fsoft-AIC/the-vault-class", split_set=["train"], languages=['Python'])
292
+
293
+ # dataset streaming
294
+ data = load_dataset("Fsoft-AIC/the-vault-class", split_set= ["train"], streaming= True)
295
+ for sample in iter(data['train']):
296
+ print(sample)
297
+ ```
298
+
299
+ A back up dataset can be downloaded in azure storage. See [Download The Vault from Azure blob storage](https://github.com/FSoft-AI4Code/TheVault#download-via-link).
300
+
301
+ ## Additional information
302
+ ### Licensing Information
303
+ MIT License
304
+
305
+ ### Citation Information
306
+
307
+ ```
308
+ @article{manh2023vault,
309
+ title={The Vault: A Comprehensive Multilingual Dataset for Advancing Code Understanding and Generation},
310
+ author={Manh, Dung Nguyen and Hai, Nam Le and Dau, Anh TV and Nguyen, Anh Minh and Nghiem, Khanh and Guo, Jin and Bui, Nghi DQ},
311
+ journal={arXiv preprint arXiv:2305.06156},
312
+ year={2023}
313
+ }
314
+ ```
315
+
316
+ ### Contributions
317
+ This dataset is developed by [FSOFT AI4Code team](https://github.com/FSoft-AI4Code).