Datasets:
Commit
·
759cdbc
0
Parent(s):
Update files from the datasets library (from 1.12.0)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.12.0
- .gitattributes +27 -0
- README.md +179 -0
- dataset_infos.json +1 -0
- dummy/plain_text/1.0.0/dummy_data.zip +3 -0
- the_pile_openwebtext2.py +118 -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,179 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- no-annotation
|
4 |
+
language_creators:
|
5 |
+
- found
|
6 |
+
languages:
|
7 |
+
- en
|
8 |
+
licenses:
|
9 |
+
- mit
|
10 |
+
multilinguality:
|
11 |
+
- monolingual
|
12 |
+
pretty_name: OpenWebText2
|
13 |
+
size_categories:
|
14 |
+
- 10M<n<100M
|
15 |
+
source_datasets:
|
16 |
+
- original
|
17 |
+
task_categories:
|
18 |
+
- sequence-modeling
|
19 |
+
- text-scoring
|
20 |
+
task_ids:
|
21 |
+
- language-modeling
|
22 |
+
- text-scoring-other-rating
|
23 |
+
---
|
24 |
+
|
25 |
+
# Dataset Card for the_pile_openwebtext2
|
26 |
+
|
27 |
+
## Table of Contents
|
28 |
+
- [Dataset Card for the_pile_openwebtext2](#dataset-card-for-the_pile_openwebtext2)
|
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 |
+
- [|split|num examples|](#splitnum-examples)
|
39 |
+
- [Dataset Creation](#dataset-creation)
|
40 |
+
- [Curation Rationale](#curation-rationale)
|
41 |
+
- [Source Data](#source-data)
|
42 |
+
- [Initial Data Collection and Normalization](#initial-data-collection-and-normalization)
|
43 |
+
- [Who are the source language producers?](#who-are-the-source-language-producers)
|
44 |
+
- [Annotations](#annotations)
|
45 |
+
- [Annotation process](#annotation-process)
|
46 |
+
- [Who are the annotators?](#who-are-the-annotators)
|
47 |
+
- [Personal and Sensitive Information](#personal-and-sensitive-information)
|
48 |
+
- [Considerations for Using the Data](#considerations-for-using-the-data)
|
49 |
+
- [Social Impact of Dataset](#social-impact-of-dataset)
|
50 |
+
- [Discussion of Biases](#discussion-of-biases)
|
51 |
+
- [Other Known Limitations](#other-known-limitations)
|
52 |
+
- [Additional Information](#additional-information)
|
53 |
+
- [Dataset Curators](#dataset-curators)
|
54 |
+
- [Licensing Information](#licensing-information)
|
55 |
+
- [Citation Information](#citation-information)
|
56 |
+
- [Contributions](#contributions)
|
57 |
+
|
58 |
+
## Dataset Description
|
59 |
+
|
60 |
+
- **Homepage:** https://openwebtext2.readthedocs.io/en/latest/
|
61 |
+
- **Repository:** [GitHub](https://github.com/EleutherAI/openwebtext2)
|
62 |
+
- **Paper:** https://arxiv.org/abs/2101.00027
|
63 |
+
- **Leaderboard:** [Needs More Information]
|
64 |
+
- **Point of Contact:** [Needs More Information]
|
65 |
+
|
66 |
+
### Dataset Summary
|
67 |
+
|
68 |
+
OpenWebText2 is part of EleutherAi/The Pile dataset and is an enhanced version of the original OpenWebTextCorpus covering all Reddit submissions from 2005 up until April 2020, with further months becoming available after the corresponding PushShift dump files are released.
|
69 |
+
|
70 |
+
|download_size|27.3 Gib|
|
71 |
+
|dataset_size|63.8 Gib|
|
72 |
+
|
73 |
+
### Supported Tasks and Leaderboards
|
74 |
+
|
75 |
+
This dataset is used for Language Modeling.
|
76 |
+
|
77 |
+
### Languages
|
78 |
+
|
79 |
+
This dataset is in English.
|
80 |
+
|
81 |
+
## Dataset Structure
|
82 |
+
|
83 |
+
### Data Instances
|
84 |
+
|
85 |
+
```
|
86 |
+
This example was too long and was cropped:
|
87 |
+
|
88 |
+
{'title': Xiaomi Mi Note 10 Gearbest Coupon Promo Code [6+128GB] [France Warehouse],
|
89 |
+
'text': '27% off Xiaomi Mi Note 10 (CC9 Pro) 108MP Penta Camera Mobile Phone Global Version Online Smartphone – Black Gearbest Coupon Promo Code\n\nGearbest Coupon Price :$439.99\n\nRegular Price : $603.19 Your Save : $163.20 Coupon Limit: 100 times Warehouse: France Expires : September 30, 2020 Coupon Valid for...',
|
90 |
+
'reddit_scores': [6],}
|
91 |
+
```
|
92 |
+
|
93 |
+
### Data Fields
|
94 |
+
|
95 |
+
- `title`: title of the web page
|
96 |
+
- `text`: text content of the web page
|
97 |
+
- `reddit_scores`: scores of the reddit submissions that mention this web page, as a list of integers
|
98 |
+
|
99 |
+
### Data Splits
|
100 |
+
|
101 |
+
|split|num examples|
|
102 |
+
--------------------------------
|
103 |
+
|train|17103059|
|
104 |
+
|
105 |
+
## Dataset Creation
|
106 |
+
|
107 |
+
### Curation Rationale
|
108 |
+
|
109 |
+
[Needs More Information]
|
110 |
+
|
111 |
+
### Source Data
|
112 |
+
|
113 |
+
#### Initial Data Collection and Normalization
|
114 |
+
|
115 |
+
[Needs More Information]
|
116 |
+
|
117 |
+
#### Who are the source language producers?
|
118 |
+
|
119 |
+
[Needs More Information]
|
120 |
+
|
121 |
+
### Annotations
|
122 |
+
|
123 |
+
#### Annotation process
|
124 |
+
|
125 |
+
[Needs More Information]
|
126 |
+
|
127 |
+
#### Who are the annotators?
|
128 |
+
|
129 |
+
[Needs More Information]
|
130 |
+
|
131 |
+
### Personal and Sensitive Information
|
132 |
+
|
133 |
+
[Needs More Information]
|
134 |
+
|
135 |
+
## Considerations for Using the Data
|
136 |
+
|
137 |
+
### Social Impact of Dataset
|
138 |
+
|
139 |
+
[Needs More Information]
|
140 |
+
|
141 |
+
### Discussion of Biases
|
142 |
+
|
143 |
+
[Needs More Information]
|
144 |
+
|
145 |
+
### Other Known Limitations
|
146 |
+
|
147 |
+
[Needs More Information]
|
148 |
+
|
149 |
+
## Additional Information
|
150 |
+
|
151 |
+
### Dataset Curators
|
152 |
+
|
153 |
+
[Needs More Information]
|
154 |
+
|
155 |
+
### Licensing Information
|
156 |
+
|
157 |
+
[Needs More Information]
|
158 |
+
|
159 |
+
### Citation Information
|
160 |
+
|
161 |
+
```
|
162 |
+
@article{pile,
|
163 |
+
title={The {P}ile: An 800GB Dataset of Diverse Text for Language Modeling},
|
164 |
+
author={Gao, Leo and Biderman, Stella and Black, Sid and Golding, Laurence and Hoppe, Travis and Foster, Charles and Phang, Jason and He, Horace and Thite, Anish and Nabeshima, Noa and Presser, Shawn and Leahy, Connor},
|
165 |
+
journal={arXiv preprint arXiv:2101.00027},
|
166 |
+
year={2020}
|
167 |
+
}
|
168 |
+
```
|
169 |
+
|
170 |
+
### Contributions
|
171 |
+
|
172 |
+
[researcher2](https://github.com/researcher2) Wrote much of this code, with inspiration and some straight copying of the scraping code found [here](https://github.com/yet-another-account/openwebtext/).<br/>
|
173 |
+
[sdtblck](https://github.com/sdtblck/) kindly put together the Colab notebook, and performed a chunk of the scraping. <br/>
|
174 |
+
[leogao2](https://github.com/leogao2/) provided overall design guidance, lm_dataformat, and performed another chunk of scraping. <br />
|
175 |
+
[Colaboratory](https://colab.research.google.com/) VMs helped with about 10% of our overall scraping. <br />
|
176 |
+
[The Eye](http://the-eye.eu/) host the processed datasets.<br />
|
177 |
+
[Read The Docs](https://readthedocs.org/) host our documentation.<br />
|
178 |
+
|
179 |
+
[@richarddwang](https://github.com/richarddwang) added this dataset to HF/datasets.
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"plain_text": {"description": "OpenWebText2 is an enhanced version of the original OpenWebTextCorpus covering all Reddit submissions from 2005 up until April 2020, with further months becoming available after the corresponding PushShift dump files are released.\n", "citation": "@article{pile,\n title={The {P}ile: An 800GB Dataset of Diverse Text for Language Modeling},\n author={Gao, Leo and Biderman, Stella and Black, Sid and Golding, Laurence and Hoppe, Travis and Foster, Charles and Phang, Jason and He, Horace and Thite, Anish and Nabeshima, Noa and Presser, Shawn and Leahy, Connor},\n journal={arXiv preprint arXiv:2101.00027},\n year={2020}\n}\n", "homepage": "https://openwebtext2.readthedocs.io/en/latest/", "license": "", "features": {"title": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "the_pile_openwebtext2", "config_name": "plain_text", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 68571017395, "num_examples": 17103059, "dataset_name": "the_pile_openwebtext2"}}, "download_checksums": {"https://the-eye.eu/public/AI/pile_preliminary_components/openwebtext2.jsonl.zst.tar": {"num_bytes": 29344276480, "checksum": "9043d1b93c35ff1a38a17e16c73c009d4617dcaab6da15adc0faf4779739a027"}}, "download_size": 29344276480, "post_processing_size": null, "dataset_size": 68571017395, "size_in_bytes": 97915293875}}
|
dummy/plain_text/1.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9584c89a1393bbb87d07bdcb4fa920f7f48f52a0ad2329c48502e15407c1ee90
|
3 |
+
size 462
|
the_pile_openwebtext2.py
ADDED
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
"""The OpenWebText2 Corpus"""
|
16 |
+
|
17 |
+
|
18 |
+
import glob
|
19 |
+
import io
|
20 |
+
import json
|
21 |
+
import os
|
22 |
+
|
23 |
+
import zstandard
|
24 |
+
|
25 |
+
import datasets
|
26 |
+
|
27 |
+
|
28 |
+
_CITATION = """\
|
29 |
+
@article{pile,
|
30 |
+
title={The {P}ile: An 800GB Dataset of Diverse Text for Language Modeling},
|
31 |
+
author={Gao, Leo and Biderman, Stella and Black, Sid and Golding, Laurence and Hoppe, Travis and Foster, Charles and Phang, Jason and He, Horace and Thite, Anish and Nabeshima, Noa and Presser, Shawn and Leahy, Connor},
|
32 |
+
journal={arXiv preprint arXiv:2101.00027},
|
33 |
+
year={2020}
|
34 |
+
}
|
35 |
+
"""
|
36 |
+
|
37 |
+
_DESCRIPTION = """\
|
38 |
+
OpenWebText2 is part of EleutherAi/The Pile dataset and is an enhanced version of the original OpenWebTextCorpus \
|
39 |
+
covering all Reddit submissions from 2005 up until April 2020, \
|
40 |
+
with further months becoming available after the corresponding PushShift dump files are released.
|
41 |
+
"""
|
42 |
+
|
43 |
+
_URL = "https://the-eye.eu/public/AI/pile_preliminary_components/openwebtext2.jsonl.zst.tar"
|
44 |
+
|
45 |
+
|
46 |
+
class Openwebtext2(datasets.GeneratorBasedBuilder):
|
47 |
+
"""The OpenWebText2 dataset."""
|
48 |
+
|
49 |
+
BUILDER_CONFIGS = [
|
50 |
+
datasets.BuilderConfig(
|
51 |
+
name="plain_text",
|
52 |
+
description="Plain text",
|
53 |
+
version=datasets.Version("1.0.0"),
|
54 |
+
)
|
55 |
+
]
|
56 |
+
|
57 |
+
def _info(self):
|
58 |
+
return datasets.DatasetInfo(
|
59 |
+
description=_DESCRIPTION,
|
60 |
+
features=datasets.Features(
|
61 |
+
{
|
62 |
+
"title": datasets.Value("string"),
|
63 |
+
"text": datasets.Value("string"),
|
64 |
+
"reddit_scores": datasets.Sequence(datasets.Value("int8")),
|
65 |
+
}
|
66 |
+
),
|
67 |
+
homepage="https://openwebtext2.readthedocs.io/en/latest/",
|
68 |
+
citation=_CITATION,
|
69 |
+
)
|
70 |
+
|
71 |
+
def _split_generators(self, dl_manager):
|
72 |
+
dl_dir = dl_manager.download_and_extract(_URL)
|
73 |
+
files = glob.glob(os.path.join(dl_dir, "*jsonl.zst"))
|
74 |
+
return [
|
75 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"files": files}),
|
76 |
+
]
|
77 |
+
|
78 |
+
def _generate_examples(self, files):
|
79 |
+
"""Yields examples."""
|
80 |
+
_id = 0
|
81 |
+
for file_path in files:
|
82 |
+
reader = Reader()
|
83 |
+
for document, metadata in reader.read_jsonl(file_path, get_meta=True):
|
84 |
+
yield _id, {
|
85 |
+
"title": metadata["title"],
|
86 |
+
"text": document,
|
87 |
+
"reddit_scores": metadata["reddit_scores"],
|
88 |
+
}
|
89 |
+
_id += 1
|
90 |
+
|
91 |
+
|
92 |
+
# Modified version of lm_dataformat Reader with self.fh set, allowing peeking for tqdm.
|
93 |
+
class Reader:
|
94 |
+
def __init__(self):
|
95 |
+
pass
|
96 |
+
|
97 |
+
def read_jsonl(self, file, get_meta=False, autojoin_paragraphs=True, para_joiner="\n\n"):
|
98 |
+
with open(file, "rb") as fh:
|
99 |
+
self.fh = fh
|
100 |
+
cctx = zstandard.ZstdDecompressor()
|
101 |
+
reader = io.BufferedReader(cctx.stream_reader(fh))
|
102 |
+
for line in reader:
|
103 |
+
ob = json.loads(line)
|
104 |
+
# naive jsonl where each object is just the string itself, with no meta. For legacy compatibility.
|
105 |
+
if isinstance(ob, str):
|
106 |
+
assert not get_meta
|
107 |
+
yield ob
|
108 |
+
continue
|
109 |
+
|
110 |
+
text = ob["text"]
|
111 |
+
|
112 |
+
if autojoin_paragraphs and isinstance(text, list):
|
113 |
+
text = para_joiner.join(text)
|
114 |
+
|
115 |
+
if get_meta:
|
116 |
+
yield text, (ob["meta"] if "meta" in ob else {})
|
117 |
+
else:
|
118 |
+
yield text
|