| | --- |
| | license: apache-2.0 |
| | task_categories: |
| | - text-generation |
| | - fill-mask |
| | language: |
| | - code |
| | size_categories: |
| | - 1K<n<10K |
| | dataset_info: |
| | - config_name: all |
| | features: |
| | - name: repository_name |
| | dtype: string |
| | - name: func_path_in_repository |
| | dtype: string |
| | - name: func_name |
| | dtype: string |
| | - name: whole_func_string |
| | dtype: string |
| | - name: language |
| | dtype: string |
| | - name: func_code_string |
| | dtype: string |
| | - name: func_code_tokens |
| | sequence: string |
| | - name: func_documentation_string |
| | dtype: string |
| | - name: func_documentation_tokens |
| | sequence: string |
| | - name: split_name |
| | dtype: string |
| | - name: func_code_url |
| | dtype: string |
| | splits: |
| | - name: train |
| | num_bytes: 5850604083 |
| | num_examples: 1880853 |
| | - name: test |
| | num_bytes: 308626333 |
| | num_examples: 100529 |
| | - name: validation |
| | num_bytes: 274564382 |
| | num_examples: 89154 |
| | download_size: 5117370511 |
| | dataset_size: 6433794798 |
| | - config_name: cpp |
| | features: |
| | - name: repository_name |
| | dtype: string |
| | - name: func_path_in_repository |
| | dtype: string |
| | - name: func_name |
| | dtype: string |
| | - name: whole_func_string |
| | dtype: string |
| | - name: language |
| | dtype: string |
| | - name: func_code_string |
| | dtype: string |
| | - name: func_code_tokens |
| | sequence: string |
| | - name: func_documentation_string |
| | dtype: string |
| | - name: func_documentation_tokens |
| | sequence: string |
| | - name: split_name |
| | dtype: string |
| | - name: func_code_url |
| | dtype: string |
| | splits: |
| | - name: train |
| | num_bytes: 1429272535 |
| | num_examples: 454451 |
| | - name: test |
| | num_bytes: 82377246 |
| | num_examples: 26909 |
| | - name: validation |
| | num_bytes: 42358315 |
| | num_examples: 15328 |
| | download_size: 1060569153 |
| | dataset_size: 1554008096 |
| | configs: |
| | - config_name: default |
| | data_files: |
| | - split: train |
| | path: "cpp_dataset/train/train.jsonl" |
| | - split: test |
| | path: "cpp_dataset/test/test.jsonl" |
| | - split: validation |
| | path: "cpp_dataset/validation/validation.jsonl" |
| | --- |
| | |
| | # C++ Dataset |
| | > documentation source: https://huggingface.co/docs/datasets/main/en/repository_structure |
| | |
| | |
| | |
| | ### Supported Tasks and Leaderboards |
| | |
| | - `language-modeling`: The dataset can be used to train a model for modelling programming languages, which consists in building language models for programming languages. |
| | |
| | ### Language |
| | |
| | - C++ **programming** language |
| | |
| | |
| | |
| | |
| | ## Dataset Structure |
| | |
| | ### Data Instances |
| | |
| | A data point consists of a function code along with its documentation. Each data point also contains meta data on the function, such as the repository it was extracted from. |
| | ``` |
| | { |
| | 'id': '0', |
| | 'repository_name': 'organisation/repository', |
| | 'func_path_in_repository': 'src/path/to/file.py', |
| | 'func_name': 'func', |
| | 'whole_func_string': 'def func(args):\n"""Docstring"""\n [...]', |
| | 'language': 'python', |
| | 'func_code_string': '[...]', |
| | 'func_code_tokens': ['def', 'func', '(', 'args', ')', ...], |
| | 'func_documentation_string': 'Docstring', |
| | 'func_documentation_string_tokens': ['Docstring'], |
| | 'split_name': 'train', |
| | 'func_code_url': 'https://github.com/<org>/<repo>/blob/<hash>/src/path/to/file.py#L111-L150' |
| | } |
| | ``` |
| | |
| | ### Data Fields |
| | |
| | - `id`: Arbitrary number |
| | - `repository_name`: name of the GitHub repository |
| | - `func_path_in_repository`: tl;dr: path to the file which holds the function in the repository |
| | - `func_name`: name of the function in the file |
| | - `whole_func_string`: Code + documentation of the function |
| | - `language`: Programming language in whoch the function is written |
| | - `func_code_string`: Function code |
| | - `func_code_tokens`: Tokens yielded by Treesitter |
| | - `func_documentation_string`: Function documentation |
| | - `func_documentation_string_tokens`: Tokens yielded by Treesitter |
| | - `split_name`: Name of the split to which the example belongs (one of train, test or valid) |
| | - `func_code_url`: URL to the function code on Github |
| | |
| | ### Data Splits |
| | |
| | Three splits are available: |
| | - train |
| | - test |
| | - valid |
| | |
| | ### Citation Information |
| | |
| | - based on (format and idea): https://huggingface.co/datasets/code_search_net/blob/main/code_search_net.py |
| | |
| | @article{husain2019codesearchnet, |
| | title={C++ Dataset}, |
| | author={Klaes, Malte}, |
| | year={2024} |
| | } |
| | |