Datasets:

ArXiv:
License:
File size: 11,345 Bytes
0c72583
 
 
 
 
 
 
 
36680c8
0c72583
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9ddbcc3
e3e48d8
0c72583
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36680c8
0c72583
 
 
a1fdc0c
29e66d7
a1fdc0c
0c72583
f201292
 
2b8d7a2
f201292
 
2b8d7a2
0c72583
02a5a63
 
 
0c72583
 
5d75097
0c72583
 
 
 
 
 
 
 
 
 
a43e67d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0c72583
a43e67d
0c72583
 
 
 
a6fb909
0c72583
 
0d5862e
0c72583
 
 
 
 
 
10b24c3
0c72583
10b24c3
a6fb909
10b24c3
 
 
0c72583
 
10b24c3
 
0c72583
 
8bdeb79
edc339a
02421de
0c72583
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d02771e
0c72583
02421de
b3495f4
 
54142b6
 
 
 
 
 
 
 
 
 
 
 
 
0c72583
 
 
 
 
 
 
7c70688
fb124e7
0c72583
 
fb124e7
0c72583
062e4ba
fb124e7
0c72583
38896f7
 
 
 
24c171a
38896f7
1252c62
0c72583
 
654abad
10b24c3
0c72583
 
a6fb909
57a2830
0c72583
 
 
9b5b4f3
 
 
 
 
0c72583
 
 
c459c15
 
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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
---
language:
- code
- en
multilinguality:
- multiprogramming languages
task_categories:
- text-generation
license: mit
dataset_info:
  features:
  - name: identifier
    dtype: string
  - name: return_type
    dtype: string
  - name: repo
    dtype: string
  - name: path
    dtype: string
  - name: language
    dtype: string
  - name: code
    dtype: string
  - name: code_tokens
    dtype: string
  - name: original_docstring
    dtype: string
  - name: comment
    dtype: string
  - name: docstring_tokens
    dtype: string
  - name: docstring
    dtype: string
  - name: original_string
    dtype: string
pretty_name: The Vault Function
viewer: true
---



## Table of Contents
- [Dataset Description](#dataset-description)
- [Dataset Summary](#dataset-summary)
- [Supported Tasks](#supported-tasks)
- [Languages](#languages)
- [Dataset Structure](#dataset-structure)
  - [Data Instances](#data-instances)
  - [Data Fields](#data-fields)
  - [Data Splits](#data-splits)
- [Dataset Statistics](#dataset-statistics)
- [Usage](#usage)
- [Additional Information](#additional-information)
  - [Licensing Information](#licensing-information)
  - [Citation Information](#citation-information)
  - [Contributions](#contributions)


## Dataset Description

- **Repository:** [FSoft-AI4Code/TheVault](https://github.com/FSoft-AI4Code/TheVault)
- **Paper:** [The Vault: A Comprehensive Multilingual Dataset for Advancing Code Understanding and Generation](https://arxiv.org/abs/2305.06156)
- **Contact:** support.ailab@fpt.com
- **Website:** https://www.fpt-aicenter.com/ai-residency/

<p align="center">
  <img src="https://raw.githubusercontent.com/FSoft-AI4Code/TheVault/main/assets/the-vault-4-logo-png.png" width="300px" alt="logo">
</p>

<div align="center">
  
# The Vault: A Comprehensive Multilingual Dataset for Advancing Code Understanding and Generation
</div>


## Dataset Summary
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.

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.

## Supported Tasks
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*.

## Languages
The natural language text (docstring) is in English.

10 programming languages are supported in The Vault: `Python`, `Java`, `JavaScript`, `PHP`, `C`, `C#`, `C++`, `Go`, `Ruby`, `Rust`

## Dataset Structure
### Data Instances
```
{

    "hexsha": "5c47f0b4c173a8fd03e4e633d9b3dd8211e67ad0",
    "repo": "neumanna94/beepboop",
    "path": "js/scripts.js",
    "license": [
        "MIT"
    ],
    "language": "JavaScript",
    "identifier": "beepBoopSelector",
    "return_type": "<not_specific>",
    "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}",
    "original_docstring": "//Determines what beepBoop function to use",
    "docstring": "Determines what beepBoop function to use",
    "docstring_tokens": [
        "Determines",
        "what",
        "beepBoop",
        "function",
        "to",
        "use"
    ],
    "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}",
    "code_tokens": [
        "function",
        "beepBoopSelector",
        "(",
        "inputString",
        ",",
        "bbFunction",
        ")",
        "{",
        "if",
        "(",
        "bbFunction",
        "==",
        "1",
        ")",
        "{",
        "return",
        "beepBoop",
        "(",
        "inputString",
        ")",
        ";",
        "}",
        "else",
        "if",
        "(",
        "bbFunction",
        "==",
        "2",
        ")",
        "{",
        "return",
        "beepBoop2",
        "(",
        "inputString",
        ")",
        ";",
        "}",
        "else",
        "if",
        "(",
        "bbFunction",
        "==",
        "3",
        ")",
        "{",
        "return",
        "beepBoop3",
        "(",
        "inputString",
        ")",
        ";",
        "}",
        "else",
        "{",
        "}",
        "}"
    ],

    "short_docstring": "Determines what beepBoop function to use",
    "short_docstring_tokens": [
        "Determines",
        "what",
        "beepBoop",
        "function",
        "to",
        "use"
    ],
    "comment": [],
    "parameters": [
        {
            "param": "inputString",
            "type": null
        },
        {
            "param": "bbFunction",
            "type": null
        }
    ],
    "docstring_params": {
        "returns": [],
        "raises": [],
        "params": [
            {
                "identifier": "inputString",
                "type": null,
                "docstring": null,
                "docstring_tokens": [],
                "default": null,
                "is_optional": null
            },
            {
                "identifier": "bbFunction",
                "type": null,
                "docstring": null,
                "docstring_tokens": [],
                "default": null,
                "is_optional": null
            }
        ],
        "outlier_params": [],
        "others": []
    }
}

```
### Data Fields

Data fields for function level:
- **hexsha** (string): the unique git hash of file
- **repo** (string): the owner/repo
- **path** (string): the full path to the original file
- **license** (list): licenses in the repo
- **language** (string): the programming language
- **identifier** (string): the function or method name
- **return_type** (string): the type returned by the function
- **original_string** (string): original version of function/class node
- **original_docstring** (string): the raw string before tokenization or parsing
- **code** (string): the part of the original that is code
- **code_tokens** (list): tokenized version of `code`
- **short_docstring** (string): short, brief summarization (first line of the docstring)
- **short_docstring_tokens** (list): tokenized version of `short_docstring
- **docstring** (string): the top-level comment or docstring (docstring version without param’s doc, return, exception fields, etc)
- **docstring_tokens** (list): tokenized version of docstring
- **comment** (list): list of comments (line) inside the function/class
- **parameters** (list):  List of parameters and its type (type can be None)
- **docstring_params** (dict): Dictionary of the parsed information from docstring

See [here](https://github.com/FSoft-AI4Code/TheVault/blob/main/data/README.md) for more details and examples.

### Data Splits

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.

Before split, the dataset is deduplicated. There are 3 versions of training set that are small (5%), medium (20%) and large (100%).

## Dataset Statistics

- Compare to other benchmarks

| Dataset                   | #Language | #Code-text pair |
|:--------------------------|----------:|-----------------:|
| PyMT5                     | 1         | ≈ 7,700,000      |
| CoDesc                    | 1         | 4,211,516        |
| CodeSearchNet             | 6         | 2,326,976        |
| CodeSearchNet (CodeXGLUE) | 6         | 1,005,474        |
| Deepcom                   | 1         | 424,028          |
| CONCODE                   | 1         | 2,184,310        |
| Funcom                    | 1         | 2,149,121        |
| CodeT5                    | 8         | 3,158,313        |
| **The Vault**             | **10**    | **34,098,775**   |

- Statistic for split sets


|            | train/small | train/medium | train/full | validation | test   | total         |
|:-----------|------------:|-------------:|-----------:|-----------:|-------:|--------------:|
|Python      |   370,657   |  1,952,110   | 7,772,647  | 30,992     | 21,652 | 7,825,291     |
|Java        |   351,213   |  1,612,366   | 6,629,193  | 22,677     | 15,552 | 6,667,422     |
|JavaScript  |    82,931   |    404,729   | 1,640,416  | 22,044     | 21,108 | 1,683,568     |
|PHP         |   236,638   |  1,155,476   | 4,656,371  | 21,375     | 19,010 | 4,696,756     |
|C           |   105,978   |    381,207   | 1,639,319  | 27,525     | 19,122 | 1,685,966     |
|C#          |   141,090   |    783,166   | 3,305,891  | 24,787     | 19,638 | 3,350,316     |
|C++         |    87,420   |    410,907   | 1,671,268  | 20,011     | 18,169 | 1,709,448     |
|Go          |   267,535   |  1,319,547   | 5,109,020  | 19,102     | 25,314 | 5,153,436     |
|Ruby        |    23,921   |    112,574   |   424,339  | 17,338     | 19,908 |   461,585     |
|Rust        |    35,367   |    224,015   |   825,130  | 16,716     | 23,141 |   864,987     |
|TOTAL       | 1,702,750   |  8,356,097   |33,673,594  |222,567     |202,614 |**34,098,775** |

## Usage
You can load The Vault dataset using datasets library: ```pip install datasets```

```python
from datasets import load_dataset

# Load full function level dataset (34M samples)
dataset = load_dataset("Fsoft-AIC/the-vault-function")

# Load function level train/validation/test set
dataset = load_dataset("Fsoft-AIC/the-vault-function", split_set=["train"])

# Load "small" (or "medium", "full") version of function level training set
dataset = load_dataset("Fsoft-AIC/the-vault-function", split_set=["train/small"])

# specific language (e.g. Python) 
dataset = load_dataset("Fsoft-AIC/the-vault-function", split_set=["train"], languages=['Python'])

# dataset streaming
data = load_dataset("Fsoft-AIC/the-vault-function", split_set= ["train"], streaming= True)
for sample in iter(data['train']): 
    print(sample)
```

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).

## Additional information
### Licensing Information
MIT License

### Citation Information

```
@article{manh2023vault,
  title={The Vault: A Comprehensive Multilingual Dataset for Advancing Code Understanding and Generation},
  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},
  journal={arXiv preprint arXiv:2305.06156},
  year={2023}
}
```

### Contributions
This dataset is developed by [FSOFT AI4Code team](https://github.com/FSoft-AI4Code).