Fsoft-AIC/the-vault-function

Dataset

19

stars

118

commits

1

linked in READMEs

Oct 15, 2024

updated

README

Table of Contents

Dataset Description

logo

The Vault: A Comprehensive Multilingual Dataset for Advancing Code Understanding and Generation

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 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
PyMT51≈ 7,700,000
CoDesc14,211,516
CodeSearchNet62,326,976
CodeSearchNet (CodeXGLUE)61,005,474
Deepcom1424,028
CONCODE12,184,310
Funcom12,149,121
CodeT583,158,313
The Vault1034,098,775
  • Statistic for split sets
train/smalltrain/mediumtrain/fullvalidationtesttotal
Python370,6571,952,1107,772,64730,99221,6527,825,291
Java351,2131,612,3666,629,19322,67715,5526,667,422
JavaScript82,931404,7291,640,41622,04421,1081,683,568
PHP236,6381,155,4764,656,37121,37519,0104,696,756
C105,978381,2071,639,31927,52519,1221,685,966
C#141,090783,1663,305,89124,78719,6383,350,316
C++87,420410,9071,671,26820,01118,1691,709,448
Go267,5351,319,5475,109,02019,10225,3145,153,436
Ruby23,921112,574424,33917,33819,908461,585
Rust35,367224,015825,13016,71623,141864,987
TOTAL1,702,7508,356,09733,673,594222,567202,61434,098,775

Usage

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

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.

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.

Contributors

NamCyan

117 commits

ssadhu

1 commits

Fsoft-AIC/the-vault-function

Dataset

19

stars

118

commits

1

linked in READMEs

Oct 15, 2024

updated

README

Table of Contents

Dataset Description

logo

The Vault: A Comprehensive Multilingual Dataset for Advancing Code Understanding and Generation

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 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
PyMT51≈ 7,700,000
CoDesc14,211,516
CodeSearchNet62,326,976
CodeSearchNet (CodeXGLUE)61,005,474
Deepcom1424,028
CONCODE12,184,310
Funcom12,149,121
CodeT583,158,313
The Vault1034,098,775
  • Statistic for split sets
train/smalltrain/mediumtrain/fullvalidationtesttotal
Python370,6571,952,1107,772,64730,99221,6527,825,291
Java351,2131,612,3666,629,19322,67715,5526,667,422
JavaScript82,931404,7291,640,41622,04421,1081,683,568
PHP236,6381,155,4764,656,37121,37519,0104,696,756
C105,978381,2071,639,31927,52519,1221,685,966
C#141,090783,1663,305,89124,78719,6383,350,316
C++87,420410,9071,671,26820,01118,1691,709,448
Go267,5351,319,5475,109,02019,10225,3145,153,436
Ruby23,921112,574424,33917,33819,908461,585
Rust35,367224,015825,13016,71623,141864,987
TOTAL1,702,7508,356,09733,673,594222,567202,61434,098,775

Usage

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

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.

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.

Contributors

NamCyan

117 commits

ssadhu

1 commits