Datasets:

Modalities:
Text
Formats:
parquet
Size:
< 1K
ArXiv:
Libraries:
Datasets
pandas
HumanEval-MRI-Cpp / README.md
nmuendler's picture
Update README.md
20d2c2b verified
metadata
source_datasets:
  - zai-org/humaneval-x
dataset_info:
  features:
    - name: instance_id
      dtype: string
    - name: number_spans
      dtype: int64
    - name: prompt
      dtype: string
    - name: declaration
      dtype: string
    - name: splits
      sequence: string
    - name: removed_spans
      sequence: string
    - name: canonical_solution
      dtype: string
    - name: test
      dtype: string
  splits:
    - name: test
      num_bytes: 834118
      num_examples: 473
  download_size: 148031
  dataset_size: 834118
configs:
  - config_name: default
    data_files:
      - split: test
        path: data/test-*

HumanEval/MRI/C++

This is a multi-region infilling version of the C++ translation of HumanEval. It was generated by randomly removing between 1 and 3 spans from the canonical solution in the dataset.

This dataset was used for evaluation in the paper Constrained Decoding of Diffusion LLMs with Context-Free Grammars. You can find the corresponding evaluation code on the project GitHub Repository.

Example Usage

from datasets import load_dataset
import json

dataset = load_dataset('eth-sri/HumanEval-MRI-Cpp')
for instance in dataset['test']:
    print(json.dumps(instance, indent=2))
    break

Example Instance

{
  "instance_id": "CPP/0_spans_1",
  "number_spans": 1,
  "prompt": "/*\nCheck if in given vector of numbers, are any two numbers closer to each other than\ngiven threshold.\n>>> has_close_elements({1.0, 2.0, 3.0}, 0.5)\nfalse\n>>> has_close_elements({1.0, 2.8, 3.0, 4.0, 5.0, 2.0}, 0.3)\ntrue\n*/\n#include<stdio.h>\n#include<vector>\n#include<math.h>\nusing namespace std;\nbool has_close_elements(vector<float> numbers, float threshold){\n",
  "declaration": "#include<stdio.h>\n#include<vector>\n#include<math.h>\nusing namespace std;\n#include<algorithm>\n#include<stdlib.h>\nbool has_close_elements(vector<float> numbers, float threshold){\n",
  "splits": [
    "    int i,j;\n    \n    for (i=0;i<numbers.size();i++)\n    for (j=i+1;j<numbers.size();j++)\n    if ",
    ";\n\n    return false;\n}\n\n"
  ],
  "removed_spans": [
    "(abs(numbers[i]-numbers[j])<threshold)\n    return true"
  ],
  "canonical_solution": "    int i,j;\n    \n    for (i=0;i<numbers.size();i++)\n    for (j=i+1;j<numbers.size();j++)\n    if (abs(numbers[i]-numbers[j])<threshold)\n    return true;\n\n    return false;\n}\n\n",
  "test": "#undef NDEBUG\n#include<assert.h>\nint main(){\n    vector<float> a={1.0, 2.0, 3.9, 4.0, 5.0, 2.2};\n    assert (has_close_elements(a, 0.3)==true);\n    assert (has_close_elements(a, 0.05) == false);\n\n    assert (has_close_elements({1.0, 2.0, 5.9, 4.0, 5.0}, 0.95) == true);\n    assert (has_close_elements({1.0, 2.0, 5.9, 4.0, 5.0}, 0.8) ==false);\n    assert (has_close_elements({1.0, 2.0, 3.0, 4.0, 5.0}, 2.0) == true);\n    assert (has_close_elements({1.1, 2.2, 3.1, 4.1, 5.1}, 1.0) == true);\n    assert (has_close_elements({1.1, 2.2, 3.1, 4.1, 5.1}, 0.5) == false);\n    \n}\n"
}