Convert dataset to Parquet
#5
by
lhoestq
HF Staff
- opened
- README.md +123 -0
- cpp/test-00000-of-00001.parquet +3 -0
- data/cpp/data/humaneval.jsonl +0 -0
- data/go/data/humaneval.jsonl +0 -0
- data/java/data/humaneval.jsonl +0 -0
- data/js/data/humaneval.jsonl +0 -0
- data/python/data/humaneval.jsonl +0 -0
- go/test-00000-of-00001.parquet +3 -0
- humaneval-x.py +0 -132
- java/test-00000-of-00001.parquet +3 -0
- js/test-00000-of-00001.parquet +3 -0
- python/test-00000-of-00001.parquet +3 -0
README.md
CHANGED
|
@@ -17,6 +17,129 @@ task_categories:
|
|
| 17 |
task_ids:
|
| 18 |
- language-modeling
|
| 19 |
pretty_name: HumanEval-X
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
---
|
| 21 |
|
| 22 |
# HumanEval-X
|
|
|
|
| 17 |
task_ids:
|
| 18 |
- language-modeling
|
| 19 |
pretty_name: HumanEval-X
|
| 20 |
+
dataset_info:
|
| 21 |
+
- config_name: cpp
|
| 22 |
+
features:
|
| 23 |
+
- name: task_id
|
| 24 |
+
dtype: string
|
| 25 |
+
- name: prompt
|
| 26 |
+
dtype: string
|
| 27 |
+
- name: declaration
|
| 28 |
+
dtype: string
|
| 29 |
+
- name: canonical_solution
|
| 30 |
+
dtype: string
|
| 31 |
+
- name: test
|
| 32 |
+
dtype: string
|
| 33 |
+
- name: example_test
|
| 34 |
+
dtype: string
|
| 35 |
+
splits:
|
| 36 |
+
- name: test
|
| 37 |
+
num_bytes: 276141
|
| 38 |
+
num_examples: 164
|
| 39 |
+
download_size: 101881
|
| 40 |
+
dataset_size: 276141
|
| 41 |
+
- config_name: go
|
| 42 |
+
features:
|
| 43 |
+
- name: task_id
|
| 44 |
+
dtype: string
|
| 45 |
+
- name: prompt
|
| 46 |
+
dtype: string
|
| 47 |
+
- name: declaration
|
| 48 |
+
dtype: string
|
| 49 |
+
- name: canonical_solution
|
| 50 |
+
dtype: string
|
| 51 |
+
- name: test
|
| 52 |
+
dtype: string
|
| 53 |
+
- name: example_test
|
| 54 |
+
dtype: string
|
| 55 |
+
splits:
|
| 56 |
+
- name: test
|
| 57 |
+
num_bytes: 250979
|
| 58 |
+
num_examples: 164
|
| 59 |
+
download_size: 102355
|
| 60 |
+
dataset_size: 250979
|
| 61 |
+
- config_name: java
|
| 62 |
+
features:
|
| 63 |
+
- name: task_id
|
| 64 |
+
dtype: string
|
| 65 |
+
- name: prompt
|
| 66 |
+
dtype: string
|
| 67 |
+
- name: declaration
|
| 68 |
+
dtype: string
|
| 69 |
+
- name: canonical_solution
|
| 70 |
+
dtype: string
|
| 71 |
+
- name: test
|
| 72 |
+
dtype: string
|
| 73 |
+
- name: example_test
|
| 74 |
+
dtype: string
|
| 75 |
+
splits:
|
| 76 |
+
- name: test
|
| 77 |
+
num_bytes: 376189
|
| 78 |
+
num_examples: 164
|
| 79 |
+
download_size: 111925
|
| 80 |
+
dataset_size: 376189
|
| 81 |
+
- config_name: js
|
| 82 |
+
features:
|
| 83 |
+
- name: task_id
|
| 84 |
+
dtype: string
|
| 85 |
+
- name: prompt
|
| 86 |
+
dtype: string
|
| 87 |
+
- name: declaration
|
| 88 |
+
dtype: string
|
| 89 |
+
- name: canonical_solution
|
| 90 |
+
dtype: string
|
| 91 |
+
- name: test
|
| 92 |
+
dtype: string
|
| 93 |
+
- name: example_test
|
| 94 |
+
dtype: string
|
| 95 |
+
splits:
|
| 96 |
+
- name: test
|
| 97 |
+
num_bytes: 249916
|
| 98 |
+
num_examples: 164
|
| 99 |
+
download_size: 102493
|
| 100 |
+
dataset_size: 249916
|
| 101 |
+
- config_name: python
|
| 102 |
+
features:
|
| 103 |
+
- name: task_id
|
| 104 |
+
dtype: string
|
| 105 |
+
- name: prompt
|
| 106 |
+
dtype: string
|
| 107 |
+
- name: declaration
|
| 108 |
+
dtype: string
|
| 109 |
+
- name: canonical_solution
|
| 110 |
+
dtype: string
|
| 111 |
+
- name: test
|
| 112 |
+
dtype: string
|
| 113 |
+
- name: example_test
|
| 114 |
+
dtype: string
|
| 115 |
+
splits:
|
| 116 |
+
- name: test
|
| 117 |
+
num_bytes: 249240
|
| 118 |
+
num_examples: 164
|
| 119 |
+
download_size: 101470
|
| 120 |
+
dataset_size: 249240
|
| 121 |
+
configs:
|
| 122 |
+
- config_name: cpp
|
| 123 |
+
data_files:
|
| 124 |
+
- split: test
|
| 125 |
+
path: cpp/test-*
|
| 126 |
+
- config_name: go
|
| 127 |
+
data_files:
|
| 128 |
+
- split: test
|
| 129 |
+
path: go/test-*
|
| 130 |
+
- config_name: java
|
| 131 |
+
data_files:
|
| 132 |
+
- split: test
|
| 133 |
+
path: java/test-*
|
| 134 |
+
- config_name: js
|
| 135 |
+
data_files:
|
| 136 |
+
- split: test
|
| 137 |
+
path: js/test-*
|
| 138 |
+
- config_name: python
|
| 139 |
+
data_files:
|
| 140 |
+
- split: test
|
| 141 |
+
path: python/test-*
|
| 142 |
+
default: true
|
| 143 |
---
|
| 144 |
|
| 145 |
# HumanEval-X
|
cpp/test-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c64e73bf2d8e7dbcdce8ae65541253b4630824878845b573ffcf95bacd82d998
|
| 3 |
+
size 101881
|
data/cpp/data/humaneval.jsonl
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/go/data/humaneval.jsonl
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/java/data/humaneval.jsonl
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/js/data/humaneval.jsonl
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/python/data/humaneval.jsonl
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
go/test-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:29e6569794e85a6639a7ec54f20c53910a09071a8bbb36823f24d54ad37bbf38
|
| 3 |
+
size 102355
|
humaneval-x.py
DELETED
|
@@ -1,132 +0,0 @@
|
|
| 1 |
-
# coding=utf-8
|
| 2 |
-
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
|
| 3 |
-
#
|
| 4 |
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
-
# you may not use this file except in compliance with the License.
|
| 6 |
-
# You may obtain a copy of the License at
|
| 7 |
-
#
|
| 8 |
-
# http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
-
#
|
| 10 |
-
# Unless required by applicable law or agreed to in writing, software
|
| 11 |
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
-
# See the License for the specific language governing permissions and
|
| 14 |
-
# limitations under the License.
|
| 15 |
-
"""HumanEval-X dataset."""
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
import json
|
| 19 |
-
import datasets
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
_DESCRIPTION = """
|
| 24 |
-
HumanEval-X is a benchmark for the evaluation of the multilingual ability of code generative models. \
|
| 25 |
-
It consists of 820 high-quality human-crafted data samples (each with test cases) in Python, C++, Java, JavaScript, and Go, and can be used for various tasks.
|
| 26 |
-
"""
|
| 27 |
-
|
| 28 |
-
_HOMEPAGE = "https://github.com/THUDM/CodeGeeX"
|
| 29 |
-
|
| 30 |
-
def get_url(name):
|
| 31 |
-
url = f"data/{name}/data/humaneval.jsonl"
|
| 32 |
-
return url
|
| 33 |
-
|
| 34 |
-
def split_generator(dl_manager, name):
|
| 35 |
-
downloaded_files = dl_manager.download(get_url(name))
|
| 36 |
-
return [
|
| 37 |
-
datasets.SplitGenerator(
|
| 38 |
-
name=datasets.Split.TEST,
|
| 39 |
-
gen_kwargs={
|
| 40 |
-
"filepath": downloaded_files,
|
| 41 |
-
},
|
| 42 |
-
)
|
| 43 |
-
]
|
| 44 |
-
|
| 45 |
-
class HumanEvalXConfig(datasets.BuilderConfig):
|
| 46 |
-
"""BuilderConfig """
|
| 47 |
-
|
| 48 |
-
def __init__(self, name, description, features, **kwargs):
|
| 49 |
-
super(HumanEvalXConfig, self).__init__(version=datasets.Version("1.0.0", ""), **kwargs)
|
| 50 |
-
self.name = name
|
| 51 |
-
self.description = description
|
| 52 |
-
self.features = features
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
class HumanEvalX(datasets.GeneratorBasedBuilder):
|
| 56 |
-
VERSION = datasets.Version("1.0.0")
|
| 57 |
-
BUILDER_CONFIGS = [
|
| 58 |
-
HumanEvalXConfig(
|
| 59 |
-
name="python",
|
| 60 |
-
description="Python HumanEval",
|
| 61 |
-
features=["task_id", "prompt", "declaration", "canonical_solution", "test", "example_test"]
|
| 62 |
-
),
|
| 63 |
-
HumanEvalXConfig(
|
| 64 |
-
name="cpp",
|
| 65 |
-
description="C++ HumanEval",
|
| 66 |
-
features=["task_id", "prompt", "declaration", "canonical_solution", "test", "example_test"]
|
| 67 |
-
),
|
| 68 |
-
|
| 69 |
-
HumanEvalXConfig(
|
| 70 |
-
name="go",
|
| 71 |
-
description="Go HumanEval",
|
| 72 |
-
features=["task_id", "prompt", "declaration", "canonical_solution", "test", "example_test"]
|
| 73 |
-
),
|
| 74 |
-
HumanEvalXConfig(
|
| 75 |
-
name="java",
|
| 76 |
-
description="Java HumanEval",
|
| 77 |
-
features=["task_id", "prompt", "declaration", "canonical_solution", "test", "example_test"]
|
| 78 |
-
),
|
| 79 |
-
|
| 80 |
-
HumanEvalXConfig(
|
| 81 |
-
name="js",
|
| 82 |
-
description="JavaScript HumanEval",
|
| 83 |
-
features=["task_id", "prompt", "declaration", "canonical_solution", "test", "example_test"]
|
| 84 |
-
),
|
| 85 |
-
]
|
| 86 |
-
DEFAULT_CONFIG_NAME = "python"
|
| 87 |
-
|
| 88 |
-
def _info(self):
|
| 89 |
-
return datasets.DatasetInfo(
|
| 90 |
-
description=_DESCRIPTION,
|
| 91 |
-
features=datasets.Features({"task_id": datasets.Value("string"),
|
| 92 |
-
"prompt": datasets.Value("string"),
|
| 93 |
-
"declaration": datasets.Value("string"),
|
| 94 |
-
"canonical_solution": datasets.Value("string"),
|
| 95 |
-
"test": datasets.Value("string"),
|
| 96 |
-
"example_test": datasets.Value("string"),
|
| 97 |
-
}),
|
| 98 |
-
homepage=_HOMEPAGE,
|
| 99 |
-
)
|
| 100 |
-
|
| 101 |
-
def _split_generators(self, dl_manager):
|
| 102 |
-
if self.config.name == "python":
|
| 103 |
-
return split_generator(dl_manager, self.config.name)
|
| 104 |
-
|
| 105 |
-
elif self.config.name == "cpp":
|
| 106 |
-
return split_generator(dl_manager, self.config.name)
|
| 107 |
-
|
| 108 |
-
elif self.config.name == "go":
|
| 109 |
-
return split_generator(dl_manager, self.config.name)
|
| 110 |
-
|
| 111 |
-
elif self.config.name == "java":
|
| 112 |
-
return split_generator(dl_manager, self.config.name)
|
| 113 |
-
|
| 114 |
-
elif self.config.name == "js":
|
| 115 |
-
return split_generator(dl_manager, self.config.name)
|
| 116 |
-
|
| 117 |
-
def _generate_examples(self, filepath):
|
| 118 |
-
key = 0
|
| 119 |
-
with open(filepath) as f:
|
| 120 |
-
for line in f:
|
| 121 |
-
row = json.loads(line)
|
| 122 |
-
key += 1
|
| 123 |
-
yield key, {
|
| 124 |
-
"task_id": row["task_id"],
|
| 125 |
-
"prompt": row["prompt"],
|
| 126 |
-
"declaration": row["declaration"],
|
| 127 |
-
"canonical_solution": row["canonical_solution"],
|
| 128 |
-
"test": row["test"],
|
| 129 |
-
"example_test": row["example_test"],
|
| 130 |
-
|
| 131 |
-
}
|
| 132 |
-
key += 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
java/test-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d3e4935bfbf3b4565502f88a9dee6ff5bcd4b98d87b494c2228da0804f7d526d
|
| 3 |
+
size 111925
|
js/test-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:36549f7abab92a4911c8a41cf3279482927a196b1a38735f8ffee1cb39e022f7
|
| 3 |
+
size 102493
|
python/test-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:757a96b5da8cc711c35ba494eaa9b07e7b7c4c015a9978d1b6ae3c38e8a23027
|
| 3 |
+
size 101470
|