albertvillanova HF staff commited on
Commit
4bb6404
1 Parent(s): 5a8a3b6

Convert dataset to Parquet (#4)

Browse files

- Convert dataset to Parquet (7497ff88fca11fc66dad7ff869fc3a945cdeb145)
- Add sanitized data files (5388f0135701bca8eb6695a075124a7615a987ae)
- Delete loading script (004b91a7eaec9ee56d67c2df143c9c764fc31db6)
- Delete legacy dataset_infos.json (7bc94ee8bd8f4b07324968e85b7b54f505cba1e5)

README.md CHANGED
@@ -11,7 +11,6 @@ license:
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:
@@ -19,6 +18,7 @@ source_datasets:
19
  task_categories:
20
  - text2text-generation
21
  task_ids: []
 
22
  tags:
23
  - code-generation
24
  dataset_info:
@@ -49,7 +49,7 @@ dataset_info:
49
  - name: prompt
50
  num_bytes: 4550
51
  num_examples: 10
52
- download_size: 563743
53
  dataset_size: 467938
54
  - config_name: sanitized
55
  features:
@@ -78,8 +78,30 @@ dataset_info:
78
  - name: prompt
79
  num_bytes: 3407
80
  num_examples: 7
81
- download_size: 255053
82
  dataset_size: 219630
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  ---
84
 
85
  # Dataset Card for Mostly Basic Python Problems (mbpp)
11
  - cc-by-4.0
12
  multilinguality:
13
  - monolingual
 
14
  size_categories:
15
  - n<1K
16
  source_datasets:
18
  task_categories:
19
  - text2text-generation
20
  task_ids: []
21
+ pretty_name: Mostly Basic Python Problems
22
  tags:
23
  - code-generation
24
  dataset_info:
49
  - name: prompt
50
  num_bytes: 4550
51
  num_examples: 10
52
+ download_size: 236069
53
  dataset_size: 467938
54
  - config_name: sanitized
55
  features:
78
  - name: prompt
79
  num_bytes: 3407
80
  num_examples: 7
81
+ download_size: 115422
82
  dataset_size: 219630
83
+ configs:
84
+ - config_name: full
85
+ data_files:
86
+ - split: train
87
+ path: full/train-*
88
+ - split: test
89
+ path: full/test-*
90
+ - split: validation
91
+ path: full/validation-*
92
+ - split: prompt
93
+ path: full/prompt-*
94
+ default: true
95
+ - config_name: sanitized
96
+ data_files:
97
+ - split: train
98
+ path: sanitized/train-*
99
+ - split: test
100
+ path: sanitized/test-*
101
+ - split: validation
102
+ path: sanitized/validation-*
103
+ - split: prompt
104
+ path: sanitized/prompt-*
105
  ---
106
 
107
  # Dataset Card for Mostly Basic Python Problems (mbpp)
dataset_infos.json DELETED
@@ -1 +0,0 @@
1
- {"full": {"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. The sanitized subset of the data has been \nhand-verified by the authors.\n", "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}", "homepage": "https://github.com/google-research/google-research/tree/master/mbpp", "license": "CC-BY-4.0", "features": {"task_id": {"dtype": "int32", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "code": {"dtype": "string", "id": null, "_type": "Value"}, "test_list": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "test_setup_code": {"dtype": "string", "id": null, "_type": "Value"}, "challenge_test_list": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "mbpp", "config_name": "full", "version": {"version_str": "1.0.2", "description": null, "major": 1, "minor": 0, "patch": 2}, "splits": {"train": {"name": "train", "num_bytes": 176879, "num_examples": 374, "dataset_name": "mbpp"}, "test": {"name": "test", "num_bytes": 244104, "num_examples": 500, "dataset_name": "mbpp"}, "validation": {"name": "validation", "num_bytes": 42405, "num_examples": 90, "dataset_name": "mbpp"}, "prompt": {"name": "prompt", "num_bytes": 4550, "num_examples": 10, "dataset_name": "mbpp"}}, "download_checksums": {"https://raw.githubusercontent.com/google-research/google-research/master/mbpp/mbpp.jsonl": {"num_bytes": 563743, "checksum": "ccf64ceae9c5403bf50a044cb6d505bfd2a2963ee58338ba268fd65beab92a9f"}}, "download_size": 563743, "post_processing_size": null, "dataset_size": 467938, "size_in_bytes": 1031681}, "sanitized": {"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. The sanitized subset of the data has been \nhand-verified by the authors.\n", "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}", "homepage": "https://github.com/google-research/google-research/tree/master/mbpp", "license": "CC-BY-4.0", "features": {"source_file": {"dtype": "string", "id": null, "_type": "Value"}, "task_id": {"dtype": "int32", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "code": {"dtype": "string", "id": null, "_type": "Value"}, "test_imports": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "test_list": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "mbpp", "config_name": "sanitized", "version": {"version_str": "1.0.2", "description": null, "major": 1, "minor": 0, "patch": 2}, "splits": {"train": {"name": "train", "num_bytes": 63453, "num_examples": 120, "dataset_name": "mbpp"}, "test": {"name": "test", "num_bytes": 132720, "num_examples": 257, "dataset_name": "mbpp"}, "validation": {"name": "validation", "num_bytes": 20050, "num_examples": 43, "dataset_name": "mbpp"}, "prompt": {"name": "prompt", "num_bytes": 3407, "num_examples": 7, "dataset_name": "mbpp"}}, "download_checksums": {"https://raw.githubusercontent.com/google-research/google-research/master/mbpp/sanitized-mbpp.json": {"num_bytes": 255053, "checksum": "ca95deaa9a01ef0a6f439f88bcf0dd3db3563d22f22aad6cae04ebb9a8d8c8e9"}}, "download_size": 255053, "post_processing_size": null, "dataset_size": 219630, "size_in_bytes": 474683}}
 
full/prompt-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a053e4bb85ceb77430ae80592addb4ca4dc6ba087592f9e04537800ee88b7431
3
+ size 7878
full/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:566fd53060ffba5766dace1d1e2f4c38906781526de222b0dfbdbc325b696c77
3
+ size 115824
full/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:09d125ca31edacb7800be8c67c45abff618faf0214ff551291817d06bdb914ae
3
+ size 87223
full/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3f0ec060987432d99fe8fb409d31e6c67445b208a01741c5583517c80a10fe80
3
+ size 25144
mbpp.py DELETED
@@ -1,139 +0,0 @@
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. The sanitized subset of the data has been
11
- hand-verified by the authors.
12
- """
13
-
14
- _URLs = {
15
- "full": "https://raw.githubusercontent.com/google-research/google-research/master/mbpp/mbpp.jsonl",
16
- "sanitized": "https://raw.githubusercontent.com/google-research/google-research/master/mbpp/sanitized-mbpp.json",
17
- }
18
-
19
- _CITATION = """\
20
- @article{austin2021program,
21
- title={Program Synthesis with Large Language Models},
22
- 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},
23
- journal={arXiv preprint arXiv:2108.07732},
24
- year={2021}
25
- }"""
26
-
27
- _HOMEPAGE = "https://github.com/google-research/google-research/tree/master/mbpp"
28
-
29
- _LICENSE = "CC-BY-4.0"
30
-
31
-
32
- class MBPP(datasets.GeneratorBasedBuilder):
33
- """MBPP: Mostly Basic Python Problems Dataset"""
34
-
35
- VERSION = datasets.Version("1.0.2")
36
-
37
- BUILDER_CONFIGS = [
38
- datasets.BuilderConfig(
39
- name="full",
40
- version=datasets.Version("1.0.2"),
41
- description=_DESCRIPTION,
42
- ),
43
- datasets.BuilderConfig(name="sanitized", version=datasets.Version("1.0.2"), description=_DESCRIPTION),
44
- ]
45
-
46
- DEFAULT_CONFIG_NAME = "full"
47
-
48
- def _info(self):
49
- if self.config.name == "full":
50
- features = datasets.Features(
51
- {
52
- "task_id": datasets.Value("int32"),
53
- "text": datasets.Value("string"),
54
- "code": datasets.Value("string"),
55
- "test_list": datasets.Sequence(datasets.Value("string")),
56
- "test_setup_code": datasets.Value("string"),
57
- "challenge_test_list": datasets.Sequence(datasets.Value("string")),
58
- }
59
- )
60
- elif self.config.name == "sanitized":
61
- features = datasets.Features(
62
- {
63
- "source_file": datasets.Value("string"),
64
- "task_id": datasets.Value("int32"),
65
- "prompt": datasets.Value("string"),
66
- "code": datasets.Value("string"),
67
- "test_imports": datasets.Sequence(datasets.Value("string")),
68
- "test_list": datasets.Sequence(datasets.Value("string")),
69
- }
70
- )
71
- return datasets.DatasetInfo(
72
- description=_DESCRIPTION,
73
- features=features,
74
- supervised_keys=None,
75
- homepage=_HOMEPAGE,
76
- license=_LICENSE,
77
- citation=_CITATION,
78
- )
79
-
80
- def _split_generators(self, dl_manager):
81
- """Returns SplitGenerators."""
82
- config_urls = _URLs[self.config.name]
83
- data_dir = dl_manager.download_and_extract(config_urls)
84
- return [
85
- datasets.SplitGenerator(
86
- name=datasets.Split.TRAIN,
87
- gen_kwargs={"filepath": data_dir, "split": "train"},
88
- ),
89
- datasets.SplitGenerator(
90
- name=datasets.Split.TEST,
91
- gen_kwargs={"filepath": data_dir, "split": "test"},
92
- ),
93
- datasets.SplitGenerator(
94
- name=datasets.Split.VALIDATION,
95
- gen_kwargs={"filepath": data_dir, "split": "validation"},
96
- ),
97
- datasets.SplitGenerator(
98
- name=datasets.Split("prompt"),
99
- gen_kwargs={"filepath": data_dir, "split": "prompt"},
100
- ),
101
- ]
102
-
103
- def _generate_examples(self, filepath, split):
104
- if self.config.name == "full":
105
-
106
- def _read_lines(fn, start, end):
107
- data = []
108
- with open(fn, encoding="utf-8") as f:
109
- for line in f:
110
- sample = json.loads(line)
111
- if start <= sample["task_id"] <= end:
112
- data.append(sample)
113
- elif sample["task_id"] > end:
114
- break
115
- return data
116
-
117
- if split == "test":
118
- data = _read_lines(filepath, 11, 510)
119
- elif split == "train":
120
- data = _read_lines(filepath, 601, 974)
121
- elif split == "validation":
122
- data = _read_lines(filepath, 511, 600)
123
- elif split == "prompt":
124
- data = _read_lines(filepath, 1, 10)
125
- elif self.config.name == "sanitized":
126
- with open(filepath, encoding="utf-8") as f:
127
- data = json.load(f)
128
- if split == "test":
129
- data = [sample for sample in data if 11 <= sample["task_id"] <= 510]
130
- elif split == "train":
131
- data = [sample for sample in data if 601 <= sample["task_id"] <= 974]
132
- elif split == "validation":
133
- data = [sample for sample in data if 511 <= sample["task_id"] <= 600]
134
- elif split == "prompt":
135
- data = [sample for sample in data if 1 <= sample["task_id"] <= 10]
136
- id_ = 0
137
- for sample in data:
138
- yield id_, sample
139
- id_ += 1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
sanitized/prompt-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:73c623309b7b5d65fd5661204b35f779f8e66301aa9832d1ad4b8fc3b21151fd
3
+ size 6717
sanitized/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e9e9efa2c0d59ef5e55537a9d126b8f875d5ac010a8d75628d76824884e15850
3
+ size 60864
sanitized/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d95f8ad6d2fff08fe4826122d6e3e31f75716825d0c5c340d297aca5e9e0de0e
3
+ size 33854
sanitized/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:27e065fcab3c863959933328a7fdbf404e1bcb5464b1be6fe0dcd9530e420204
3
+ size 13987