Commit
•
72b5c46
1
Parent(s):
7503a06
Convert dataset to Parquet (#4)
Browse files- Convert dataset to Parquet (06cde0518cfc5d17362fc6e6b07983eb355eba19)
- Add NE data files (97a933d53d203e785e6f78cba54915661d45e94b)
- Add P data files (3df944cd17642a66ef280973e6ab65064265cd2d)
- Add V data files (004c195ebcedc5291e47c5502497705fc278930a)
- Add raw data files (a731474f5e462bb74d650687391cd0d6e87659f2)
- Delete legacy dataset_infos.json (3298b4f6fa9e56d0acfc5771d28369d4c645b814)
- Delete loading script (c0c7e39da5ac04080220da735903622498477c88)
- Delete data file (e91ed131e95b8ac63bdbaea446216033157c74c9)
- data/CBTest.tgz → CN/test-00000-of-00001.parquet +2 -2
- CN/train-00000-of-00001.parquet +3 -0
- CN/validation-00000-of-00001.parquet +3 -0
- NE/test-00000-of-00001.parquet +3 -0
- NE/train-00000-of-00001.parquet +3 -0
- NE/validation-00000-of-00001.parquet +3 -0
- P/test-00000-of-00001.parquet +3 -0
- P/train-00000-of-00002.parquet +3 -0
- P/train-00001-of-00002.parquet +3 -0
- P/validation-00000-of-00001.parquet +3 -0
- README.md +89 -48
- V/test-00000-of-00001.parquet +3 -0
- V/train-00000-of-00001.parquet +3 -0
- V/validation-00000-of-00001.parquet +3 -0
- cbt.py +0 -206
- dataset_infos.json +0 -1
- raw/test-00000-of-00001.parquet +3 -0
- raw/train-00000-of-00001.parquet +3 -0
- raw/validation-00000-of-00001.parquet +3 -0
data/CBTest.tgz → CN/test-00000-of-00001.parquet
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f9647bc0112b98b7206a60af78bc5551f9f07f21baa5768c233ee3f3f0bbe71a
|
3 |
+
size 2091183
|
CN/train-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f9321bcc044cfd582addad049f1c8ea22f4754f598f1cf971dd176d927b67834
|
3 |
+
size 28170984
|
CN/validation-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:94a85928850253a6a62769ceca5da06800340514f7c318e3204a98b7f3fa7599
|
3 |
+
size 1352999
|
NE/test-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:670346965a8886436d9321d69aac10b36610a042a9d124390f88a258f5757af6
|
3 |
+
size 2115862
|
NE/train-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:06fae91ce02cf7f3caadf3ead30c4399ac4e56f97c100cad4681145a3d23229a
|
3 |
+
size 26239734
|
NE/validation-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:54ccd4a04d43a309ee6b0829ac737b7d7a70a0031827b58d31a4da080d07de97
|
3 |
+
size 1337479
|
P/test-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:984196ed7b98736cf9237c50dfd6ee418edb94255edb74255b060954acfd5fd4
|
3 |
+
size 2312383
|
P/train-00000-of-00002.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c844b12e6be18116cf98fceabc80d84e4520f22043bb824d3051c1cc6cdf8fad
|
3 |
+
size 19612810
|
P/train-00001-of-00002.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a9d18ed691f3a67c8cd9d9e0774d6931c4a1859439886333eb241fcdf0342fd5
|
3 |
+
size 20469947
|
P/validation-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c4c727eeb37d9cd727fcf0a7b30be54042d766ff4c56fc10498d4e245e8167f1
|
3 |
+
size 1430216
|
README.md
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
---
|
2 |
-
pretty_name: Children’s Book Test (CBT)
|
3 |
annotations_creators:
|
4 |
- machine-generated
|
5 |
language_creators:
|
@@ -21,26 +20,37 @@ task_categories:
|
|
21 |
task_ids:
|
22 |
- multiple-choice-qa
|
23 |
paperswithcode_id: cbt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
dataset_info:
|
25 |
-
- config_name:
|
26 |
features:
|
27 |
-
- name:
|
|
|
|
|
28 |
dtype: string
|
29 |
-
- name:
|
30 |
dtype: string
|
|
|
|
|
31 |
splits:
|
32 |
- name: train
|
33 |
-
num_bytes:
|
34 |
-
num_examples:
|
35 |
- name: test
|
36 |
-
num_bytes:
|
37 |
-
num_examples:
|
38 |
- name: validation
|
39 |
-
num_bytes:
|
40 |
-
num_examples:
|
41 |
-
download_size:
|
42 |
-
dataset_size:
|
43 |
-
- config_name:
|
44 |
features:
|
45 |
- name: sentences
|
46 |
sequence: string
|
@@ -52,16 +62,16 @@ dataset_info:
|
|
52 |
sequence: string
|
53 |
splits:
|
54 |
- name: train
|
55 |
-
num_bytes:
|
56 |
-
num_examples:
|
57 |
- name: test
|
58 |
-
num_bytes:
|
59 |
num_examples: 2500
|
60 |
- name: validation
|
61 |
-
num_bytes:
|
62 |
num_examples: 2000
|
63 |
-
download_size:
|
64 |
-
dataset_size:
|
65 |
- config_name: P
|
66 |
features:
|
67 |
- name: sentences
|
@@ -82,9 +92,9 @@ dataset_info:
|
|
82 |
- name: validation
|
83 |
num_bytes: 4776981
|
84 |
num_examples: 2000
|
85 |
-
download_size:
|
86 |
dataset_size: 863707630
|
87 |
-
- config_name:
|
88 |
features:
|
89 |
- name: sentences
|
90 |
sequence: string
|
@@ -96,44 +106,75 @@ dataset_info:
|
|
96 |
sequence: string
|
97 |
splits:
|
98 |
- name: train
|
99 |
-
num_bytes:
|
100 |
-
num_examples:
|
101 |
- name: test
|
102 |
-
num_bytes:
|
103 |
num_examples: 2500
|
104 |
- name: validation
|
105 |
-
num_bytes:
|
106 |
num_examples: 2000
|
107 |
-
download_size:
|
108 |
-
dataset_size:
|
109 |
-
- config_name:
|
110 |
features:
|
111 |
-
- name:
|
112 |
-
sequence: string
|
113 |
-
- name: question
|
114 |
dtype: string
|
115 |
-
- name:
|
116 |
dtype: string
|
117 |
-
- name: options
|
118 |
-
sequence: string
|
119 |
splits:
|
120 |
- name: train
|
121 |
-
num_bytes:
|
122 |
-
num_examples:
|
123 |
- name: test
|
124 |
-
num_bytes:
|
125 |
-
num_examples:
|
126 |
- name: validation
|
127 |
-
num_bytes:
|
128 |
-
num_examples:
|
129 |
-
download_size:
|
130 |
-
dataset_size:
|
131 |
-
|
132 |
-
- CN
|
133 |
-
|
134 |
-
-
|
135 |
-
|
136 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
---
|
138 |
|
139 |
# Dataset Card for CBT
|
|
|
1 |
---
|
|
|
2 |
annotations_creators:
|
3 |
- machine-generated
|
4 |
language_creators:
|
|
|
20 |
task_ids:
|
21 |
- multiple-choice-qa
|
22 |
paperswithcode_id: cbt
|
23 |
+
pretty_name: Children’s Book Test (CBT)
|
24 |
+
config_names:
|
25 |
+
- CN
|
26 |
+
- NE
|
27 |
+
- P
|
28 |
+
- V
|
29 |
+
- raw
|
30 |
dataset_info:
|
31 |
+
- config_name: CN
|
32 |
features:
|
33 |
+
- name: sentences
|
34 |
+
sequence: string
|
35 |
+
- name: question
|
36 |
dtype: string
|
37 |
+
- name: answer
|
38 |
dtype: string
|
39 |
+
- name: options
|
40 |
+
sequence: string
|
41 |
splits:
|
42 |
- name: train
|
43 |
+
num_bytes: 301730151
|
44 |
+
num_examples: 120769
|
45 |
- name: test
|
46 |
+
num_bytes: 6138376
|
47 |
+
num_examples: 2500
|
48 |
- name: validation
|
49 |
+
num_bytes: 4737257
|
50 |
+
num_examples: 2000
|
51 |
+
download_size: 31615166
|
52 |
+
dataset_size: 312605784
|
53 |
+
- config_name: NE
|
54 |
features:
|
55 |
- name: sentences
|
56 |
sequence: string
|
|
|
62 |
sequence: string
|
63 |
splits:
|
64 |
- name: train
|
65 |
+
num_bytes: 253551931
|
66 |
+
num_examples: 108719
|
67 |
- name: test
|
68 |
+
num_bytes: 5707734
|
69 |
num_examples: 2500
|
70 |
- name: validation
|
71 |
+
num_bytes: 4424316
|
72 |
num_examples: 2000
|
73 |
+
download_size: 29693075
|
74 |
+
dataset_size: 263683981
|
75 |
- config_name: P
|
76 |
features:
|
77 |
- name: sentences
|
|
|
92 |
- name: validation
|
93 |
num_bytes: 4776981
|
94 |
num_examples: 2000
|
95 |
+
download_size: 43825356
|
96 |
dataset_size: 863707630
|
97 |
+
- config_name: V
|
98 |
features:
|
99 |
- name: sentences
|
100 |
sequence: string
|
|
|
106 |
sequence: string
|
107 |
splits:
|
108 |
- name: train
|
109 |
+
num_bytes: 252177649
|
110 |
+
num_examples: 105825
|
111 |
- name: test
|
112 |
+
num_bytes: 5806625
|
113 |
num_examples: 2500
|
114 |
- name: validation
|
115 |
+
num_bytes: 4556425
|
116 |
num_examples: 2000
|
117 |
+
download_size: 29992082
|
118 |
+
dataset_size: 262540699
|
119 |
+
- config_name: raw
|
120 |
features:
|
121 |
+
- name: title
|
|
|
|
|
122 |
dtype: string
|
123 |
+
- name: content
|
124 |
dtype: string
|
|
|
|
|
125 |
splits:
|
126 |
- name: train
|
127 |
+
num_bytes: 25741580
|
128 |
+
num_examples: 98
|
129 |
- name: test
|
130 |
+
num_bytes: 1528704
|
131 |
+
num_examples: 5
|
132 |
- name: validation
|
133 |
+
num_bytes: 1182657
|
134 |
+
num_examples: 5
|
135 |
+
download_size: 16350790
|
136 |
+
dataset_size: 28452941
|
137 |
+
configs:
|
138 |
+
- config_name: CN
|
139 |
+
data_files:
|
140 |
+
- split: train
|
141 |
+
path: CN/train-*
|
142 |
+
- split: test
|
143 |
+
path: CN/test-*
|
144 |
+
- split: validation
|
145 |
+
path: CN/validation-*
|
146 |
+
- config_name: NE
|
147 |
+
data_files:
|
148 |
+
- split: train
|
149 |
+
path: NE/train-*
|
150 |
+
- split: test
|
151 |
+
path: NE/test-*
|
152 |
+
- split: validation
|
153 |
+
path: NE/validation-*
|
154 |
+
- config_name: P
|
155 |
+
data_files:
|
156 |
+
- split: train
|
157 |
+
path: P/train-*
|
158 |
+
- split: test
|
159 |
+
path: P/test-*
|
160 |
+
- split: validation
|
161 |
+
path: P/validation-*
|
162 |
+
- config_name: V
|
163 |
+
data_files:
|
164 |
+
- split: train
|
165 |
+
path: V/train-*
|
166 |
+
- split: test
|
167 |
+
path: V/test-*
|
168 |
+
- split: validation
|
169 |
+
path: V/validation-*
|
170 |
+
- config_name: raw
|
171 |
+
data_files:
|
172 |
+
- split: train
|
173 |
+
path: raw/train-*
|
174 |
+
- split: test
|
175 |
+
path: raw/test-*
|
176 |
+
- split: validation
|
177 |
+
path: raw/validation-*
|
178 |
---
|
179 |
|
180 |
# Dataset Card for CBT
|
V/test-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7ac63af0ae21d5b2d2a7ee57dc7f5a61e10e21b7209a6b52f0d2a075e21414fc
|
3 |
+
size 2099626
|
V/train-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c7ef1e105aca01465d1b3f180f0e81c163caf5be232313b78d08fb503f9f22ef
|
3 |
+
size 26506525
|
V/validation-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a9eb1045c1ce6f0154a6f6f4be68afdb88651e949bf654fad354215a616f8c25
|
3 |
+
size 1385931
|
cbt.py
DELETED
@@ -1,206 +0,0 @@
|
|
1 |
-
# coding=utf-8
|
2 |
-
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
|
3 |
-
#
|
4 |
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
-
# you may not use this file except in compliance with the License.
|
6 |
-
# You may obtain a copy of the License at
|
7 |
-
#
|
8 |
-
# http://www.apache.org/licenses/LICENSE-2.0
|
9 |
-
#
|
10 |
-
# Unless required by applicable law or agreed to in writing, software
|
11 |
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
-
# See the License for the specific language governing permissions and
|
14 |
-
# limitations under the License.
|
15 |
-
"""Children's Book Test Dataset."""
|
16 |
-
|
17 |
-
|
18 |
-
import datasets
|
19 |
-
|
20 |
-
|
21 |
-
_CITATION = """\
|
22 |
-
@misc{hill2016goldilocks,
|
23 |
-
title={The Goldilocks Principle: Reading Children's Books with Explicit Memory Representations},
|
24 |
-
author={Felix Hill and Antoine Bordes and Sumit Chopra and Jason Weston},
|
25 |
-
year={2016},
|
26 |
-
eprint={1511.02301},
|
27 |
-
archivePrefix={arXiv},
|
28 |
-
primaryClass={cs.CL}
|
29 |
-
}
|
30 |
-
"""
|
31 |
-
|
32 |
-
|
33 |
-
_DESCRIPTION = """\
|
34 |
-
The Children’s Book Test (CBT) is designed to measure directly
|
35 |
-
how well language models can exploit wider linguistic context.
|
36 |
-
The CBT is built from books that are freely available.
|
37 |
-
"""
|
38 |
-
|
39 |
-
_HOMEPAGE = "https://research.fb.com/downloads/babi/"
|
40 |
-
|
41 |
-
_LICENSE = """GNU Free Documentation License v1.3"""
|
42 |
-
|
43 |
-
ZIP_URL = "data/CBTest.tgz"
|
44 |
-
dir = "CBTest/data/"
|
45 |
-
paths = {
|
46 |
-
"raw": {"train": dir + "cbt_train.txt", "valid": dir + "cbt_valid.txt", "test": dir + "cbt_test.txt"},
|
47 |
-
"V": {
|
48 |
-
"train": dir + "cbtest_V_train.txt",
|
49 |
-
"valid": dir + "cbtest_V_valid_2000ex.txt",
|
50 |
-
"test": dir + "cbtest_V_test_2500ex.txt",
|
51 |
-
},
|
52 |
-
"P": {
|
53 |
-
"train": dir + "cbtest_P_train.txt",
|
54 |
-
"valid": dir + "cbtest_P_valid_2000ex.txt",
|
55 |
-
"test": dir + "cbtest_P_test_2500ex.txt",
|
56 |
-
},
|
57 |
-
"NE": {
|
58 |
-
"train": dir + "cbtest_NE_train.txt",
|
59 |
-
"valid": dir + "cbtest_NE_valid_2000ex.txt",
|
60 |
-
"test": dir + "cbtest_NE_test_2500ex.txt",
|
61 |
-
},
|
62 |
-
"CN": {
|
63 |
-
"train": dir + "cbtest_CN_train.txt",
|
64 |
-
"valid": dir + "cbtest_CN_valid_2000ex.txt",
|
65 |
-
"test": dir + "cbtest_CN_test_2500ex.txt",
|
66 |
-
},
|
67 |
-
}
|
68 |
-
|
69 |
-
|
70 |
-
class Cbt(datasets.GeneratorBasedBuilder):
|
71 |
-
"""TODO: Short description of my dataset."""
|
72 |
-
|
73 |
-
VERSION = datasets.Version("1.1.0")
|
74 |
-
|
75 |
-
BUILDER_CONFIGS = [
|
76 |
-
datasets.BuilderConfig(
|
77 |
-
name="raw", version=VERSION, description="This part of my dataset covers the raw CBT books"
|
78 |
-
),
|
79 |
-
datasets.BuilderConfig(
|
80 |
-
name="V", version=VERSION, description="This part of my dataset covers the verb answer CBT dataset"
|
81 |
-
),
|
82 |
-
datasets.BuilderConfig(
|
83 |
-
name="P", version=VERSION, description="This part of my dataset covers the preposition answer CBT dataset"
|
84 |
-
),
|
85 |
-
datasets.BuilderConfig(
|
86 |
-
name="NE",
|
87 |
-
version=VERSION,
|
88 |
-
description="This part of my dataset covers the named entity answer CBT dataset",
|
89 |
-
),
|
90 |
-
datasets.BuilderConfig(
|
91 |
-
name="CN", version=VERSION, description="This part of my dataset covers the common noun answer CBT dataset"
|
92 |
-
),
|
93 |
-
]
|
94 |
-
|
95 |
-
def _info(self):
|
96 |
-
if self.config.name in ["V", "P", "NE", "CN"]:
|
97 |
-
features = datasets.Features(
|
98 |
-
{
|
99 |
-
"sentences": datasets.Sequence(datasets.Value("string")), # There are 20 sentences
|
100 |
-
"question": datasets.Value("string"),
|
101 |
-
"answer": datasets.Value("string"),
|
102 |
-
"options": datasets.Sequence(datasets.Value("string")),
|
103 |
-
}
|
104 |
-
)
|
105 |
-
else: # This is an example to show how to have different features for "first_domain" and "second_domain"
|
106 |
-
features = datasets.Features({"title": datasets.Value("string"), "content": datasets.Value("string")})
|
107 |
-
return datasets.DatasetInfo(
|
108 |
-
# This is the description that will appear on the datasets page.
|
109 |
-
description=_DESCRIPTION,
|
110 |
-
# This defines the different columns of the dataset and their types
|
111 |
-
features=features, # Here we define them above because they are different between the two configurations
|
112 |
-
# If there's a common (input, target) tuple from the features,
|
113 |
-
# specify them here. They'll be used if as_supervised=True in
|
114 |
-
# builder.as_dataset.
|
115 |
-
supervised_keys=None,
|
116 |
-
# Homepage of the dataset for documentation
|
117 |
-
homepage=_HOMEPAGE,
|
118 |
-
# License for the dataset if available
|
119 |
-
license=_LICENSE,
|
120 |
-
# Citation for the dataset
|
121 |
-
citation=_CITATION,
|
122 |
-
)
|
123 |
-
|
124 |
-
def _split_generators(self, dl_manager):
|
125 |
-
"""Returns SplitGenerators."""
|
126 |
-
my_urls = ZIP_URL # Cannot download just one single type as it is a compressed file.
|
127 |
-
archive = dl_manager.download(my_urls)
|
128 |
-
return [
|
129 |
-
datasets.SplitGenerator(
|
130 |
-
name=datasets.Split.TRAIN,
|
131 |
-
# These kwargs will be passed to _generate_examples
|
132 |
-
gen_kwargs={"filepath": paths[self.config.name]["train"], "files": dl_manager.iter_archive(archive)},
|
133 |
-
),
|
134 |
-
datasets.SplitGenerator(
|
135 |
-
name=datasets.Split.TEST,
|
136 |
-
# These kwargs will be passed to _generate_examples
|
137 |
-
gen_kwargs={"filepath": paths[self.config.name]["test"], "files": dl_manager.iter_archive(archive)},
|
138 |
-
),
|
139 |
-
datasets.SplitGenerator(
|
140 |
-
name=datasets.Split.VALIDATION,
|
141 |
-
# These kwargs will be passed to _generate_examples
|
142 |
-
gen_kwargs={"filepath": paths[self.config.name]["valid"], "files": dl_manager.iter_archive(archive)},
|
143 |
-
),
|
144 |
-
]
|
145 |
-
|
146 |
-
def _generate_examples(self, filepath, files):
|
147 |
-
"""Yields examples as (key, example) tuples."""
|
148 |
-
for path, f in files:
|
149 |
-
if path == filepath:
|
150 |
-
if self.config.name != "raw":
|
151 |
-
sentences = []
|
152 |
-
example_idx = 0
|
153 |
-
for idx, line in enumerate(f):
|
154 |
-
line = line.decode("utf-8")
|
155 |
-
if line.strip() == "":
|
156 |
-
continue
|
157 |
-
|
158 |
-
elif line.split()[0] == "21":
|
159 |
-
splitline = line.split("\t") # question, answer options are tab separated
|
160 |
-
question = splitline[0]
|
161 |
-
answer = splitline[1]
|
162 |
-
options = splitline[-1]
|
163 |
-
question = question[2:].strip() # The first two indices contain `21`.
|
164 |
-
answer = answer.strip()
|
165 |
-
options = options.strip().split("|")
|
166 |
-
yield example_idx, {
|
167 |
-
"sentences": sentences,
|
168 |
-
"question": question,
|
169 |
-
"options": options,
|
170 |
-
"answer": answer,
|
171 |
-
}
|
172 |
-
|
173 |
-
sentences = []
|
174 |
-
example_idx += 1
|
175 |
-
else:
|
176 |
-
if len(line.split()[0]) == 1:
|
177 |
-
sentences.append(line[1:].strip())
|
178 |
-
else:
|
179 |
-
sentences.append(line[2:].strip())
|
180 |
-
# Text might contain double spaces.
|
181 |
-
else:
|
182 |
-
book_idx = 0
|
183 |
-
book_sentences = []
|
184 |
-
for idx, line in enumerate(f):
|
185 |
-
line = line.decode("utf-8")
|
186 |
-
if line[:12] == "_BOOK_TITLE_":
|
187 |
-
if idx == 0: # First line:
|
188 |
-
title = line.split(":")[1].strip()
|
189 |
-
else:
|
190 |
-
yield book_idx, {
|
191 |
-
"title": title,
|
192 |
-
"content": "".join(book_sentences),
|
193 |
-
}
|
194 |
-
title = line.split(":")[1].strip()
|
195 |
-
book_sentences = []
|
196 |
-
book_idx += 1
|
197 |
-
else:
|
198 |
-
book_sentences.append(line)
|
199 |
-
else:
|
200 |
-
yield book_idx, {
|
201 |
-
"title": title,
|
202 |
-
"content": "".join(book_sentences),
|
203 |
-
}
|
204 |
-
book_sentences = []
|
205 |
-
book_idx += 1
|
206 |
-
break
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dataset_infos.json
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
{"raw": {"description": "The Children\u2019s Book Test (CBT) is designed to measure directly\nhow well language models can exploit wider linguistic context.\nThe CBT is built from books that are freely available.\n", "citation": "@misc{hill2016goldilocks,\n title={The Goldilocks Principle: Reading Children's Books with Explicit Memory Representations},\n author={Felix Hill and Antoine Bordes and Sumit Chopra and Jason Weston},\n year={2016},\n eprint={1511.02301},\n archivePrefix={arXiv},\n primaryClass={cs.CL}\n}\n", "homepage": "https://research.fb.com/downloads/babi/", "license": "GNU Free Documentation License v1.3", "features": {"title": {"dtype": "string", "id": null, "_type": "Value"}, "content": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "cbt", "config_name": "raw", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 25741580, "num_examples": 98, "dataset_name": "cbt"}, "test": {"name": "test", "num_bytes": 1528704, "num_examples": 5, "dataset_name": "cbt"}, "validation": {"name": "validation", "num_bytes": 1182657, "num_examples": 5, "dataset_name": "cbt"}}, "download_checksums": {"data/CBTest.tgz": {"num_bytes": 120547669, "checksum": "932df0cadc1337b2a12b4c696b1041c1d1c6d4b6bd319874c6288f02e4a61e92"}}, "download_size": 120547669, "post_processing_size": null, "dataset_size": 28452941, "size_in_bytes": 149000610}, "V": {"description": "The Children\u2019s Book Test (CBT) is designed to measure directly\nhow well language models can exploit wider linguistic context.\nThe CBT is built from books that are freely available.\n", "citation": "@misc{hill2016goldilocks,\n title={The Goldilocks Principle: Reading Children's Books with Explicit Memory Representations},\n author={Felix Hill and Antoine Bordes and Sumit Chopra and Jason Weston},\n year={2016},\n eprint={1511.02301},\n archivePrefix={arXiv},\n primaryClass={cs.CL}\n}\n", "homepage": "https://research.fb.com/downloads/babi/", "license": "GNU Free Documentation License v1.3", "features": {"sentences": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "question": {"dtype": "string", "id": null, "_type": "Value"}, "answer": {"dtype": "string", "id": null, "_type": "Value"}, "options": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "cbt", "config_name": "V", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 252177649, "num_examples": 105825, "dataset_name": "cbt"}, "test": {"name": "test", "num_bytes": 5806625, "num_examples": 2500, "dataset_name": "cbt"}, "validation": {"name": "validation", "num_bytes": 4556425, "num_examples": 2000, "dataset_name": "cbt"}}, "download_checksums": {"data/CBTest.tgz": {"num_bytes": 120547669, "checksum": "932df0cadc1337b2a12b4c696b1041c1d1c6d4b6bd319874c6288f02e4a61e92"}}, "download_size": 120547669, "post_processing_size": null, "dataset_size": 262540699, "size_in_bytes": 383088368}, "P": {"description": "The Children\u2019s Book Test (CBT) is designed to measure directly\nhow well language models can exploit wider linguistic context.\nThe CBT is built from books that are freely available.\n", "citation": "@misc{hill2016goldilocks,\n title={The Goldilocks Principle: Reading Children's Books with Explicit Memory Representations},\n author={Felix Hill and Antoine Bordes and Sumit Chopra and Jason Weston},\n year={2016},\n eprint={1511.02301},\n archivePrefix={arXiv},\n primaryClass={cs.CL}\n}\n", "homepage": "https://research.fb.com/downloads/babi/", "license": "GNU Free Documentation License v1.3", "features": {"sentences": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "question": {"dtype": "string", "id": null, "_type": "Value"}, "answer": {"dtype": "string", "id": null, "_type": "Value"}, "options": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "cbt", "config_name": "P", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 852852601, "num_examples": 334030, "dataset_name": "cbt"}, "test": {"name": "test", "num_bytes": 6078048, "num_examples": 2500, "dataset_name": "cbt"}, "validation": {"name": "validation", "num_bytes": 4776981, "num_examples": 2000, "dataset_name": "cbt"}}, "download_checksums": {"data/CBTest.tgz": {"num_bytes": 120547669, "checksum": "932df0cadc1337b2a12b4c696b1041c1d1c6d4b6bd319874c6288f02e4a61e92"}}, "download_size": 120547669, "post_processing_size": null, "dataset_size": 863707630, "size_in_bytes": 984255299}, "NE": {"description": "The Children\u2019s Book Test (CBT) is designed to measure directly\nhow well language models can exploit wider linguistic context.\nThe CBT is built from books that are freely available.\n", "citation": "@misc{hill2016goldilocks,\n title={The Goldilocks Principle: Reading Children's Books with Explicit Memory Representations},\n author={Felix Hill and Antoine Bordes and Sumit Chopra and Jason Weston},\n year={2016},\n eprint={1511.02301},\n archivePrefix={arXiv},\n primaryClass={cs.CL}\n}\n", "homepage": "https://research.fb.com/downloads/babi/", "license": "GNU Free Documentation License v1.3", "features": {"sentences": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "question": {"dtype": "string", "id": null, "_type": "Value"}, "answer": {"dtype": "string", "id": null, "_type": "Value"}, "options": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "cbt", "config_name": "NE", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 253551931, "num_examples": 108719, "dataset_name": "cbt"}, "test": {"name": "test", "num_bytes": 5707734, "num_examples": 2500, "dataset_name": "cbt"}, "validation": {"name": "validation", "num_bytes": 4424316, "num_examples": 2000, "dataset_name": "cbt"}}, "download_checksums": {"data/CBTest.tgz": {"num_bytes": 120547669, "checksum": "932df0cadc1337b2a12b4c696b1041c1d1c6d4b6bd319874c6288f02e4a61e92"}}, "download_size": 120547669, "post_processing_size": null, "dataset_size": 263683981, "size_in_bytes": 384231650}, "CN": {"description": "The Children\u2019s Book Test (CBT) is designed to measure directly\nhow well language models can exploit wider linguistic context.\nThe CBT is built from books that are freely available.\n", "citation": "@misc{hill2016goldilocks,\n title={The Goldilocks Principle: Reading Children's Books with Explicit Memory Representations},\n author={Felix Hill and Antoine Bordes and Sumit Chopra and Jason Weston},\n year={2016},\n eprint={1511.02301},\n archivePrefix={arXiv},\n primaryClass={cs.CL}\n}\n", "homepage": "https://research.fb.com/downloads/babi/", "license": "GNU Free Documentation License v1.3", "features": {"sentences": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "question": {"dtype": "string", "id": null, "_type": "Value"}, "answer": {"dtype": "string", "id": null, "_type": "Value"}, "options": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "cbt", "config_name": "CN", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 301730151, "num_examples": 120769, "dataset_name": "cbt"}, "test": {"name": "test", "num_bytes": 6138376, "num_examples": 2500, "dataset_name": "cbt"}, "validation": {"name": "validation", "num_bytes": 4737257, "num_examples": 2000, "dataset_name": "cbt"}}, "download_checksums": {"data/CBTest.tgz": {"num_bytes": 120547669, "checksum": "932df0cadc1337b2a12b4c696b1041c1d1c6d4b6bd319874c6288f02e4a61e92"}}, "download_size": 120547669, "post_processing_size": null, "dataset_size": 312605784, "size_in_bytes": 433153453}}
|
|
|
|
raw/test-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:31e9ed730a7c2e224f4ac7839d423a2b6ec3307d80f68fedf0cdfad81d7a747e
|
3 |
+
size 854786
|
raw/train-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:41739534f7c732599813e0adc06a2ad014ad6d06a08f62865d1d7d6e666111d9
|
3 |
+
size 14834601
|
raw/validation-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a62915f3a9a2a5518eb8c16d805aa84e211f01c303bc8088a6e45284c45677f9
|
3 |
+
size 661403
|