Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,68 @@
|
|
| 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-text/python in Semeru
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
# CodeXGLUE -- Code-To-Text
|
| 12 |
+
|
| 13 |
+
## Task Definition
|
| 14 |
+
|
| 15 |
+
The task is to generate natural language comments for a code, and evaluted by [smoothed bleu-4](https://www.aclweb.org/anthology/C04-1072.pdf) score.
|
| 16 |
+
|
| 17 |
+
## Dataset
|
| 18 |
+
|
| 19 |
+
The dataset we use comes from [CodeSearchNet](https://arxiv.org/pdf/1909.09436.pdf) and we filter the dataset as the following:
|
| 20 |
+
|
| 21 |
+
- Remove examples that codes cannot be parsed into an abstract syntax tree.
|
| 22 |
+
- Remove examples that #tokens of documents is < 3 or >256
|
| 23 |
+
- Remove examples that documents contain special tokens (e.g. <img ...> or https:...)
|
| 24 |
+
- Remove examples that documents are not English.
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
### Data Format
|
| 28 |
+
|
| 29 |
+
After preprocessing dataset, you can obtain three .jsonl files, i.e. train.jsonl, valid.jsonl, test.jsonl
|
| 30 |
+
|
| 31 |
+
For each file, each line in the uncompressed file represents one function. One row is illustrated below.
|
| 32 |
+
|
| 33 |
+
- **repo:** the owner/repo
|
| 34 |
+
|
| 35 |
+
- **path:** the full path to the original file
|
| 36 |
+
|
| 37 |
+
- **func_name:** the function or method name
|
| 38 |
+
|
| 39 |
+
- **original_string:** the raw string before tokenization or parsing
|
| 40 |
+
|
| 41 |
+
- **language:** the programming language
|
| 42 |
+
|
| 43 |
+
- **code/function:** the part of the `original_string` that is code
|
| 44 |
+
|
| 45 |
+
- **code_tokens/function_tokens:** tokenized version of `code`
|
| 46 |
+
|
| 47 |
+
- **docstring:** the top-level comment or docstring, if it exists in the original string
|
| 48 |
+
|
| 49 |
+
- **docstring_tokens:** tokenized version of `docstring`
|
| 50 |
+
|
| 51 |
+
### Data Statistic
|
| 52 |
+
|
| 53 |
+
| Programming Language | Training | Dev | Test |
|
| 54 |
+
| :------------------- | :------: | :----: | :----: |
|
| 55 |
+
| Python | 251,820 | 13,914 | 14,918 |
|
| 56 |
+
| PHP | 241,241 | 12,982 | 14,014 |
|
| 57 |
+
| Go | 167,288 | 7,325 | 8,122 |
|
| 58 |
+
| Java | 164,923 | 5,183 | 10,955 |
|
| 59 |
+
| JavaScript | 58,025 | 3,885 | 3,291 |
|
| 60 |
+
| Ruby | 24,927 | 1,400 | 1,261 |
|
| 61 |
+
|
| 62 |
+
## Reference
|
| 63 |
+
<pre><code>@article{husain2019codesearchnet,
|
| 64 |
+
title={Codesearchnet challenge: Evaluating the state of semantic code search},
|
| 65 |
+
author={Husain, Hamel and Wu, Ho-Hsiang and Gazit, Tiferet and Allamanis, Miltiadis and Brockschmidt, Marc},
|
| 66 |
+
journal={arXiv preprint arXiv:1909.09436},
|
| 67 |
+
year={2019}
|
| 68 |
+
}</code></pre>
|