FudanSELab commited on
Commit
0e5c4f8
1 Parent(s): 1b138bf

Delete ClassEval.py

Browse files
Files changed (1) hide show
  1. ClassEval.py +0 -104
ClassEval.py DELETED
@@ -1,104 +0,0 @@
1
- import json
2
- import datasets
3
-
4
- _DESCRIPTION = """\
5
- FudanSELab ClassEval
6
- """
7
- _URL = "ClassEval_data.json"
8
-
9
- _CITATION = """\
10
- @misc{du2023classeval,
11
- title={ClassEval: A Manually-Crafted Benchmark for Evaluating LLMs on Class-level Code Generation},
12
- 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},
13
- year={2023},
14
- eprint={2308.01861},
15
- archivePrefix={arXiv},
16
- primaryClass={cs.CL}
17
- }"""
18
-
19
- _HOMEPAGE = "https://github.com/FudanSELab/ClassEval"
20
-
21
- _LICENSE = "MIT"
22
-
23
- class ClassEval(datasets.GeneratorBasedBuilder):
24
- VERSION = datasets.Version("1.0.0")
25
- BUILDER_CONFIGS = [
26
- datasets.BuilderConfig(
27
- name="class_eval",
28
- version=datasets.Version("1.0.0"),
29
- description=_DESCRIPTION,
30
- )
31
- ]
32
-
33
- def _info(self):
34
- method_feature = datasets.Features(
35
- {
36
- "method_name": datasets.Value("string"),
37
- "method_description": datasets.Value("string"),
38
- "test_class": datasets.Value("string"),
39
- "test_code": datasets.Value("string"),
40
- "solution_code": datasets.Value("string"),
41
- "dependencies": {
42
- "Standalone": datasets.Value("bool"),
43
- "lib_dependencies": datasets.Sequence(datasets.Value("string")),
44
- "field_dependencies": datasets.Sequence(datasets.Value("string")),
45
- "method_dependencies": datasets.Sequence(datasets.Value("string")),
46
- }
47
- }
48
- )
49
- features = datasets.Features(
50
- {
51
- "task_id": datasets.Value("string"),
52
- "skeleton": datasets.Value("string"),
53
- "test": datasets.Value("string"),
54
- "solution_code": datasets.Value("string"),
55
- "import_statement": [datasets.Value("string")],
56
- "class_description": datasets.Value("string"),
57
- "class_name": datasets.Value("string"),
58
- "test_classes": datasets.Sequence(datasets.Value("string")),
59
- "class_constructor": datasets.Value("string"),
60
- "fields": datasets.Sequence(datasets.Value("string")),
61
- "methods_info": [method_feature],
62
- }
63
- )
64
-
65
- return datasets.DatasetInfo(
66
- description=_DESCRIPTION,
67
- features=features,
68
- supervised_keys=None,
69
- homepage=_HOMEPAGE,
70
- license=_LICENSE,
71
- citation=_CITATION,
72
- )
73
-
74
- def _split_generators(self, dl_manager):
75
- """Returns SplitGenerators."""
76
- data_dir = dl_manager.download(_URL)
77
- return [
78
- datasets.SplitGenerator(
79
- name=datasets.Split.TEST,
80
- gen_kwargs={
81
- "filepath": data_dir,
82
- },
83
- )
84
- ]
85
-
86
- def _generate_examples(self, filepath):
87
- key = 0
88
- with open(filepath, encoding = 'utf-8') as f:
89
- cont = json.load(f)
90
- for row in cont:
91
- yield key, {
92
- "task_id": row["task_id"],
93
- "skeleton": row["skeleton"],
94
- "test": row["test"],
95
- "solution_code": row["solution_code"],
96
- "import_statement": row["import_statement"],
97
- "class_description": row["class_description"],
98
- "class_name": row["class_name"],
99
- "test_classes": row["test_classes"],
100
- "class_constructor": row["class_constructor"],
101
- "fields": row["fields"],
102
- "methods_info": row["methods_info"],
103
- }
104
- key += 1