Updated readme
Browse files
README.md
CHANGED
@@ -1,3 +1,58 @@
|
|
1 |
---
|
2 |
license: mit
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: mit
|
3 |
---
|
4 |
+
|
5 |
+
### Dataset is imported from CodeXGLUE and pre-processed using their script.
|
6 |
+
|
7 |
+
# Where to find in Semeru:
|
8 |
+
The dataset can be found at /nfs/semeru/semeru_datasets/code_xglue/code-to-code/Method-Generation/dataset/codexglue_method_generation in Semeru
|
9 |
+
|
10 |
+
|
11 |
+
# CodeXGLUE -- Method Generation
|
12 |
+
|
13 |
+
Here is the introduction and pipeline for method generation task.
|
14 |
+
|
15 |
+
## Task Definition
|
16 |
+
|
17 |
+
Method generation is the prediction of a method body implementation conditioned on a signature, a docstring, and any more context.
|
18 |
+
|
19 |
+
## Dataset
|
20 |
+
|
21 |
+
We use CodeSearchNet Python dataset. The CodeSearchNet repositories are re-downloaded to extract all the methods, including their signatures, docstrings and bodies. We remove the methods that don't have docstrings and whose name contains 'test'. We preserve the context around this method for auxiliary information since it is really a difficult task to generator the method body only based on its signature/docstring. We also apply literal normalization for better user experience.
|
22 |
+
|
23 |
+
|
24 |
+
|
25 |
+
### Data Format
|
26 |
+
|
27 |
+
The data format of each line in `train/dev/test.jsonl` is:
|
28 |
+
```json
|
29 |
+
{
|
30 |
+
"signature": "def do_transform(self, v=<NUM_LIT:1>):",
|
31 |
+
"body": "if not self.transform:<EOL><INDENT>return<EOL><DEDENT>try:<EOL><INDENT>self.latest_value = utils.Transform ...",
|
32 |
+
"docstring": "Apply the transformation (if it exists) to the latest_value",
|
33 |
+
"id": "f19:c4:m1"
|
34 |
+
}
|
35 |
+
```
|
36 |
+
The `id` indicts where you can find this method in the raw data. In this instance, it means the 2nd method in the 2nd class in the 19th file. We apply literal normalization to function signature and body, replace `\n` with `<EOL>` and keep track in INDENT and DEDENT.
|
37 |
+
|
38 |
+
|
39 |
+
### Data Statistics
|
40 |
+
|
41 |
+
Data statistics are shown in the below table.
|
42 |
+
|
43 |
+
| Data Split | #Instances |
|
44 |
+
| ----------- | :---------: |
|
45 |
+
| Train | 893,538 |
|
46 |
+
| Dev | 20,000 |
|
47 |
+
| Test | 20,000 |
|
48 |
+
|
49 |
+
## Reference
|
50 |
+
|
51 |
+
|
52 |
+
|
53 |
+
<pre><code>@article{clement2021long,
|
54 |
+
title={Long-Range Modeling of Source Code Files with eWASH: Extended Window Access by Syntax Hierarchy},
|
55 |
+
author={Clement, Colin B and Lu, Shuai and Liu, Xiaoyu and Tufano, Michele and Drain, Dawn and Duan, Nan and Sundaresan, Neel and Svyatkovskiy, Alexey},
|
56 |
+
journal={arXiv preprint arXiv:2109.08780},
|
57 |
+
year={2021}
|
58 |
+
}</code></pre>
|