|
--- |
|
language: |
|
- code |
|
- en |
|
multilinguality: |
|
- multiprogramming languages |
|
task_categories: |
|
- text-generation |
|
license: mit |
|
dataset_info: |
|
features: |
|
- name: identifier |
|
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` |
|
|
|
*Note: C and Go are not contained in this repo due to the nonexistence of traditional classes in these languages.* |
|
|
|
## Dataset Structure |
|
### Data Instances |
|
``` |
|
{ |
|
|
|
"hexsha": "5c47f0b4c173a8fd03e4e633d9b3dd8211e67ad0", |
|
"repo": "neumanna94/beepboop", |
|
"path": "js/scripts.js", |
|
"license": [ |
|
"MIT" |
|
], |
|
"language": "JavaScript", |
|
"identifier": "beepBoopSelector", |
|
"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 |
|
- **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 class level data is not split, and contained in only train set. |
|
|
|
## Dataset Statistics |
|
|
|
|Language | Number of samples | |
|
|:-----------|------------------------:| |
|
|Python | 353,859 | |
|
|Java | 4,069,174 | |
|
|JavaScript | 236,525 | |
|
|PHP | 969,667 | |
|
|C# | 1,138,603 | |
|
|C++ | 150,530 | |
|
|Ruby | 62,464 | |
|
|Rust | 301,893 | |
|
|C | - | |
|
|Go | - | |
|
|TOTAL | **7,282,715** | |
|
|
|
## Usage |
|
You can load The Vault dataset using datasets library: ```pip install datasets``` |
|
|
|
```python |
|
from datasets import load_dataset |
|
|
|
# Load full class level dataset |
|
dataset = load_dataset("Fsoft-AIC/the-vault-class") |
|
|
|
# specific language (e.g. Python) |
|
dataset = load_dataset("Fsoft-AIC/the-vault-class", languages=['Python']) |
|
|
|
# dataset streaming |
|
data = load_dataset("Fsoft-AIC/the-vault-class", 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). |