Datasets:

ArXiv:
License:
File size: 7,273 Bytes
6a630bc
a480046
 
 
 
 
 
 
6a630bc
a480046
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
022bc73
6a630bc
a480046
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b4a95c8
 
 
a480046
 
 
 
 
 
 
 
 
 
 
 
 
628aeb6
 
 
a480046
 
 
628aeb6
 
 
a480046
628aeb6
 
a480046
628aeb6
a480046
628aeb6
 
 
a480046
628aeb6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a480046
628aeb6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a480046
 
 
 
 
2913fa3
a480046
 
 
 
 
 
 
 
3a4657b
 
 
 
 
 
 
a480046
 
 
 
2913fa3
a480046
 
 
 
774181c
2c20b94
 
 
 
 
 
 
 
 
 
 
 
a480046
 
 
 
 
 
 
2207857
a480046
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
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:** [email protected]
- **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": "ee1cf38808d3db0ea364b049509a01a65e6e5589",
    "repo": "Waguy02/Boomer-Scripted",
    "path": "python/subprojects/testbed/mlrl/testbed/persistence.py",
    "license": [
        "MIT"
    ],
    "language": "Python",
    "identifier": "__init__",
    "code": "def __init__(self, model_dir: str):\n        \"\"\"\n        :param model_dir: The path of the directory where models should be saved\n        \"\"\"\n        self.model_dir = model_dir",
    "code_tokens": [
        "def",
        "__init__",
        "(",
        "self",
        ",",
        "model_dir",
        ":",
        "str",
        ")",
        ":",
        "\"\"\"\n        :param model_dir: The path of the directory where models should be saved\n        \"\"\"",
        "self",
        ".",
        "model_dir",
        "=",
        "model_dir"
    ],
    "original_comment": "\"\"\"\n        :param model_dir: The path of the directory where models should be saved\n        \"\"\"",
    "comment": ":param model_dir: The path of the directory where models should be saved",
    "comment_tokens": [
        ":",
        "param",
        "model_dir",
        ":",
        "The",
        "path",
        "of",
        "the",
        "directory",
        "where",
        "models",
        "should",
        "be",
        "saved"
    ],
    "start_point": [
        1,
        8
    ],
    "end_point": [
        3,
        11
    ],
    "prev_context": {
        "code": null,
        "start_point": null,
        "end_point": null
    },
    "next_context": {
        "code": "self.model_dir = model_dir",
        "start_point": [
            4,
            8
        ],
        "end_point": [
            4,
            34
        ]
    }
}

```
### Data Fields

Data fields for inline 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
- **code** (string): the part of the original that is code
- **code_tokens** (list): tokenized version of `code`
- **original_comment** (string): original text of comment ,
- **comment** (string): clean version of comment,
- **comment_tokens** (list): tokenized version of `comment`,
- **start_point** (int): start position of `original_comment` in `code`,
- **end_point** (int): end position of `original_comment` in `code`,
- **prev_context** (dict): block of code before `original_comment`,
- **next_context** (dict):  block of code after `original_comment`


### Data Splits

In this repo, the inline level data is not split, and contained in only train set.

## Dataset Statistics


| Languages  | Number of inline comments  |
|:-----------|---------------------------:|
|Python      |   14,013,238               |
|Java        |   17,062,277               |
|JavaScript  |    1,438,110               |
|PHP         |    5,873,744               |
|C           |    6,778,239               |
|C#          |    6,274,389               |
|C++         |   10,343,650               |
|Go          |    4,390,342               |
|Ruby        |      767,563               |
|Rust        |    2,063,784               |
|TOTAL       | **69,005,336**             |

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

```python
from datasets import load_dataset

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


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

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


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