Datasets:

Modalities:
Text
Formats:
parquet
ArXiv:
DOI:
Libraries:
Datasets
pandas
License:
File size: 6,347 Bytes
aff5df5
 
9948596
aff5df5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9948596
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
aff5df5
 
 
 
 
9948596
 
 
 
aff5df5
19c2217
aff5df5
19c2217
40b9782
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19c2217
 
 
40b9782
 
 
19c2217
 
 
 
40b9782
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19c2217
40b9782
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19c2217
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
---
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
    struct:
    - name: diff
      list:
      - name: change_type
        dtype: string
      - name: new_path
        dtype: string
      - name: old_path
        dtype: string
      - name: diff
        dtype: string
    - name: file_src
      struct:
      - name: old_path
        dtype: string
      - name: new_path
        dtype: string
      - name: old_contents
        dtype: string
      - name: new_contents
        dtype: string
  splits:
  - name: test
    num_bytes: 1225963
    num_examples: 163
  download_size: 485771
  dataset_size: 1225963
- 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
  download_size: 155079
  dataset_size: 272359
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 Commit Message Generation task as part of 🏟️ Long Code Arena benchmark.

## How-to

1. Since the dataset is private, if you haven't used HF Hub before, add your token via `huggingface-cli` first:

    ```
    huggingface-cli login
    ```

2. 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
   

3. 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 inthe  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`       | Modifications from commit (see below for details).  |

We consider two possible commit modifications formats:
* lists of file diffs
* full file sources before and after commit


Currently, only [CommitChronicle](https://huggingface.co/datasets/JetBrains-Research/commit-chronicle) is considered as an input source, so only the first commit modifications format is used.

#### List of diffs (CommitChronicle)

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': {'diff': [{'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<...>'}],
  'file_src': None}}    
```

### 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 current commit as a target for CMG task.    |
|     `comment`      |  Comment for a label for 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 [`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).