File size: 3,871 Bytes
8b4e076
16b57b0
 
 
8b4e076
16b57b0
 
 
 
 
 
c5dd1d0
ea48e45
c5dd1d0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ea48e45
c5dd1d0
16b57b0
ea48e45
 
 
 
31c3cd7
 
 
 
af06263
 
 
 
31c3cd7
 
 
05abdba
8c806c7
 
05abdba
31c3cd7
 
af06263
576567e
7d12fbc
31c3cd7
c25a7dd
31c3cd7
 
 
 
 
 
 
 
 
 
 
 
 
 
8dae608
31c3cd7
 
8c806c7
31c3cd7
 
 
 
 
 
 
 
8c806c7
31c3cd7
8dae608
cb3307a
 
 
 
 
 
31c3cd7
8dae608
31c3cd7
 
c25a7dd
 
05abdba
c25a7dd
 
 
 
 
 
 
edbbbf3
95f9db8
c25a7dd
 
 
 
 
 
 
 
 
edbbbf3
c25a7dd
 
 
 
 
31c3cd7
 
00da03d
31c3cd7
 
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
---
language:
- ja
- en
license: mit
size_categories:
- n<1K
source_datasets:
- openai_humaneval
task_categories:
- text2text-generation
dataset_info:
  config_name: jhumaneval
  features:
  - name: task_id
    dtype: string
  - name: prompt_en
    dtype: string
  - name: prompt
    dtype: string
  - name: entry_point
    dtype: string
  - name: canonical_solution
    dtype: string
  - name: test
    dtype: string
  splits:
  - name: test
    num_bytes: 275012
    num_examples: 164
  download_size: 125206
  dataset_size: 275012
configs:
- config_name: jhumaneval
  data_files:
  - split: test
    path: jhumaneval/test-*
---

# Dataset Card for JHumanEval: Japanese Hand-Translated HumanEval

## Dataset Description

- **Repository:** [GitHub Repository](https://github.com/KuramitsuLab/jhuman-eval)

## Dataset Summary
This is a Japanese translated version of HumanEval, an evaluation harness for the HumanEval problem solving dataset described in the paper "Evaluating Large Language Models Trained on Code".

LLM のコード生成能力の標準ベンチマーク HumanEval の日本語翻訳版です。  
機械翻訳(DeepL, GPT-4)の翻訳結果を全て人手によって再修正し、 訳文を日本人のプログラマが読んで理解し、コードが書ける内容かチェックしました。  
ただし、英語版 HumanEval の間違いは、修正せずに残して、 HumanEval 同様に不完全なドキュメントからの生成能力を見るようになっています。  
日本語LLM のベンチマークとしてお使いください。

## Languages
The programming problems are written in Python and contain English and Japanese natural text in comments and docstrings.  

Python で書かれたプログラミング問題のデータセットには、英語と日本語のコメントやドキュメント文字列がそれぞれ別々に含まれています。


## Dataset Structure

```python
from datasets import load_dataset
load_dataset("kogi-jwu/jhumaneval")

DatasetDict({
    test: Dataset({
        features: ['task_id', 'prompt_en', 'prompt', 'entry_point', 'canonical_solution', 'test'],
        num_rows: 164
    })
})
```

## Data Instances
An example of a dataset instance:

```
{
    "task_id": "test/0",
    "prompt_en": "def return1():\n    \"\"\"\n    A simple function that returns the integer 1.\n    \"\"\"\n",
    "prompt": "def return1():\n    \"\"\"\n    整数1を返すシンプルな関数。\n    \"\"\"\n",
    "canonical_solution": "    return 1",
    "test": "def check(candidate):\n    assert candidate() == 1",
    "entry_point": "return1"
}
```

## Data Fields
- `task_id` : Unique identifier for a task.
- `prompt_en` : Function header and English docstrings as model input.
- `prompt` : Function header and Japanese docstrings, parallel to prompt_en.
- `canonical_solution` : The expected function implementation.
- `test` : Function to verify the correctness of generated code.
- `entry_point` : Function name to initiate the test.

## Data Splits
The dataset only consists of a test split with 164 samples.

## How to Use

参照コードで pass@1 を算出する例:

```python
import os
from datasets import load_dataset
from evaluate import load

os.environ["HF_ALLOW_CODE_EVAL"] = "1"

ds = load_dataset("kogi-jwu/jhumaneval")['test']
code_eval = load("code_eval")

candidates = []
test_cases = []

for d in ds:
  # FIXME: 参照コードをそのまま入れているが、予測コードに置き換えるべき
  candidates.append([d['prompt']+d['canonical_solution']])
  # テストケースを実行可能な形式にする
  text_cases.append([d['test']+f"\n\ncheck({d['entry_point']})\n"])

pass_at_k, results = code_eval.compute(references=test_cases, predictions=candidates, k=[1])
print(pass_at_k)
```

## Additional Information

### Licensing Information
MIT License