Convert dataset to Parquet

#1
by jannalu - opened
README.md CHANGED
@@ -1,3 +1,85 @@
1
  ---
2
  license: other
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: other
3
+ configs:
4
+ - config_name: cycle_letters_in_word
5
+ data_files:
6
+ - split: validation
7
+ path: cycle_letters_in_word/validation-*
8
+ - config_name: mid_word_1_anagrams
9
+ data_files:
10
+ - split: validation
11
+ path: mid_word_1_anagrams/validation-*
12
+ - config_name: mid_word_2_anagrams
13
+ data_files:
14
+ - split: validation
15
+ path: mid_word_2_anagrams/validation-*
16
+ - config_name: random_insertion_in_word
17
+ data_files:
18
+ - split: validation
19
+ path: random_insertion_in_word/validation-*
20
+ - config_name: reversed_words
21
+ data_files:
22
+ - split: validation
23
+ path: reversed_words/validation-*
24
+ dataset_info:
25
+ - config_name: cycle_letters_in_word
26
+ features:
27
+ - name: context
28
+ dtype: string
29
+ - name: completion
30
+ dtype: string
31
+ splits:
32
+ - name: validation
33
+ num_bytes: 282654
34
+ num_examples: 10000
35
+ download_size: 216211
36
+ dataset_size: 282654
37
+ - config_name: mid_word_1_anagrams
38
+ features:
39
+ - name: context
40
+ dtype: string
41
+ - name: completion
42
+ dtype: string
43
+ splits:
44
+ - name: validation
45
+ num_bytes: 271516
46
+ num_examples: 10000
47
+ download_size: 214666
48
+ dataset_size: 271516
49
+ - config_name: mid_word_2_anagrams
50
+ features:
51
+ - name: context
52
+ dtype: string
53
+ - name: completion
54
+ dtype: string
55
+ splits:
56
+ - name: validation
57
+ num_bytes: 282654
58
+ num_examples: 10000
59
+ download_size: 219641
60
+ dataset_size: 282654
61
+ - config_name: random_insertion_in_word
62
+ features:
63
+ - name: context
64
+ dtype: string
65
+ - name: completion
66
+ dtype: string
67
+ splits:
68
+ - name: validation
69
+ num_bytes: 353981
70
+ num_examples: 10000
71
+ download_size: 263788
72
+ dataset_size: 353981
73
+ - config_name: reversed_words
74
+ features:
75
+ - name: context
76
+ dtype: string
77
+ - name: completion
78
+ dtype: string
79
+ splits:
80
+ - name: validation
81
+ num_bytes: 282654
82
+ num_examples: 10000
83
+ download_size: 208812
84
+ dataset_size: 282654
85
+ ---
cycle_letters_in_word/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fd55cfd4c854e5cb284f4811adcc0442714bcbae3ac6d2eacae20e02b4d68835
3
+ size 216211
mid_word_1_anagrams/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:302c664221244ef6d689fde2de05939ef3b841a1f386931f7970836f126572ed
3
+ size 214666
mid_word_2_anagrams/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c8832654b545bc435953faf22e670c862211eb9832e517b3e8ab27d6456619e4
3
+ size 219641
random_insertion_in_word/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:08110f6c7c5d5440d72a1ce6f0a6d9a691835ae7f7c9f6cc5cf89c245222795a
3
+ size 263788
reversed_words/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2ff4bd671470bcf0011cd4c2e6f8bba9664fac808a478c81e1ee4baa1d871fd5
3
+ size 208812
unscramble.py DELETED
@@ -1,110 +0,0 @@
1
- # Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
- """Unscramble dataset."""
15
-
16
-
17
- import json
18
- import os
19
-
20
- import datasets
21
-
22
-
23
- _CITATION = """\
24
- @inproceedings{NEURIPS2020_1457c0d6,
25
- author = {Brown, Tom and Mann, Benjamin and Ryder, Nick and Subbiah, Melanie and Kaplan, Jared D and Dhariwal, Prafulla and Neelakantan, Arvind and Shyam, Pranav and Sastry, Girish and Askell, Amanda and Agarwal, Sandhini and Herbert-Voss, Ariel and Krueger, Gretchen and Henighan, Tom and Child, Rewon and Ramesh, Aditya and Ziegler, Daniel and Wu, Jeffrey and Winter, Clemens and Hesse, Chris and Chen, Mark and Sigler, Eric and Litwin, Mateusz and Gray, Scott and Chess, Benjamin and Clark, Jack and Berner, Christopher and McCandlish, Sam and Radford, Alec and Sutskever, Ilya and Amodei, Dario},
26
- booktitle = {Advances in Neural Information Processing Systems},
27
- editor = {H. Larochelle and M. Ranzato and R. Hadsell and M. F. Balcan and H. Lin},
28
- pages = {1877--1901},
29
- publisher = {Curran Associates, Inc.},
30
- title = {Language Models are Few-Shot Learners},
31
- url = {https://proceedings.neurips.cc/paper/2020/file/1457c0d6bfcb4967418bfb8ac142f64a-Paper.pdf},
32
- volume = {33},
33
- year = {2020}
34
- }
35
- """
36
-
37
- _DESCRIPTION = """\
38
- Unscramble is a small battery of 5 “character manipulation” tasks. Each task
39
- involves giving the model a word distorted by some combination of scrambling,
40
- addition, or deletion of characters, and asking it to recover the original word.
41
- """
42
-
43
- _HOMEPAGE = "https://github.com/openai/gpt-3/tree/master/data"
44
-
45
-
46
- _LICENSE = "No license found"
47
-
48
- _BASE_URL = "https://raw.githubusercontent.com/openai/gpt-3/master/data"
49
-
50
-
51
- _DESCRIPTIONS = {
52
- "mid_word_1_anagrams": "Anagrams of all but the first and last letter.",
53
- "mid_word_2_anagrams": "Anagrams of all but the first and last 2 letters.",
54
- "cycle_letters_in_word": "Cycle letters in the word.",
55
- "random_insertion_in_word": "Random insertions in the word that must be removed.",
56
- "reversed_words": "Words spelled backwards that must be reversed.",
57
- }
58
- _NAMES = _DESCRIPTIONS.keys()
59
-
60
-
61
- class Unscramble(datasets.GeneratorBasedBuilder):
62
- """Unscramble is a small battery of 5 “character manipulation” tasks."""
63
-
64
- VERSION = datasets.Version("0.0.1")
65
-
66
- BUILDER_CONFIGS = [
67
- datasets.BuilderConfig(
68
- name=name, version=version, description=_DESCRIPTIONS[name]
69
- )
70
- for name, version in zip(_NAMES, [VERSION] * len(_NAMES))
71
- ]
72
-
73
- def _info(self):
74
- features = datasets.Features(
75
- {
76
- "context": datasets.Value("string"),
77
- "completion": datasets.Value("string"),
78
- }
79
- )
80
- return datasets.DatasetInfo(
81
- description=_DESCRIPTION,
82
- features=features,
83
- homepage=_HOMEPAGE,
84
- license=_LICENSE,
85
- citation=_CITATION,
86
- )
87
-
88
- def _split_generators(self, dl_manager):
89
- urls = os.path.join(_BASE_URL, f"{self.config.name}.jsonl.gz")
90
- data_dir = dl_manager.download_and_extract(urls)
91
- return [
92
- datasets.SplitGenerator(
93
- name=datasets.Split.VALIDATION,
94
- # These kwargs will be passed to _generate_examples
95
- gen_kwargs={
96
- "filepath": data_dir,
97
- "split": "validation",
98
- },
99
- ),
100
- ]
101
-
102
- # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
103
- def _generate_examples(self, filepath, split):
104
- with open(filepath, encoding="utf-8") as f:
105
- for key, row in enumerate(f):
106
- data = json.loads(row)
107
- yield key, {
108
- "context": data["context"],
109
- "completion": data["completion"],
110
- }