claudios commited on
Commit
37b4b89
1 Parent(s): a5202c6

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +60 -0
README.md CHANGED
@@ -1,4 +1,5 @@
1
  ---
 
2
  license: apache-2.0
3
  dataset_info:
4
  features:
@@ -31,4 +32,63 @@ configs:
31
  path: data/dev-*
32
  - split: test
33
  path: data/test-*
 
 
 
 
 
34
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ arxiv: 2001.00059
3
  license: apache-2.0
4
  dataset_info:
5
  features:
 
32
  path: data/dev-*
33
  - split: test
34
  path: data/test-*
35
+ task_categories:
36
+ - text-classification
37
+ tags:
38
+ - code
39
+ pretty_name: CuBERT ETH Py150 Benchmarks
40
  ---
41
+
42
+ # CuBERT ETH150 Open Benchmarks
43
+
44
+ This is an unofficial HuggingFace upload of the [CuBERT ETH150 Open Benchmarks](https://github.com/google-research/google-research/tree/master/cubert). This dataset was released along with [Learning and Evaluating Contextual Embedding of Source Code](https://arxiv.org/abs/2001.00059).
45
+
46
+ ---
47
+
48
+ ## Benchmarks and Fine-Tuned Models
49
+
50
+ Here we describe the 6 Python benchmarks we created. All 6 benchmarks were derived from [ETH Py150 Open](https://github.com/google-research-datasets/eth_py150_open). All examples are stored as sharded text files. Each text line corresponds to a separate example encoded as a JSON object. For each dataset, we release separate training/validation/testing splits along the same boundaries that ETH Py150 Open splits its files to the corresponding splits. The fine-tuned models are the checkpoints of each model with the highest validation accuracy.
51
+
52
+ 1. **Function-docstring classification**. Combinations of functions with their correct or incorrect documentation string, used to train a classifier that can tell which pairs go together. The JSON fields are:
53
+ * `function`: string, the source code of a function as text
54
+ * `docstring`: string, the documentation string for that function. Note that the string is unquoted. To be able to properly tokenize it with the CuBERT tokenizers, you have to wrap it in quotes first. For example, in Python, use `string_to_tokenize = f'"""{docstring}"""'`.
55
+ * `label`: string, one of (“Incorrect”, “Correct”), the label of the example.
56
+ * `info`: string, an unformatted description of how the example was constructed, including the source dataset (always “ETHPy150Open”), the repository and filepath, the function name and, for “Incorrect” examples, the function whose docstring was substituted.
57
+ 1. **Exception classification**. Combinations of functions where one exception type has been masked, along with a label indicating the masked exception type. The JSON fields are:
58
+ * `function`: string, the source code of a function as text, in which one exception type has been replaced with the special token “__HOLE__”
59
+ * `label`: string, one of (`ValueError`, `KeyError`, `AttributeError`, `TypeError`, `OSError`, `IOError`, `ImportError`, `IndexError`, `DoesNotExist`, `KeyboardInterrupt`, `StopIteration`, `AssertionError`, `SystemExit`, `RuntimeError`, `HTTPError`, `UnicodeDecodeError`, `NotImplementedError`, `ValidationError`, `ObjectDoesNotExist`, `NameError`, `None`), the masked exception type. Note that `None` never occurs in the data and will be removed in a future release.
60
+ * `info`: string, an unformatted description of how the example was constructed, including the source dataset (always “ETHPy150Open”), the repository and filepath, and the fully-qualified function name.
61
+ 1. **Variable-misuse classification**. Combinations of functions where one use of a variable may have been replaced with another variable defined in the same context, along with a label indicating if this bug-injection has occurred. The JSON fields are:
62
+ * `function`: string, the source code of a function as text.
63
+ * `label`: string, one of (“Correct”, “Variable misuse”) indicating if this is a buggy or bug-free example.
64
+ * `info`: string, an unformatted description of how the example was constructed, including the source dataset (always “ETHPy150Open”), the repository and filepath, the function, and whether the example is bugfree (marked “original”) or the variable substitution that has occurred (e.g., “correct_variable” → “incorrect_variable”).
65
+ 1. **Swapped-operand classification**. Combinations of functions where one use binary operator’s arguments have been swapped, to create a buggy example, or left undisturbed, along with a label indicating if this bug-injection has occurred. The JSON fields are:
66
+ * `function`: string, the source code of a function as text.
67
+ * `label`: string, one of (“Correct”, “Swapped operands”) indicating if this is a buggy or bug-free example.
68
+ * `info`: string, an unformatted description of how the example was constructed, including the source dataset (always “ETHPy150Open”), the repository and filepath, the function, and whether the example is bugfree (marked “original”) or the operand swap has occurred (e.g., “swapped operands of `not in`”).
69
+ 1. **Wrong-binary-operator classification**. Combinations of functions where one binary operator has been swapped with another, to create a buggy example, or left undisturbed, along with a label indicating if this bug-injection has occurred. The JSON fields are:
70
+ * `function`: string, the source code of a function as text.
71
+ * `label`: string, one of (“Correct”, “Wrong binary operator”) indicating if this is a buggy or bug-free example.
72
+ * `info`: string, an unformatted description of how the example was constructed, including the source dataset (always “ETHPy150Open”), the repository and filepath, the function, and whether the example is bugfree (marked “original”) or the operator replacement has occurred (e.g., “`==`-> `!=`”).
73
+ 1. **Variable-misuse localization and repair**. Combinations of functions where one use of a variable may have been replaced with another variable defined in the same context, along with information that can be used to localize and repair the bug, as well as the location of the bug if such a bug exists. The JSON fields are:
74
+ * `function`: a list of strings, the source code of a function, tokenized with the vocabulary from item b. Note that, unlike other task datasets, this dataset gives a tokenized function, rather than the code as a single string.
75
+ * `target_mask`: a list of integers (0 or 1). If the integer at some position is 1, then the token at the corresponding position of the function token list is a correct repair for the introduced bug. If a variable has been split into multiple tokens, only the first subtoken is marked in this mask. If the example is bug-free, all integers are 0.
76
+ * `error_location_mask`: a list of integers (0 or 1). If the integer at some position is 1, then there is a variable-misuse bug at the corresponding location of the tokenized function. In a bug-free example, the first integer is 1. There is exactly one integer set to 1 for all examples. If a variable has been split into multiple tokens, only the first subtoken is marked in this mask.
77
+ * `candidate_mask`: a list of integers (0 or 1). If the integer at some position is 1, then the variable starting at that position in the tokenized function is a candidate to consider when repairing a bug. Candidates are all variables defined in the function parameters or via variable declarations in the function. If a variable has been split into multiple tokens, only the first subtoken is marked in this mask, for each candidate.
78
+ * `provenance`: string, an unformatted description of how the example was constructed, including the source dataset (always “ETHPy150Open”), the repository and filepath, the function, and whether the example is bugfree (marked “original”) or the buggy/repair token positions and variables (e.g., “16/18 `kwargs` → `self`”). 16 is the position of the introduced error, 18 is the location of the repair.
79
+
80
+ ## Citation
81
+ ```bibtex
82
+ @inproceedings{cubert,
83
+ author = {Aditya Kanade and
84
+ Petros Maniatis and
85
+ Gogul Balakrishnan and
86
+ Kensen Shi},
87
+ title = {Learning and evaluating contextual embedding of source code},
88
+ booktitle = {Proceedings of the 37th International Conference on Machine Learning,
89
+ {ICML} 2020, 12-18 July 2020},
90
+ series = {Proceedings of Machine Learning Research},
91
+ publisher = {{PMLR}},
92
+ year = {2020},
93
+ }
94
+ ```