system HF staff commited on
Commit
6527b84
1 Parent(s): 05bfcb2

Update files from the datasets library (from 1.16.0)

Browse files

Release notes: https://github.com/huggingface/datasets/releases/tag/1.16.0

Files changed (2) hide show
  1. dataset_infos.json +1 -1
  2. the_pile_books3.py +11 -12
dataset_infos.json CHANGED
@@ -1 +1 @@
1
- {"plain_text": {"description": "Shawn Presser's work. All of bibliotik in plain .txt form, aka 197,000 books processed in exactly \nthe same way as did for bookcorpusopen (a.k.a. books1). seems to be similar to OpenAI's mysterious \n\"books2\" dataset referenced in their papers. Unfortunately OpenAI will not give details, so we know\nvery little about any differences. People suspect it's \"all of libgen\", but it's purely conjecture.\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://github.com/soskek/bookcorpus/issues/27#issuecomment-716104208", "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_books3", "config_name": "plain_text", "version": {"version_str": "1.0.0", "description": "", "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 108395639965, "num_examples": 196640, "dataset_name": "the_pile_books3"}}, "download_checksums": {"https://the-eye.eu/public/AI/pile_preliminary_components/books3.tar.gz": {"num_bytes": 39516981435, "checksum": "016b90fa6b8507328b6a90d13b0f68c2b87dfd281b35e449a1d466fd9eebc14a"}}, "download_size": 39516981435, "post_processing_size": null, "dataset_size": 108395639965, "size_in_bytes": 147912621400}}
 
1
+ {"plain_text": {"description": "This dataset is Shawn Presser's work and is part of EleutherAi/The Pile dataset. This dataset contains all of bibliotik in plain .txt form, aka 197,000 books processed in exactly the same way as did for bookcorpusopen (a.k.a. books1). seems to be similar to OpenAI's mysterious \"books2\" dataset referenced in their papers. Unfortunately OpenAI will not give details, so we know very little about any differences. People suspect it's \"all of libgen\", but it's purely conjecture.\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://github.com/soskek/bookcorpus/issues/27#issuecomment-716104208", "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_books3", "config_name": "plain_text", "version": {"version_str": "1.0.0", "description": "", "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 108371325720, "num_examples": 196608, "dataset_name": "the_pile_books3"}}, "download_checksums": {"https://the-eye.eu/public/AI/pile_preliminary_components/books3.tar.gz": {"num_bytes": 39516981435, "checksum": "016b90fa6b8507328b6a90d13b0f68c2b87dfd281b35e449a1d466fd9eebc14a"}}, "download_size": 39516981435, "post_processing_size": null, "dataset_size": 108371325720, "size_in_bytes": 147888307155}}
the_pile_books3.py CHANGED
@@ -16,9 +16,6 @@
16
  # Lint as: python3
17
  """The BookCorpus dataset based on Shawn Presser's work https://github.com/soskek/bookcorpus/issues/27 """
18
 
19
-
20
- from pathlib import Path
21
-
22
  import datasets
23
 
24
 
@@ -80,19 +77,21 @@ class ThePileBooks3(datasets.GeneratorBasedBuilder):
80
  )
81
 
82
  def _split_generators(self, dl_manager):
83
- extracted_dir = dl_manager.download_and_extract(_DOWNLOAD_URL)
84
- leaf_dirs = Path(extracted_dir).glob("**/Bibliotik/*")
85
- leaf_dirs = sorted(leaf_dirs)
86
 
87
  return [
88
- datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"leaf_dirs": leaf_dirs}),
 
 
 
 
 
89
  ]
90
 
91
- def _generate_examples(self, leaf_dirs):
92
  _id = 0
93
- for leaf_dir in leaf_dirs:
94
- for path in sorted(leaf_dir.glob("**/*.epub.txt")):
95
- with path.open(mode="r", encoding="utf-8") as f:
96
- entry = {"title": path.name, "text": f.read()}
97
  yield _id, entry
98
  _id += 1
 
16
  # Lint as: python3
17
  """The BookCorpus dataset based on Shawn Presser's work https://github.com/soskek/bookcorpus/issues/27 """
18
 
 
 
 
19
  import datasets
20
 
21
 
 
77
  )
78
 
79
  def _split_generators(self, dl_manager):
80
+ archive = dl_manager.download(_DOWNLOAD_URL)
 
 
81
 
82
  return [
83
+ datasets.SplitGenerator(
84
+ name=datasets.Split.TRAIN,
85
+ gen_kwargs={
86
+ "files": dl_manager.iter_archive(archive),
87
+ },
88
+ )
89
  ]
90
 
91
+ def _generate_examples(self, files):
92
  _id = 0
93
+ for path, f in files:
94
+ if path.endswith(".epub.txt"):
95
+ entry = {"title": path.split("/")[-1].split(".")[0], "text": f.read().decode("utf-8")}
 
96
  yield _id, entry
97
  _id += 1