sbmaruf commited on
Commit
0c7ebf6
1 Parent(s): 847c9a7

update README

Browse files
Files changed (1) hide show
  1. README.md +150 -1
README.md CHANGED
@@ -47,4 +47,153 @@ configs:
47
  - retrieval_corpus
48
  - problem_descriptions
49
  - unittest_db
50
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  - retrieval_corpus
48
  - problem_descriptions
49
  - unittest_db
50
+ ---
51
+
52
+
53
+ **NOTE**: Please ignore the Dataset Preview.
54
+
55
+ # xCodeEval
56
+ [xCodeEval: A Large Scale Multilingual Multitask Benchmark for Code Understanding, Generation, Translation and Retrieval](https://arxiv.org/abs/2303.03004)
57
+
58
+ We introduce **xCodeEval**, the largest executable multilingual multitask benchmark to date consisting of $25$M document-level coding examples from about $7.5$K unique problems covering up to $17$ programming languages with execution-level parallelism. It features a total of seven tasks involving code understanding, generation, translation and retrieval, and it employs an execution-based evaluation. We develop a test-case based multilingual code execution engine, [**ExecEval**](https://github.com/ntunlp/ExecEval) that supports all the programming languages in **xCodeEval**. We also propose a novel data splitting and a data selection schema for balancing data distributions over multiple attributes based on geometric mean and graph-theoretic principle.
59
+
60
+ This repository contains the sample code and data link for xCodeEval [paper](https://arxiv.org/abs/2303.03004).
61
+
62
+ # Data Download
63
+
64
+ Data is uploaded as a git LFS repo in huggingface.
65
+
66
+ ![xCodeEval_hf](xcodeeval.png)
67
+
68
+ You can download the full data using the following command. To Download the full dataset,
69
+
70
+ ```
71
+ GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/datasets/NTU-NLP-sg/xCodeEval
72
+ cd xCodeEval
73
+ git lfs pull
74
+ ```
75
+
76
+ To download a specific part of the dataset,
77
+
78
+ ```
79
+ GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/datasets/NTU-NLP-sg/xCodeEval
80
+ cd xCodeEval
81
+ git lfs pull --include "apr/test/*"
82
+ ```
83
+
84
+ **NOTE**: Currently we don't support huggingface `load_dataset()` module. At this moment use `git lfs` to download the data.
85
+
86
+
87
+ We propose 7 Tasks.
88
+
89
+ 1. [Tag Classification](./tag_classification.md)
90
+ 2. [Code Compilation](./code_compilation.md)
91
+ 3. [Program Synthesis](./program_synthesis.md)
92
+ 4. [Code Translation](./code_translation.md)
93
+ 5. [Automatic Program Repair](./apr.md)
94
+ 6. [Code-Code Retrieval](./retrieval.md)
95
+ 7. [NL-Code Retrieval](./retrieval.md)
96
+
97
+ # Common Data for different tasks
98
+
99
+ ![xCodeEval_fig_1](xcodeeval_fig_1.png)
100
+
101
+ We have two data files that are required for multiple tasks.
102
+
103
+ 1. `problem_descriptions.jsonl`
104
+ 2. `unittest_db.json`
105
+
106
+ You can find these two files in the root directory of the [main](https://huggingface.co/datasets/NTU-NLP-sg/xCodeEval/tree/main) branch of huggingface dataset repository. To avoid data redundency we didn't include these data with relevant task, rather we add a unique id `src_uid` to retrieve these data.
107
+
108
+ ## Structure of `problem_descriptions.jsonl`
109
+
110
+ A sample,
111
+
112
+ ```json
113
+ {
114
+ "description": "There are $$$n$$$ positive integers $$$a_1, a_2, \\dots, a_n$$$. For the one move you can choose any even value $$$c$$$ and divide by two all elements that equal $$$c$$$.For example, if $$$a=[6,8,12,6,3,12]$$$ and you choose $$$c=6$$$, and $$$a$$$ is transformed into $$$a=[3,8,12,3,3,12]$$$ after the move.You need to find the minimal number of moves for transforming $$$a$$$ to an array of only odd integers (each element shouldn't be divisible by $$$2$$$).",
115
+ "input_from": "standard input",
116
+ "output_to": "standard output",
117
+ "time_limit": "3 seconds",
118
+ "memory_limit": "256 megabytes",
119
+ "input_spec": "The first line of the input contains one integer $$$t$$$ ($$$1 \\le t \\le 10^4$$$) \u2014 the number of test cases in the input. Then $$$t$$$ test cases follow. The first line of a test case contains $$$n$$$ ($$$1 \\le n \\le 2\\cdot10^5$$$) \u2014 the number of integers in the sequence $$$a$$$. The second line contains positive integers $$$a_1, a_2, \\dots, a_n$$$ ($$$1 \\le a_i \\le 10^9$$$). The sum of $$$n$$$ for all test cases in the input doesn't exceed $$$2\\cdot10^5$$$.",
120
+ "output_spec": "For $$$t$$$ test cases print the answers in the order of test cases in the input. The answer for the test case is the minimal number of moves needed to make all numbers in the test case odd (i.e. not divisible by $$$2$$$).",
121
+ "notes": "NoteIn the first test case of the example, the optimal sequence of moves can be as follows: before making moves $$$a=[40, 6, 40, 3, 20, 1]$$$; choose $$$c=6$$$; now $$$a=[40, 3, 40, 3, 20, 1]$$$; choose $$$c=40$$$; now $$$a=[20, 3, 20, 3, 20, 1]$$$; choose $$$c=20$$$; now $$$a=[10, 3, 10, 3, 10, 1]$$$; choose $$$c=10$$$; now $$$a=[5, 3, 5, 3, 5, 1]$$$ \u2014 all numbers are odd. Thus, all numbers became odd after $$$4$$$ moves. In $$$3$$$ or fewer moves, you cannot make them all odd.",
122
+ "sample_inputs": [
123
+ "4\n6\n40 6 40 3 20 1\n1\n1024\n4\n2 4 8 16\n3\n3 1 7"
124
+ ],
125
+ "sample_outputs": [
126
+ "4\n10\n4\n0"
127
+ ],
128
+ "tags": [
129
+ "number theory",
130
+ "greedy"
131
+ ],
132
+ "src_uid": "afcd41492158e68095b01ff1e88c3dd4",
133
+ "difficulty": 1200,
134
+ "created_at": 1576321500
135
+ }
136
+ ```
137
+
138
+ ### Key Definitions
139
+
140
+ 1. `description`: Problem description in textual format, math operations are written in latex.
141
+ 2. `input_from`: How the program should take unit test.
142
+ 3. `output_to`: Where the program should output the result of the unit test.
143
+ 4. `time_limit`: Time limit to solve the problem.
144
+ 5. `memory_limit`: Memory limit to solve the problem.
145
+ 6. `input_spec`: How and what order the input will be given to the program. It also include the data range, types and sizes.
146
+ 7. `output_spec`: How the outputs should be printed. Most of the time the unit test results are matched with *exact string match* or *floating point comparison* with a precision boundary.
147
+ 8. `sample_inputs`: A sample input for the code that is expected to solve the problem described in `description`.
148
+ 9. `sample_outputs`: The expected output for the `sample_input` that is expected to solve the problem described in `description`.
149
+ 10. `notes`: Explanation of `sample_inputs` & `sample_outputs`.
150
+ 11. `tags`: The problem categories.
151
+ 12. `src_uid`: The unique id of the problem. This ID is referred in the task data samples instead of putting all these information.
152
+ 13. `difficulty`: How difficult is it to solve the problem for a human (annotated by an expert human).
153
+ 14. `created_at`: The unix timestamp at when the problem was released. Use `datetime` lib in python to parse it to a human readable format.
154
+
155
+ ## Structure of `unittest_db.json`
156
+
157
+ The structure of the `json` file,
158
+
159
+ ```python
160
+ unittest_db = {
161
+ "db884d679d9cfb1dc4bc511f83beedda" : [
162
+ {
163
+ "input": "4\r\n3 2 3 2\r\n",
164
+ "output": [
165
+ "1"
166
+ ],
167
+ },
168
+ {
169
+ ...
170
+ },
171
+ ...
172
+ ]
173
+ "3bc096d8cd3418948d5be6bf297aa9b5":[
174
+ ...
175
+ ],
176
+ ...
177
+ }
178
+ ```
179
+
180
+ ### Key Definitions
181
+
182
+ 1. `unittest_db.json` dict keys i.e., `db884d679d9cfb1dc4bc511f83beedda` are the `src_uid` from `problem_descriptions.jsonl`.
183
+ 2. `input` : Input of the unit test.
184
+ 3. `output` : List of expected outputs for the unit test.
185
+
186
+ # Citation
187
+
188
+ ```
189
+ @misc{khan2023xcodeeval,
190
+ title={xCodeEval: A Large Scale Multilingual Multitask Benchmark for Code Understanding, Generation, Translation and Retrieval},
191
+ author={Mohammad Abdullah Matin Khan and M Saiful Bari and Xuan Long Do and Weishi Wang and Md Rizwan Parvez and Shafiq Joty},
192
+ year={2023},
193
+ eprint={2303.03004},
194
+ archivePrefix={arXiv},
195
+ primaryClass={cs.CL}
196
+ }
197
+ ```
198
+
199
+