File size: 2,448 Bytes
7fa6efe cb7deb6 7fa6efe 24da422 |
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 |
---
license: mit
Programminglanguage: "python"
version: "N/A"
Date: "Codesearchnet(Jun 2020 - paper release date)"
Contaminated: "Very Likely"
Size: "Standard Tokenizer (TreeSitter)"
---
### Dataset is imported from CodeXGLUE and pre-processed using their script.
# Where to find in Semeru:
The dataset can be found at /nfs/semeru/semeru_datasets/code_xglue/code-to-code/Method-Generation/dataset/codexglue_method_generation in Semeru
# CodeXGLUE -- Method Generation
Here is the introduction and pipeline for method generation task.
## Task Definition
Method generation is the prediction of a method body implementation conditioned on a signature, a docstring, and any more context.
## Dataset
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.
### Data Format
The data format of each line in `train/dev/test.jsonl` is:
```json
{
"signature": "def do_transform(self, v=<NUM_LIT:1>):",
"body": "if not self.transform:<EOL><INDENT>return<EOL><DEDENT>try:<EOL><INDENT>self.latest_value = utils.Transform ...",
"docstring": "Apply the transformation (if it exists) to the latest_value",
"id": "f19:c4:m1"
}
```
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.
### Data Statistics
Data statistics are shown in the below table.
| Data Split | #Instances |
| ----------- | :---------: |
| Train | 893,538 |
| Dev | 20,000 |
| Test | 20,000 |
## Reference
<pre><code>@article{clement2021long,
title={Long-Range Modeling of Source Code Files with eWASH: Extended Window Access by Syntax Hierarchy},
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},
journal={arXiv preprint arXiv:2109.08780},
year={2021}
}</code></pre>
|