Datasets:

Modalities:
Text
Languages:
English
ArXiv:
Tags:
code
Libraries:
Datasets
License:
gabeorlanski commited on
Commit
ae6d579
·
1 Parent(s): ce772a7

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +20 -6
README.md CHANGED
@@ -58,7 +58,7 @@ BC-Transcoder supports:
58
  >>> load_dataset("gabeorlanski/bc-transcoder")
59
  DatasetDict({
60
  test: Dataset({
61
- features: ['qid', 'title', 'language', 'signature', 'arguments', 'entry_fn_name', 'entry_cls_name', 'test_code', 'source_py', 'source_cpp', 'test_list', 'test_case_ids'],
62
  num_rows: 8384
63
  })
64
  })
@@ -71,13 +71,27 @@ DatasetDict({
71
  - `language`: The programming language of the example.
72
  - `signature`: The signature for the problem.
73
  - `arguments`: The arguments of the problem.
74
- - `entry_fn_name`: The function's name to use an entry point.
75
- - `entry_cls_name`: The class name to use an entry point.
76
  - `source_py`: The source solution in Python.
77
  - `source_cpp`: The source in C++.
78
- - `test_code`: The raw testing script used in the language. If you want to use this, replace `PLACEHOLDER_FN_NAME` (and `PLACEHOLDER_CLS_NAME` if needed) with the corresponding entry points. Next, replace `PLACEHOLDER_CODE_BODY` with the postprocessed prediction.
79
- - `test_list`: The raw json line of the list of tests for the problem. To load them, use `json.loads`
80
- - `test_case_ids`: The list of test case ids for the problem. These are used to determine if a prediction passes or not.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
 
82
  ## Dataset Creation
83
  See section 2 of the [BabelCode Paper](https://arxiv.org/abs/2302.01973) to learn more about how the datasets are translated.
 
58
  >>> load_dataset("gabeorlanski/bc-transcoder")
59
  DatasetDict({
60
  test: Dataset({
61
+ features: ['qid', 'title', 'language', 'signature', 'arguments', 'source_py', 'source_cpp', 'question_info'],
62
  num_rows: 8384
63
  })
64
  })
 
71
  - `language`: The programming language of the example.
72
  - `signature`: The signature for the problem.
73
  - `arguments`: The arguments of the problem.
 
 
74
  - `source_py`: The source solution in Python.
75
  - `source_cpp`: The source in C++.
76
+ - `question_info`: The dict of information used for executing predictions. It has the keys:
77
+ - `test_code`: The raw testing script used in the language. If you want to use this, replace `PLACEHOLDER_FN_NAME` (and `PLACEHOLDER_CLS_NAME` if needed) with the corresponding entry points. Next, replace `PLACEHOLDER_CODE_BODY` with the postprocessed prediction.
78
+ - `test_list`: The raw json line of the list of tests for the problem. To load them, use `json.loads`
79
+ - `test_case_ids`: The list of test case ids for the problem. These are used to determine if a prediction passes or not.
80
+ - `entry_fn_name`: The function's name to use an entry point.
81
+ - `entry_cls_name`: The class name to use an entry point.
82
+
83
+ **NOTE:** If you want to use a different function name (or class name for languages that require class names) for the prediction, you must update the `entry_fn_name` and `entry_cls_name` accordingly. For example, if you have the original question with `entry_fn_name` of `add`, but want to change it to `f`, you must update `ds["question_info"]["entry_fn_name"]` to `f`:
84
+ ```python
85
+ >>> from datasets import load_dataset
86
+ >>> ds = load_dataset("gabeorlanski/bc-mbpp")['test']
87
+ >>> # The original entry_fn_name
88
+ >>> ds[0]['question_info']['entry_fn_name']
89
+ removeOcc
90
+ >>> # You MUST update the corresponding entry_fn_name
91
+ >>> ds[0]['question_info']['entry_fn_name'] = 'f'
92
+ >>> ds[0]['question_info']['entry_fn_name']
93
+ f
94
+ ```
95
 
96
  ## Dataset Creation
97
  See section 2 of the [BabelCode Paper](https://arxiv.org/abs/2302.01973) to learn more about how the datasets are translated.