File size: 3,808 Bytes
dd04610
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c8441bc
 
 
 
 
 
 
 
 
 
 
 
 
 
dd04610
 
c8441bc
dd04610
c8441bc
 
dd04610
 
 
 
 
 
 
440c0a7
c909e1b
440c0a7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cca657d
 
 
 
 
 
 
440c0a7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
dataset_info:
  features:
  - name: repo
    dtype: string
  - name: commit_hash
    dtype: string
  - name: completion_file
    struct:
    - name: filename
      dtype: string
    - name: content
      dtype: string
  - name: completion_lines
    struct:
    - name: infile
      sequence: int32
    - name: inproject
      sequence: int32
    - name: common
      sequence: int32
    - name: commited
      sequence: int32
    - name: non_informative
      sequence: int32
    - name: random
      sequence: int32
  - name: repo_snapshot
    sequence:
    - name: filename
      dtype: string
    - name: content
      dtype: string
  - name: completion_lines_raw
    struct:
    - name: commited
      sequence: int64
    - name: common
      sequence: int64
    - name: infile
      sequence: int64
    - name: inproject
      sequence: int64
    - name: non_informative
      sequence: int64
    - name: other
      sequence: int64
  splits:
  - name: test
    num_bytes: 111010036
    num_examples: 144
  download_size: 37603701
  dataset_size: 111010036
configs:
- config_name: default
  data_files:
  - split: test
    path: data/test-*
---

# LCA Project Level Code Completion

## How to load the dataset

```
from datasets import load_dataset

ds = load_dataset('JetBrains-Research/lca-codegen-small', split='test')
```

## Data Point Structure

* `repo` – repository name in format `{GitHub_user_name}__{repository_name}`
* `commit_hash` – commit hash
* `completion_file` – dictionary with the completion file content in the following format:
* `filename` – filepath to the completion file
* `content` – content of the completion file
* `completion_lines` – dictionary where keys are classes of lines and values are a list of integers (numbers of lines to complete). The classes are:
  * `committed` – line contains at least one function or class that was declared in the committed files from `commit_hash`
  * `inproject` – line contains at least one function or class that was declared in the project (excluding previous)
  * `infile` – line contains at least one function or class that was declared in the completion file (excluding previous)
  * `common` – line contains at least one function or class that was classified to be common, e.g., `main`, `get`, etc (excluding previous)
  * `non_informative` – line that was classified to be non-informative, e.g. too short, contains comments, etc
  * `random` – randomly sampled from the rest of the lines
* `repo_snapshot` – dictionary with a snapshot of the repository before the commit. Has the same structure as `completion_file`, but filenames and contents are organized as lists.
* `completion_lines_raw` – the same as `completion_lines`, but before sampling.

## How we collected the data

To collect the data, we cloned repositories from GitHub where the main language is Python.
The completion file for each data point is a `.py` file that was added to the repository in a commit.
The state of the repository before this commit is the repo snapshot.

Small dataset is defined by number of characters in `.py` files from the repository snapshot. This number is less than 48K.

## Dataset Stats

* Number of datapoints: 144
* Number of repositories: 46
* Number of commits: 63

### Completion File
* Number of lines, median: 310.5
* Number of lines, min: 201
* Number of lines, max: 1916

### Repository Snapshot
* `.py` files: <u>median 4</u>, from 0 to 52
* non `.py` files: <u>median 19.5</u>, from 1 to 1044
* `.py` lines: <u>median 128</u>
* non `.py` lines: <u>median 1227</u>

### Line Counts:
* infile: 1430
* inproject: 95
* common: 500
* committed: 1426
* non-informative: 532
* random: 703
* **total**: 4686

## Scores
[HF Space](https://huggingface.co/spaces/JetBrains-Research/long-code-arena)