system HF staff commited on
Commit
15f7549
0 Parent(s):

Update files from the datasets library (from 1.13.0)

Browse files

Release notes: https://github.com/huggingface/datasets/releases/tag/1.13.0

.gitattributes ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bin.* filter=lfs diff=lfs merge=lfs -text
5
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.model filter=lfs diff=lfs merge=lfs -text
12
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
13
+ *.onnx filter=lfs diff=lfs merge=lfs -text
14
+ *.ot filter=lfs diff=lfs merge=lfs -text
15
+ *.parquet filter=lfs diff=lfs merge=lfs -text
16
+ *.pb filter=lfs diff=lfs merge=lfs -text
17
+ *.pt filter=lfs diff=lfs merge=lfs -text
18
+ *.pth filter=lfs diff=lfs merge=lfs -text
19
+ *.rar filter=lfs diff=lfs merge=lfs -text
20
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
21
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
22
+ *.tflite filter=lfs diff=lfs merge=lfs -text
23
+ *.tgz filter=lfs diff=lfs merge=lfs -text
24
+ *.xz filter=lfs diff=lfs merge=lfs -text
25
+ *.zip filter=lfs diff=lfs merge=lfs -text
26
+ *.zstandard filter=lfs diff=lfs merge=lfs -text
27
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - crowdsourced
4
+ - expert-generated
5
+ language_creators:
6
+ - crowdsourced
7
+ - expert-generated
8
+ languages:
9
+ - en
10
+ licenses:
11
+ - cc-by-4-0
12
+ multilinguality:
13
+ - monolingual
14
+ pretty_name: Mostly Basic Python Problems
15
+ size_categories:
16
+ - n<1K
17
+ source_datasets:
18
+ - original
19
+ task_categories:
20
+ - conditional-text-generation
21
+ task_ids:
22
+ - conditional-text-generation-other-code-generation
23
+ ---
24
+
25
+ # Dataset Card for Mostly Basic Python Problems (mbpp)
26
+
27
+ ## Table of Contents
28
+ - [Dataset Card for Mostly Basic Python Problems (mbpp)](#dataset-card-for-mostly-basic-python-problems-(mbpp))
29
+ - [Table of Contents](#table-of-contents)
30
+ - [Dataset Description](#dataset-description)
31
+ - [Dataset Summary](#dataset-summary)
32
+ - [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
33
+ - [Languages](#languages)
34
+ - [Dataset Structure](#dataset-structure)
35
+ - [Data Instances](#data-instances)
36
+ - [Data Fields](#data-fields)
37
+ - [Data Splits](#data-splits)
38
+ - [Dataset Creation](#dataset-creation)
39
+ - [Curation Rationale](#curation-rationale)
40
+ - [Source Data](#source-data)
41
+ - [Initial Data Collection and Normalization](#initial-data-collection-and-normalization)
42
+ - [Who are the source language producers?](#who-are-the-source-language-producers)
43
+ - [Annotations](#annotations)
44
+ - [Annotation process](#annotation-process)
45
+ - [Who are the annotators?](#who-are-the-annotators)
46
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
47
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
48
+ - [Social Impact of Dataset](#social-impact-of-dataset)
49
+ - [Discussion of Biases](#discussion-of-biases)
50
+ - [Other Known Limitations](#other-known-limitations)
51
+ - [Additional Information](#additional-information)
52
+ - [Dataset Curators](#dataset-curators)
53
+ - [Licensing Information](#licensing-information)
54
+ - [Citation Information](#citation-information)
55
+ - [Contributions](#contributions)
56
+
57
+ ## Dataset Description
58
+ - **Repository: https://github.com/google-research/google-research/tree/master/mbpp**
59
+ - **Paper: [Program Synthesis with Large Language Models](https://arxiv.org/abs/2108.07732)**
60
+
61
+ ### Dataset Summary
62
+ The benchmark consists of around 1,000 crowd-sourced Python programming problems, designed to be solvable by entry level programmers, covering programming fundamentals, standard library functionality, and so on. Each problem consists of a task description, code solution and 3 automated test cases. As described in the paper, a subset of the data has been hand-verified by us.
63
+
64
+ Released [here](https://github.com/google-research/google-research/tree/master/mbpp) as part of [Program Synthesis with Large Language Models, Austin et. al., 2021](https://arxiv.org/abs/2108.07732).
65
+
66
+ ### Supported Tasks and Leaderboards
67
+ This dataset is used to evaluate code generations.
68
+
69
+ ### Languages
70
+ English - Python code
71
+
72
+ ## Dataset Structure
73
+
74
+ ```python
75
+ dataset_full = load_dataset("mbpp")
76
+ DatasetDict({
77
+ test: Dataset({
78
+ features: ['task_id', 'text', 'code', 'test_list', 'test_setup_code', 'challenge_test_list'],
79
+ num_rows: 974
80
+ })
81
+ })
82
+
83
+ dataset_sanitized = load_dataset("mbpp", "sanitized")
84
+ DatasetDict({
85
+ test: Dataset({
86
+ features: ['source_file', 'task_id', 'prompt', 'code', 'test_imports', 'test_list'],
87
+ num_rows: 427
88
+ })
89
+ })
90
+ ```
91
+
92
+ ### Data Instances
93
+
94
+ #### mbpp - full
95
+ ```
96
+ {
97
+ 'task_id': 1,
98
+ 'text': 'Write a function to find the minimum cost path to reach (m, n) from (0, 0) for the given cost matrix cost[][] and a position (m, n) in cost[][].',
99
+ 'code': 'R = 3\r\nC = 3\r\ndef min_cost(cost, m, n): \r\n\ttc = [[0 for x in range(C)] for x in range(R)] \r\n\ttc[0][0] = cost[0][0] \r\n\tfor i in range(1, m+1): \r\n\t\ttc[i][0] = tc[i-1][0] + cost[i][0] \r\n\tfor j in range(1, n+1): \r\n\t\ttc[0][j] = tc[0][j-1] + cost[0][j] \r\n\tfor i in range(1, m+1): \r\n\t\tfor j in range(1, n+1): \r\n\t\t\ttc[i][j] = min(tc[i-1][j-1], tc[i-1][j], tc[i][j-1]) + cost[i][j] \r\n\treturn tc[m][n]',
100
+ 'test_list': [
101
+ 'assert min_cost([[1, 2, 3], [4, 8, 2], [1, 5, 3]], 2, 2) == 8',
102
+ 'assert min_cost([[2, 3, 4], [5, 9, 3], [2, 6, 4]], 2, 2) == 12',
103
+ 'assert min_cost([[3, 4, 5], [6, 10, 4], [3, 7, 5]], 2, 2) == 16'],
104
+ 'test_setup_code': '',
105
+ 'challenge_test_list': []
106
+ }
107
+ ```
108
+ #### mbpp - sanitized
109
+ ```
110
+ {
111
+ 'source_file': 'Benchmark Questions Verification V2.ipynb',
112
+ 'task_id': 2,
113
+ 'prompt': 'Write a function to find the shared elements from the given two lists.',
114
+ 'code': 'def similar_elements(test_tup1, test_tup2):\n res = tuple(set(test_tup1) & set(test_tup2))\n return (res) ',
115
+ 'test_imports': [],
116
+ 'test_list': [
117
+ 'assert set(similar_elements((3, 4, 5, 6),(5, 7, 4, 10))) == set((4, 5))',
118
+ 'assert set(similar_elements((1, 2, 3, 4),(5, 4, 3, 7))) == set((3, 4))',
119
+ 'assert set(similar_elements((11, 12, 14, 13),(17, 15, 14, 13))) == set((13, 14))'
120
+ ]
121
+ }
122
+ ```
123
+ ### Data Fields
124
+
125
+ - `source_file`: unknown
126
+ - `text`/`prompt`: description of programming task
127
+ - `code`: solution for programming task
128
+ - `test_setup_code`/`test_imports`: necessary code imports to execute tests
129
+ - `test_list`: list of tests to verify solution
130
+ - `challenge_test_list`: list of more challenging test to further probe solution
131
+
132
+ ### Data Splits
133
+ There are two version of the dataset (full and sanitized) which only one split each (test).
134
+ ## Dataset Creation
135
+ See section 2.1 of original [paper](https://arxiv.org/abs/2108.07732).
136
+
137
+ ### Curation Rationale
138
+ In order to evaluate code generation functions a set of simple programming tasks as well as solutions is necessary which this dataset provides.
139
+
140
+ ### Source Data
141
+
142
+ #### Initial Data Collection and Normalization
143
+ The dataset was manually created from scratch.
144
+
145
+ #### Who are the source language producers?
146
+ The dataset was created with an internal crowdsourcing effort at Google.
147
+
148
+ ### Annotations
149
+
150
+ #### Annotation process
151
+ The full dataset was created first and a subset then underwent a second round to improve the task descriptions.
152
+
153
+ #### Who are the annotators?
154
+ The dataset was created with an internal crowdsourcing effort at Google.
155
+
156
+ ### Personal and Sensitive Information
157
+ None.
158
+
159
+ ## Considerations for Using the Data
160
+ Make sure you execute generated Python code in a safe environment when evauating against this dataset as generated code could be harmful.
161
+
162
+ ### Social Impact of Dataset
163
+ With this dataset code generating models can be better evaluated which leads to fewer issues introduced when using such models.
164
+
165
+ ### Discussion of Biases
166
+
167
+ ### Other Known Limitations
168
+ Since the task descriptions might not be expressive enough to solve the task. The `sanitized` split aims at addressing this issue by having a second round of annotators improve the dataset.
169
+
170
+ ## Additional Information
171
+
172
+ ### Dataset Curators
173
+ Google Research
174
+
175
+ ### Licensing Information
176
+ CC-BY-4.0
177
+
178
+ ### Citation Information
179
+ ```
180
+ @article{austin2021program,
181
+ title={Program Synthesis with Large Language Models},
182
+ author={Austin, Jacob and Odena, Augustus and Nye, Maxwell and Bosma, Maarten and Michalewski, Henryk and Dohan, David and Jiang, Ellen and Cai, Carrie and Terry, Michael and Le, Quoc and others},
183
+ journal={arXiv preprint arXiv:2108.07732},
184
+ year={2021}
185
+ ```
186
+ ### Contributions
187
+ Thanks to [@lvwerra](https://github.com/lvwerra) for adding this dataset.
188
+
dataset_infos.json ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "full": {
3
+ "description": "The MBPP (Mostly Basic Python Problems) dataset consists of around 1,000 crowd-sourced Python\nprogramming problems, designed to be solvable by entry level programmers, covering programming\nfundamentals, standard library functionality, and so on. Each problem consists of a task\ndescription, code solution and 3 automated test cases.\n",
4
+ "citation": "@article{austin2021program,\n title={Program Synthesis with Large Language Models},\n author={Austin, Jacob and Odena, Augustus and Nye, Maxwell and Bosma, Maarten and Michalewski, Henryk and Dohan, David and Jiang, Ellen and Cai, Carrie and Terry, Michael and Le, Quoc and others},\n journal={arXiv preprint arXiv:2108.07732},\n year={2021}\n}",
5
+ "homepage": "https://github.com/google-research/google-research/tree/master/mbpp",
6
+ "license": "CC-BY-4.0",
7
+ "features": {
8
+ "task_id": {
9
+ "dtype": "int32",
10
+ "id": null,
11
+ "_type": "Value"
12
+ },
13
+ "text": {
14
+ "dtype": "string",
15
+ "id": null,
16
+ "_type": "Value"
17
+ },
18
+ "code": {
19
+ "dtype": "string",
20
+ "id": null,
21
+ "_type": "Value"
22
+ },
23
+ "test_list": {
24
+ "feature": {
25
+ "dtype": "string",
26
+ "id": null,
27
+ "_type": "Value"
28
+ },
29
+ "length": -1,
30
+ "id": null,
31
+ "_type": "Sequence"
32
+ },
33
+ "test_setup_code": {
34
+ "dtype": "string",
35
+ "id": null,
36
+ "_type": "Value"
37
+ },
38
+ "challenge_test_list": {
39
+ "feature": {
40
+ "dtype": "string",
41
+ "id": null,
42
+ "_type": "Value"
43
+ },
44
+ "length": -1,
45
+ "id": null,
46
+ "_type": "Sequence"
47
+ }
48
+ },
49
+ "post_processed": null,
50
+ "supervised_keys": null,
51
+ "task_templates": null,
52
+ "builder_name": "mbpp",
53
+ "config_name": "full",
54
+ "version": {
55
+ "version_str": "1.0.0",
56
+ "description": null,
57
+ "major": 1,
58
+ "minor": 0,
59
+ "patch": 0
60
+ },
61
+ "splits": {
62
+ "test": {
63
+ "name": "test",
64
+ "num_bytes": 467780,
65
+ "num_examples": 974,
66
+ "dataset_name": "mbpp"
67
+ }
68
+ },
69
+ "download_checksums": {
70
+ "https://raw.githubusercontent.com/google-research/google-research/master/mbpp/mbpp.jsonl": {
71
+ "num_bytes": 563537,
72
+ "checksum": "0b7004a79cd62d9ec7ecdd5a6e5f0ef1210ff00b286df3c5d5b57bf38c58e19a"
73
+ }
74
+ },
75
+ "download_size": 563537,
76
+ "post_processing_size": null,
77
+ "dataset_size": 467780,
78
+ "size_in_bytes": 1031317
79
+ },
80
+ "sanitized": {
81
+ "description": "The MBPP (Mostly Basic Python Problems) dataset consists of around 1,000 crowd-sourced Python\nprogramming problems, designed to be solvable by entry level programmers, covering programming\nfundamentals, standard library functionality, and so on. Each problem consists of a task\ndescription, code solution and 3 automated test cases.\n",
82
+ "citation": "@article{austin2021program,\n title={Program Synthesis with Large Language Models},\n author={Austin, Jacob and Odena, Augustus and Nye, Maxwell and Bosma, Maarten and Michalewski, Henryk and Dohan, David and Jiang, Ellen and Cai, Carrie and Terry, Michael and Le, Quoc and others},\n journal={arXiv preprint arXiv:2108.07732},\n year={2021}\n}",
83
+ "homepage": "https://github.com/google-research/google-research/tree/master/mbpp",
84
+ "license": "CC-BY-4.0",
85
+ "features": {
86
+ "source_file": {
87
+ "dtype": "string",
88
+ "id": null,
89
+ "_type": "Value"
90
+ },
91
+ "task_id": {
92
+ "dtype": "int32",
93
+ "id": null,
94
+ "_type": "Value"
95
+ },
96
+ "prompt": {
97
+ "dtype": "string",
98
+ "id": null,
99
+ "_type": "Value"
100
+ },
101
+ "code": {
102
+ "dtype": "string",
103
+ "id": null,
104
+ "_type": "Value"
105
+ },
106
+ "test_imports": {
107
+ "feature": {
108
+ "dtype": "string",
109
+ "id": null,
110
+ "_type": "Value"
111
+ },
112
+ "length": -1,
113
+ "id": null,
114
+ "_type": "Sequence"
115
+ },
116
+ "test_list": {
117
+ "feature": {
118
+ "dtype": "string",
119
+ "id": null,
120
+ "_type": "Value"
121
+ },
122
+ "length": -1,
123
+ "id": null,
124
+ "_type": "Sequence"
125
+ }
126
+ },
127
+ "post_processed": null,
128
+ "supervised_keys": null,
129
+ "task_templates": null,
130
+ "builder_name": "mbpp",
131
+ "config_name": "sanitized",
132
+ "version": {
133
+ "version_str": "1.0.0",
134
+ "description": null,
135
+ "major": 1,
136
+ "minor": 0,
137
+ "patch": 0
138
+ },
139
+ "splits": {
140
+ "test": {
141
+ "name": "test",
142
+ "num_bytes": 219504,
143
+ "num_examples": 427,
144
+ "dataset_name": "mbpp"
145
+ }
146
+ },
147
+ "download_checksums": {
148
+ "https://raw.githubusercontent.com/google-research/google-research/master/mbpp/sanitized-mbpp.json": {
149
+ "num_bytes": 254879,
150
+ "checksum": "45fca2bbec0d898702499193e593e9bf92092dd4560ebd7c652b9c84d6aed9f5"
151
+ }
152
+ },
153
+ "download_size": 254879,
154
+ "post_processing_size": null,
155
+ "dataset_size": 219504,
156
+ "size_in_bytes": 474383
157
+ }
158
+ }
dummy/full/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d16a749bc09bd271e4dec24ddbdddce349a10a1f5ea9fefd0fc9754666ac2ddb
3
+ size 1199
dummy/sanitized/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ebe542482f95875478695c5dcfc578b161f2e9aea08788c4d917fa0eea4ee344
3
+ size 1191
mbpp.py ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+
3
+ import datasets
4
+
5
+
6
+ _DESCRIPTION = """\
7
+ The MBPP (Mostly Basic Python Problems) dataset consists of around 1,000 crowd-sourced Python
8
+ programming problems, designed to be solvable by entry level programmers, covering programming
9
+ fundamentals, standard library functionality, and so on. Each problem consists of a task
10
+ description, code solution and 3 automated test cases.
11
+ """
12
+
13
+ _URLs = {
14
+ "full": "https://raw.githubusercontent.com/google-research/google-research/master/mbpp/mbpp.jsonl",
15
+ "sanitized": "https://raw.githubusercontent.com/google-research/google-research/master/mbpp/sanitized-mbpp.json",
16
+ }
17
+
18
+ _SPLITS = ["full", "sanitized"]
19
+
20
+ _CITATION = """\
21
+ @article{austin2021program,
22
+ title={Program Synthesis with Large Language Models},
23
+ author={Austin, Jacob and Odena, Augustus and Nye, Maxwell and Bosma, Maarten and Michalewski, Henryk and Dohan, David and Jiang, Ellen and Cai, Carrie and Terry, Michael and Le, Quoc and others},
24
+ journal={arXiv preprint arXiv:2108.07732},
25
+ year={2021}
26
+ }"""
27
+
28
+ _HOMEPAGE = "https://github.com/google-research/google-research/tree/master/mbpp"
29
+
30
+ _LICENSE = "CC-BY-4.0"
31
+
32
+
33
+ class MBPP(datasets.GeneratorBasedBuilder):
34
+ """MBPP: Mostly Basic Python Problems Dataset"""
35
+
36
+ VERSION = datasets.Version("1.0.0")
37
+
38
+ BUILDER_CONFIGS = [
39
+ datasets.BuilderConfig(
40
+ name=f"{split}",
41
+ version=datasets.Version("1.0.0"),
42
+ description=_DESCRIPTION,
43
+ )
44
+ for split in _SPLITS
45
+ ]
46
+
47
+ DEFAULT_CONFIG_NAME = "full"
48
+
49
+ def _info(self):
50
+ if self.config.name == "full":
51
+ features = datasets.Features(
52
+ {
53
+ "task_id": datasets.Value("int32"),
54
+ "text": datasets.Value("string"),
55
+ "code": datasets.Value("string"),
56
+ "test_list": datasets.Sequence(datasets.Value("string")),
57
+ "test_setup_code": datasets.Value("string"),
58
+ "challenge_test_list": datasets.Sequence(datasets.Value("string")),
59
+ }
60
+ )
61
+ else:
62
+ features = datasets.Features(
63
+ {
64
+ "source_file": datasets.Value("string"),
65
+ "task_id": datasets.Value("int32"),
66
+ "prompt": datasets.Value("string"),
67
+ "code": datasets.Value("string"),
68
+ "test_imports": datasets.Sequence(datasets.Value("string")),
69
+ "test_list": datasets.Sequence(datasets.Value("string")),
70
+ }
71
+ )
72
+ return datasets.DatasetInfo(
73
+ description=_DESCRIPTION,
74
+ features=features,
75
+ supervised_keys=None,
76
+ homepage=_HOMEPAGE,
77
+ license=_LICENSE,
78
+ citation=_CITATION,
79
+ )
80
+
81
+ def _split_generators(self, dl_manager):
82
+ """Returns SplitGenerators."""
83
+ config_urls = _URLs[self.config.name]
84
+ data_dir = dl_manager.download_and_extract(config_urls)
85
+ return [
86
+ datasets.SplitGenerator(
87
+ name=datasets.Split.TEST,
88
+ gen_kwargs={
89
+ "filepath": data_dir,
90
+ },
91
+ )
92
+ ]
93
+
94
+ def _generate_examples(self, filepath):
95
+ """Yields examples."""
96
+ with open(filepath, encoding="utf-8") as file:
97
+ if self.config.name == "full":
98
+ data = [json.loads(line) for line in file]
99
+ else:
100
+ data = json.load(file)
101
+ id_ = 0
102
+ for sample in data:
103
+ yield id_, sample
104
+ id_ += 1