|
--- |
|
dataset_info: |
|
- config_name: commitchronicle-py-long |
|
features: |
|
- name: hash |
|
dtype: string |
|
- name: repo |
|
dtype: string |
|
- name: date |
|
dtype: string |
|
- name: license |
|
dtype: string |
|
- name: message |
|
dtype: string |
|
- name: mods |
|
list: |
|
- name: change_type |
|
dtype: string |
|
- name: old_path |
|
dtype: string |
|
- name: new_path |
|
dtype: string |
|
- name: diff |
|
dtype: string |
|
splits: |
|
- name: test |
|
num_examples: 163 |
|
- config_name: commitchronicle-py-long-labels |
|
features: |
|
- name: hash |
|
dtype: string |
|
- name: repo |
|
dtype: string |
|
- name: date |
|
dtype: string |
|
- name: license |
|
dtype: string |
|
- name: message |
|
dtype: string |
|
- name: label |
|
dtype: int8 |
|
- name: comment |
|
dtype: string |
|
splits: |
|
- name: test |
|
num_bytes: 272359 |
|
num_examples: 858 |
|
configs: |
|
- config_name: commitchronicle-py-long |
|
data_files: |
|
- split: test |
|
path: commitchronicle-py-long/test-* |
|
- config_name: commitchronicle-py-long-labels |
|
data_files: |
|
- split: test |
|
path: commitchronicle-py-long-labels/test-* |
|
--- |
|
|
|
# ๐๏ธ Long Code Arena (Commit message generation) |
|
|
|
This is the benchmark for the Commit message generation task as part of the |
|
๐๏ธ [Long Code Arena benchmark](https://huggingface.co/spaces/JetBrains-Research/long-code-arena). |
|
|
|
The current version is a manually curated subset of the Python test set from the ๐ค [CommitChronicle dataset](https://huggingface.co/datasets/JetBrains-Research/commit-chronicle), tailored for larger commits. |
|
|
|
## How-to |
|
|
|
1. List all the available configs |
|
via [`datasets.get_dataset_config_names`](https://huggingface.co/docs/datasets/v2.14.3/en/package_reference/loading_methods#datasets.get_dataset_config_names) |
|
and choose an appropriate one. |
|
|
|
Current configs: `commitchronicle-py-long`, `commitchronicle-py-long-labels` |
|
|
|
2. Load the data |
|
via [`load_dataset`](https://huggingface.co/docs/datasets/v2.14.3/en/package_reference/loading_methods#datasets.load_dataset): |
|
|
|
``` |
|
from datasets import load_dataset |
|
|
|
configuration = "TODO" # select a configuration |
|
dataset = load_dataset("JetBrains-Research/lca-cmg", configuration, split="test") |
|
``` |
|
|
|
Note that all the data we have is considered to be in the test split. |
|
|
|
**Note.** Working with git repositories |
|
under [`repos`](https://huggingface.co/datasets/JetBrains-Research/lca-cmg/tree/main/repos) directory is not supported |
|
via ๐ค Datasets. Download and extract the contents of each repository. We provide a full list of files |
|
in [`paths.json`](https://huggingface.co/datasets/JetBrains-Research/lca-cmg/blob/main/paths.json). |
|
|
|
## Dataset Structure |
|
|
|
This dataset contains three kinds of data: |
|
|
|
* *full data* about each commit (including modifications) |
|
* metadata with quality *labels* |
|
* compressed *git repositories* |
|
|
|
### Full data |
|
|
|
This section concerns configuration with *full data* about each commit (no `-labels` suffix). |
|
|
|
Each example has the following fields: |
|
|
|
| **Field** | **Description** | |
|
|:---------:|:-----------------------------------------:| |
|
| `repo` | Commit repository. | |
|
| `hash` | Commit hash. | |
|
| `date` | Commit date. | |
|
| `license` | Commit repository's license. | |
|
| `message` | Commit message. | |
|
| `mods` | List of file modifications from a commit. | |
|
|
|
Each file modification has the following fields: |
|
|
|
| **Field** | **Description** | |
|
|:-------------:|:-------------------------------------------------------------------------------------------------:| |
|
| `change_type` | Type of change to current file. One of: `ADD`, `COPY`, `RENAME`, `DELETE`, `MODIFY` or `UNKNOWN`. | |
|
| `old_path` | Path to file before change (might be empty). | |
|
| `new_path` | Path to file after change (might be empty). | |
|
| `diff` | `git diff` for current file. | |
|
|
|
Data point example: |
|
|
|
``` |
|
{'hash': 'b76ed0db81b3123ede5dc5e5f1bddf36336f3722', |
|
'repo': 'apache/libcloud', |
|
'date': '05.03.2022 17:52:34', |
|
'license': 'Apache License 2.0', |
|
'message': 'Add tests which verify that all OpenStack driver can be instantiated\nwith all the supported auth versions.\nNOTE: Those tests will fail right now due to the regressions being\nintroduced recently which breaks auth for some versions.', |
|
'mods': [{'change_type': 'MODIFY', |
|
'new_path': 'libcloud/test/compute/test_openstack.py', |
|
'old_path': 'libcloud/test/compute/test_openstack.py', |
|
'diff': '@@ -39,6 +39,7 @@ from libcloud.utils.py3 import u\n<...>'}], |
|
} |
|
``` |
|
|
|
### Labels |
|
|
|
This section concerns configuration with metadata and *labels* (with `-labels` suffix). |
|
|
|
Each example has the following fields: |
|
|
|
| **Field** | **Description** | |
|
|:---------:|:------------------------------------------------------------------:| |
|
| `repo` | Commit repository. | |
|
| `hash` | Commit hash. | |
|
| `date` | Commit date. | |
|
| `license` | Commit repository's license. | |
|
| `message` | Commit message. | |
|
| `label` | Label of the current commit as a target for CMG task. | |
|
| `comment` | Comment for a label for the current commit (optional, might be empty). | |
|
|
|
Labels are in 1โ5 scale, where: |
|
|
|
* 1 โ strong no |
|
* 2 โ weak no |
|
* 3 โ unsure |
|
* 4 โ weak yes |
|
* 5 โ strong yes |
|
|
|
Data point example: |
|
|
|
``` |
|
{'hash': '1559a4c686ddc2947fc3606e1c4279062cc9480f', |
|
'repo': 'appscale/gts', |
|
'date': '15.07.2018 21:00:39', |
|
'license': 'Apache License 2.0', |
|
'message': 'Add auto_id_policy and logs_path flags\n\nThese changes were introduced in the 1.7.5 SDK.', |
|
'label': 1, |
|
'comment': 'no way to know the version'} |
|
``` |
|
|
|
### Git Repositories |
|
|
|
This section concerns the [`repos`](https://huggingface.co/datasets/JetBrains-Research/lca-cmg/tree/main/repos) directory, |
|
which stores compressed Git repositories for all the commits in this benchmark. After you download and extract it, you |
|
can work with each repository either via Git or via Python libraries |
|
like [GitPython](https://github.com/gitpython-developers/GitPython) |
|
or [PyDriller](https://github.com/ishepard/pydriller). |
|
|