---
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
splits:
- name: python
num_bytes: 30797754227
num_examples: 9893858
- name: java
num_bytes: 23130202517
num_examples: 7886299
- name: javascript
num_bytes: 6833869001
num_examples: 2562158
- name: php
num_bytes: 13072500520
num_examples: 5455989
- name: c_sharp
num_bytes: 11144245789
num_examples: 4011467
- name: c
num_bytes: 6205820571
num_examples: 1978551
- name: cpp
num_bytes: 6228306797
num_examples: 1934958
- name: go
num_bytes: 11339059495
num_examples: 5649158
- name: rust
num_bytes: 2661037428
num_examples: 1076588
- name: ruby
num_bytes: 1224195690
num_examples: 544867
download_size: 26404353470
dataset_size: 112636992035
pretty_name: The Vault
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/
# The Vault: A Comprehensive Multilingual Dataset for Advancing Code Understanding and Generation
## Dataset Summary
The Vault is a multilingual code-text dataset with over 40 million pairs covering 10 popular programming languages. It is the largest corpus containing parallel code-text data. By building upon [The Stack](https://huggingface.co/datasets/bigcode/the-stack), a massive raw code sample collection, the Vault offers a comprehensive and clean resource for advancing research in code understanding and generation. It provides a high-quality dataset that includes code-text pairs at multiple levels, such as class and inline-level, in addition to the function level. The Vault can serve many purposes at multiple levels.
## Supported Tasks
The Vault can be used for pretraining LLMs or downstream code-text interaction tasks. A number of tasks 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
```
{
"repo": "irshadbhat/sndpcs",
"path": "arc_eager.py",
"license": "MIT"
"identifier": "REDUCE",
"return_type": ""
"language": "Python",
"code": "def REDUCE(self, configuration, label=None):\n b0 = configuration.b0\n configuration.stack.pop()",
"code_tokens": "def REDUCE ( self , configuration , label = None ) : b0 = configuration . b0 configuration . stack . pop ( )",
"original_docstring": "\n pops the top of the stack if it has got its head.\n ",
"comment": "\"\"\"\n pops the top of the stack if it has got its head.\n \"\"\"",
"docstring_tokens": "pops the top of the stack if it has got its head .",
"docstring": "pops the top of the stack if it has got its head."
}
```
### Data Fields
Data fields for function level:
- **repo** (string): the owner/repo
- **path** (string): the full path to the original file
- **license** (list): license 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, 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 dataset size, and the remains are validation set and test set (20,000 samples in each). The statistic for each language is illustrated in the following section.
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** | **40,993,893** |
- Statistic for each language in The Vault
| Language | #Code-text pair | #Repository |
|:-----------|-----------------:|------------:|
| Python | 9,893,858 | 628,069 |
| PHP | 5,455,989 | 439,514 |
| JavaScript | 2,562,158 | 355,761 |
| Java | 7,886,299 | 321,129 |
| C# | 4,011,467 | 150,657 |
| C++ | 1,934,958 | 116,897 |
| C | 1,978,551 | 88,556 |
| Go | 5,649,158 | 241,238 |
| Rust | 1,076,588 | 68,615 |
| Ruby | 544,867 | 61,804 |
## Usage
You can load The Vault dataset using datasets library: ```pip install datasets```
```python
from datasets import load_dataset
# Load full function level dataset (40M 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", "large") 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"])
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/blob/main/README.md#download-data-from-azure-blob-storage)
## Additional information
### Licensing Information
[More information needed]
### Citation Information
```
@misc{manh2023vault,
title={The Vault: A Comprehensive Multilingual Dataset for Advancing Code Understanding and Generation},
author={Dung Nguyen Manh and Nam Le Hai and Anh T. V. Dau and Anh Minh Nguyen and Khanh Nghiem and Jin Guo and Nghi D. Q. Bui},
year={2023},
}
```
### Contributions
This dataset is developed by [FSOFT AI4Code team](https://github.com/FSoft-AI4Code).