Commit
•
ced5e97
1
Parent(s):
96b0ee6
Update data URL for enron_emails subset
Browse files- the_pile.py +8 -5
the_pile.py
CHANGED
@@ -57,7 +57,7 @@ _DATA_URLS = {
|
|
57 |
"validation": [f"{_HOST_URL}/public/AI/pile/val.jsonl.zst"],
|
58 |
"test": [f"{_HOST_URL}/public/AI/pile/test.jsonl.zst"],
|
59 |
},
|
60 |
-
"enron_emails": "
|
61 |
"europarl": f"{_HOST_URL}/public/AI/pile_preliminary_components/EuroParliamentProceedings_1996_2011.jsonl.zst",
|
62 |
"free_law": f"{_HOST_URL}/public/AI/pile_preliminary_components/FreeLaw_Opinions.jsonl.zst",
|
63 |
"hacker_news": f"{_HOST_URL}/public/AI/pile_preliminary_components/hn.tar.gz",
|
@@ -222,7 +222,7 @@ class ThePile(datasets.GeneratorBasedBuilder):
|
|
222 |
key += 1
|
223 |
else:
|
224 |
for subset in files:
|
225 |
-
if subset in {"
|
226 |
import zstandard as zstd
|
227 |
|
228 |
with zstd.open(open(files[subset], "rb"), "rt", encoding="utf-8") as f:
|
@@ -230,10 +230,13 @@ class ThePile(datasets.GeneratorBasedBuilder):
|
|
230 |
data = json.loads(row)
|
231 |
yield key, data
|
232 |
key += 1
|
233 |
-
elif subset in {"hacker_news", "pubmed_central"}:
|
234 |
for path, file in files[subset]:
|
235 |
-
|
236 |
-
|
|
|
|
|
|
|
237 |
text = file.read().decode("utf-8")
|
238 |
yield key, {
|
239 |
"text": text,
|
|
|
57 |
"validation": [f"{_HOST_URL}/public/AI/pile/val.jsonl.zst"],
|
58 |
"test": [f"{_HOST_URL}/public/AI/pile/test.jsonl.zst"],
|
59 |
},
|
60 |
+
"enron_emails": "https://www.cs.cmu.edu/~enron/enron_mail_20150507.tar.gz",
|
61 |
"europarl": f"{_HOST_URL}/public/AI/pile_preliminary_components/EuroParliamentProceedings_1996_2011.jsonl.zst",
|
62 |
"free_law": f"{_HOST_URL}/public/AI/pile_preliminary_components/FreeLaw_Opinions.jsonl.zst",
|
63 |
"hacker_news": f"{_HOST_URL}/public/AI/pile_preliminary_components/hn.tar.gz",
|
|
|
222 |
key += 1
|
223 |
else:
|
224 |
for subset in files:
|
225 |
+
if subset in {"europarl", "free_law", "nih_exporter", "pubmed", "ubuntu_irc"}:
|
226 |
import zstandard as zstd
|
227 |
|
228 |
with zstd.open(open(files[subset], "rb"), "rt", encoding="utf-8") as f:
|
|
|
230 |
data = json.loads(row)
|
231 |
yield key, data
|
232 |
key += 1
|
233 |
+
elif subset in {"enron_emails", "hacker_news", "pubmed_central"}:
|
234 |
for path, file in files[subset]:
|
235 |
+
if subset == "enron_emails":
|
236 |
+
meta = {"file": path}
|
237 |
+
else:
|
238 |
+
id_ = path.split("/")[-1].split(".")[0]
|
239 |
+
meta = {"id": id_}
|
240 |
text = file.read().decode("utf-8")
|
241 |
yield key, {
|
242 |
"text": text,
|