File size: 5,315 Bytes
f6e4aff
8b4b1a1
 
4041da6
8b4b1a1
 
 
4041da6
0244000
4041da6
 
2015753
 
 
 
4041da6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f6e4aff
8b4b1a1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
772c997
8b4b1a1
 
 
772c997
 
 
 
 
 
 
 
 
 
 
 
 
8b4b1a1
 
772c997
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8b4b1a1
 
 
772c997
8b4b1a1
 
 
 
 
3f732ab
8b4b1a1
 
 
 
 
3f732ab
8b4b1a1
 
 
772c997
 
 
 
 
 
 
 
 
 
8b4b1a1
 
 
3f732ab
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
---
language:
- en
license: mit
size_categories:
- n<1K
task_categories:
- text2text-generation
pretty_name: ClassEval
tags:
- code-generation
configs:
- config_name: default
  data_files:
  - split: test
    path: data/test-*
dataset_info:
  features:
  - name: task_id
    dtype: string
  - name: skeleton
    dtype: string
  - name: test
    dtype: string
  - name: solution_code
    dtype: string
  - name: import_statement
    sequence: string
  - name: class_description
    dtype: string
  - name: methods_info
    list:
    - name: method_name
      dtype: string
    - name: method_description
      dtype: string
    - name: test_class
      dtype: string
    - name: test_code
      dtype: string
    - name: solution_code
      dtype: string
    - name: dependencies
      struct:
      - name: Standalone
        dtype: bool
      - name: lib_dependencies
        sequence: string
      - name: field_dependencies
        sequence: string
      - name: method_dependencies
        sequence: string
  - name: class_name
    dtype: string
  - name: test_classes
    sequence: string
  - name: class_constructor
    dtype: string
  - name: fields
    sequence: string
  splits:
  - name: test
    num_bytes: 2045843
    num_examples: 100
  download_size: 504287
  dataset_size: 2045843
---

# Dataset Card for FudanSELab ClassEval

## Dataset Description

- **Repository:** [GitHub Repository](https://github.com/FudanSELab/ClassEval)
- **Paper:** [ClassEval: A Manually-Crafted Benchmark for Evaluating LLMs on Class-level Code Generation](https://arxiv.org/abs/2308.01861)

### Dataset Summary

We manually build ClassEval of 100 class-level Python coding tasks, consists of 100 classes and 412 methods, and average 33.1 test cases per class.

For 100 class-level tasks, diversity is maintained by encompassing these tasks over a wide spectrum of topics, including Management Systems, Data Formatting, Mathematical Operations, Game Development, File Handing, Database Operations and Natural Language Processing.

For 412 methods, they have been constructed with diverse dependencies, including (i) Library Dependency, where the methods rely on specific external libraries; (ii) Field Dependency, in which the methods are contingent on class instance variables, or fields; (iii) Method Dependency, where the methods are dependent on other methods within the same class; and (iv) Standalone, wherein the methods operate independently without reliance on fields, other methods, or external libraries.

### Languages

The programming language is Python. The natural language used in the comments and docstrings is English.

## Dataset Structure

```python
from datasets import load_dataset
dataset = load_dataset("FudanSELab/ClassEval")

DatasetDict({
    test: Dataset({
        features: ['task_id', 'skeleton', 'test', 'solution_code', 'import_statement', 'class_description', 'methods_info', 
'class_name', 'test_classes', 'class_constructor', 'fields'],
        num_rows: 100
    })
})
```

### Data Fields

The specific data fields for each task are delineated as follows:

* task_id: the unique identifier for each task.

* skeleton: the class skeleton, including all input descriptions in our class-level coding tasks. 

* test: all test cases for the whole class.

* solution_code: the ground-truth class-level code for each task.

More fine-grained class-level information from the class skeleton, including:

* import_statement: the import statements for each task.

* class_name: the name of the class.

* class_description: a concise description of the purpose and functionality of the class.

* class_constructor: the whole constructor of the class.

* fields: the fields defined in the class_constructor.

Detailed information for each method in the "methods_info" field, including:

* method_name: the method signature.

* method_input: the method contract design, including all input descriptions in the method.

* test_code: the test cases for the method.

* solution_code: the ground-truth method-level code.

* dependencies: the dependency information of the method.

### Data Splits

The dataset only consists of a test split with 100 samples.

## Dataset Creation

### Source Data

Manually-crafted

## Additional Information

### Licensing Information

This repository is under [MIT](https://github.com/FudanSELab/ClassEval/blob/master/LICENSE) license. But the data is distributes through [CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/) license.

### Citation Information

```
@misc{du2023classeval,
      title={ClassEval: A Manually-Crafted Benchmark for Evaluating LLMs on Class-level Code Generation}, 
      author={Xueying Du and Mingwei Liu and Kaixin Wang and Hanlin Wang and Junwei Liu and Yixuan Chen and Jiayi Feng and Chaofeng Sha and Xin Peng and Yiling Lou},
      year={2023},
      eprint={2308.01861},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}
```

### Contributions

Xueying Du xueyingdu21@m.fudan.edu.cn

Mingwei Liu liumingwei@fudan.edu.cn

Kaixin Wang kxwang23@m.fudan.edu.cn

Hanlin Wang wanghanlin23@m.fudan.edu.cn

Junwei Liu jwliu22@m.fudan.edu.cn

Yixuan Chen 23212010005@m.fudan.edu.cn

Jiayi Feng 23210240148@m.fudan.edu.cn

Chaofeng Sha cfsha@fudan.edu.cn

Xin Peng pengxin@fudan.edu.cn

Yiling Lou yilinglou@fudan.edu.cn