system HF staff commited on
Commit
4d853b8
0 Parent(s):

Update files from the datasets library (from 1.0.0)

Browse files

Release notes: https://github.com/huggingface/datasets/releases/tag/1.0.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
bookcorpus.py ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2020 The TensorFlow Datasets Authors and the HuggingFace Datasets Authors.
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
+
16
+ # Lint as: python3
17
+ """The BookCorpus dataset."""
18
+
19
+ from __future__ import absolute_import, division, print_function
20
+
21
+ import os
22
+
23
+ import datasets
24
+
25
+
26
+ _DESCRIPTION = """\
27
+ Books are a rich source of both fine-grained information, how a character, \
28
+ an object or a scene looks like, as well as high-level semantics, what \
29
+ someone is thinking, feeling and how these states evolve through a story.\
30
+ This work aims to align books to their movie releases in order to provide\
31
+ rich descriptive explanations for visual content that go semantically far\
32
+ beyond the captions available in current datasets. \
33
+ """
34
+
35
+ _CITATION = """\
36
+ @InProceedings{Zhu_2015_ICCV,
37
+ title = {Aligning Books and Movies: Towards Story-Like Visual Explanations by Watching Movies and Reading Books},
38
+ author = {Zhu, Yukun and Kiros, Ryan and Zemel, Rich and Salakhutdinov, Ruslan and Urtasun, Raquel and Torralba, Antonio and Fidler, Sanja},
39
+ booktitle = {The IEEE International Conference on Computer Vision (ICCV)},
40
+ month = {December},
41
+ year = {2015}
42
+ }
43
+ """
44
+
45
+ URL = "https://storage.googleapis.com/huggingface-nlp/datasets/bookcorpus/bookcorpus.tar.bz2"
46
+
47
+
48
+ class BookcorpusConfig(datasets.BuilderConfig):
49
+ """BuilderConfig for BookCorpus."""
50
+
51
+ def __init__(self, **kwargs):
52
+ """BuilderConfig for BookCorpus.
53
+ Args:
54
+ **kwargs: keyword arguments forwarded to super.
55
+ """
56
+ super(BookcorpusConfig, self).__init__(version=datasets.Version("1.0.0", ""), **kwargs)
57
+
58
+
59
+ class Bookcorpus(datasets.GeneratorBasedBuilder):
60
+ """BookCorpus dataset."""
61
+
62
+ BUILDER_CONFIGS = [
63
+ BookcorpusConfig(
64
+ name="plain_text",
65
+ description="Plain text",
66
+ )
67
+ ]
68
+
69
+ def _info(self):
70
+ return datasets.DatasetInfo(
71
+ description=_DESCRIPTION,
72
+ features=datasets.Features(
73
+ {
74
+ "text": datasets.Value("string"),
75
+ }
76
+ ),
77
+ supervised_keys=None,
78
+ homepage="https://yknzhu.wixsite.com/mbweb",
79
+ citation=_CITATION,
80
+ )
81
+
82
+ def _vocab_text_gen(self, archive):
83
+ for _, ex in self._generate_examples(archive):
84
+ yield ex["text"]
85
+
86
+ def _split_generators(self, dl_manager):
87
+ arch_path = dl_manager.download_and_extract(URL)
88
+
89
+ return [
90
+ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"directory": arch_path}),
91
+ ]
92
+
93
+ def _generate_examples(self, directory):
94
+ files = [
95
+ os.path.join(directory, "books_large_p1.txt"),
96
+ os.path.join(directory, "books_large_p2.txt"),
97
+ ]
98
+ _id = 0
99
+ for txt_file in files:
100
+ with open(txt_file, mode="r", encoding="utf-8") as f:
101
+ for line in f:
102
+ yield _id, {"text": line.strip()}
103
+ _id += 1
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
1
+ {"plain_text": {"description": "Books are a rich source of both fine-grained information, how a character, an object or a scene looks like, as well as high-level semantics, what someone is thinking, feeling and how these states evolve through a story.This work aims to align books to their movie releases in order to providerich descriptive explanations for visual content that go semantically farbeyond the captions available in current datasets. ", "citation": "@InProceedings{Zhu_2015_ICCV,\n title = {Aligning Books and Movies: Towards Story-Like Visual Explanations by Watching Movies and Reading Books},\n author = {Zhu, Yukun and Kiros, Ryan and Zemel, Rich and Salakhutdinov, Ruslan and Urtasun, Raquel and Torralba, Antonio and Fidler, Sanja},\n booktitle = {The IEEE International Conference on Computer Vision (ICCV)},\n month = {December},\n year = {2015}\n}\n", "homepage": "https://yknzhu.wixsite.com/mbweb", "license": "", "features": {"text": {"dtype": "string", "id": null, "_type": "Value"}}, "supervised_keys": null, "builder_name": "bookcorpus", "config_name": "plain_text", "version": {"version_str": "1.0.0", "description": "", "datasets_version_to_prepare": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 4853859824, "num_examples": 74004228, "dataset_name": "bookcorpus"}}, "download_checksums": {"https://storage.googleapis.com/huggingface-nlp/datasets/bookcorpus/bookcorpus.tar.bz2": {"num_bytes": 1179510242, "checksum": "03a29333b2b35e98a375b6ad7d2f1651835655cd348fb89c864136bce69a964c"}}, "download_size": 1179510242, "dataset_size": 4853859824, "size_in_bytes": 6033370066}}
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:c1f8ebf30aedb881f93c6379c8f315f8565792c63cd8a3297439e09c6db5febe
3
+ size 864