Datasets:

Languages:
English
ArXiv:
License:
system HF staff commited on
Commit
817f78e
0 Parent(s):

Update files from the datasets library (from 1.2.0)

Browse files

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

Files changed (5) hide show
  1. .gitattributes +27 -0
  2. README.md +156 -0
  3. dataset_infos.json +1 -0
  4. dummy/1.1.0/dummy_data.zip +3 -0
  5. wiki_movies.py +134 -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,156 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - crowdsourced
4
+ language_creators:
5
+ - crowdsourced
6
+ languages:
7
+ - en
8
+ licenses:
9
+ - cc-by-3-0
10
+ multilinguality:
11
+ - monolingual
12
+ size_categories:
13
+ - 100K<n<1M
14
+ source_datasets:
15
+ - original
16
+ task_categories:
17
+ - question-answering
18
+ task_ids:
19
+ - closed-domain-qa
20
+ ---
21
+
22
+
23
+ # Dataset Card for WikiMovies
24
+
25
+ ## Table of Contents
26
+ - [Dataset Description](#dataset-description)
27
+ - [Dataset Summary](#dataset-summary)
28
+ - [Supported Tasks](#supported-tasks-and-leaderboards)
29
+ - [Languages](#languages)
30
+ - [Dataset Structure](#dataset-structure)
31
+ - [Data Instances](#data-instances)
32
+ - [Data Fields](#data-instances)
33
+ - [Data Splits](#data-instances)
34
+ - [Dataset Creation](#dataset-creation)
35
+ - [Curation Rationale](#curation-rationale)
36
+ - [Source Data](#source-data)
37
+ - [Annotations](#annotations)
38
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
39
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
40
+ - [Social Impact of Dataset](#social-impact-of-dataset)
41
+ - [Discussion of Biases](#discussion-of-biases)
42
+ - [Other Known Limitations](#other-known-limitations)
43
+ - [Additional Information](#additional-information)
44
+ - [Dataset Curators](#dataset-curators)
45
+ - [Licensing Information](#licensing-information)
46
+ - [Citation Information](#citation-information)
47
+
48
+ ## Dataset Description
49
+
50
+ - **Homepage: [WikiMovies Homepage](https://research.fb.com/downloads/babi/)**
51
+ - **Repository:**
52
+ - **Paper: [Key-Value Memory Networks for Directly Reading Documents](https://arxiv.org/pdf/1606.03126.pdf)**
53
+ - **Leaderboard:**
54
+ - **Point of Contact:**
55
+
56
+ ### Dataset Summary
57
+
58
+ The WikiMovies dataset consists of roughly 100k (templated) questions over 75k entitiesbased on questions with answers in the open movie database (OMDb). It is the QA part of the Movie Dialog dataset.
59
+
60
+ ### Supported Tasks and Leaderboards
61
+
62
+ - Question Answering
63
+
64
+ ### Languages
65
+
66
+ The text in the dataset is written in English.
67
+
68
+ ## Dataset Structure
69
+
70
+ ### Data Instances
71
+
72
+ The raw data consists of question answer pairs separated by a tab. Here are 3 examples:
73
+ ```buildoutcfg
74
+ 1 what does Grégoire Colin appear in? Before the Rain
75
+ 1 Joe Thomas appears in which movies? The Inbetweeners Movie, The Inbetweeners 2
76
+ 1 what films did Michelle Trachtenberg star in? Inspector Gadget, Black Christmas, Ice Princess, Harriet the Spy, The Scribbler
77
+ ```
78
+ It is unclear what the `1` is for at the beginning of each line, but it has been removed in the `Dataset` object.
79
+
80
+ ### Data Fields
81
+ Here is an example of the raw data ingested by `Datasets`:
82
+ ```buildoutcfg
83
+ {
84
+ 'answer': 'Before the Rain',
85
+ 'question': 'what does Grégoire Colin appear in?'
86
+ }
87
+ ```
88
+ `answer`: a string containing the answer to a corresponding question.
89
+ `question`: a string containing the relevant question.
90
+
91
+ ### Data Splits
92
+ The data is split into train, test, and dev sets. The split sizes are as follows:
93
+
94
+ | wiki-entities_qa_* | n examples|
95
+ | ----- | ---- |
96
+ | train.txt | 96185 |
97
+ | dev.txt | 10000 |
98
+ | test.txt | 9952 |
99
+
100
+ ## Dataset Creation
101
+
102
+ ### Curation Rationale
103
+
104
+ WikiMovies was built with the following goals in mind: (i) machine learning techniques should have ample training examples for learning; and (ii) one can analyze easily the performance of different representations of knowledge and break down the results by question type. The datasetcan be downloaded fromhttp://fb.ai/babi
105
+
106
+ ### Source Data
107
+
108
+ #### Initial Data Collection and Normalization
109
+
110
+ [More Information Needed]
111
+
112
+ #### Who are the source language producers?
113
+
114
+ [More Information Needed]
115
+
116
+ ### Annotations
117
+
118
+ #### Annotation process
119
+
120
+ [More Information Needed]
121
+
122
+ #### Who are the annotators?
123
+
124
+ [More Information Needed]
125
+
126
+ ### Personal and Sensitive Information
127
+
128
+ [More Information Needed]
129
+
130
+ ## Considerations for Using the Data
131
+
132
+ ### Social Impact of Dataset
133
+
134
+ [More Information Needed]
135
+
136
+ ### Discussion of Biases
137
+
138
+ [More Information Needed]
139
+
140
+ ### Other Known Limitations
141
+
142
+ [More Information Needed]
143
+
144
+ ## Additional Information
145
+
146
+ ### Dataset Curators
147
+
148
+ [More Information Needed]
149
+
150
+ ### Licensing Information
151
+
152
+ [More Information Needed]
153
+
154
+ ### Citation Information
155
+
156
+ [More Information Needed]
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"default": {"description": "The WikiMovies dataset consists of roughly 100k (templated) questions over 75k entities based on questions with answers in the open movie database (OMDb).\n", "citation": "@misc{miller2016keyvalue,\n title={Key-Value Memory Networks for Directly Reading Documents},\n author={Alexander Miller and Adam Fisch and Jesse Dodge and Amir-Hossein Karimi and Antoine Bordes and Jason Weston},\n year={2016},\n eprint={1606.03126},\n archivePrefix={arXiv},\n primaryClass={cs.CL}\n}", "homepage": "https://research.fb.com/downloads/babi/", "license": "Creative Commons Public License (CCPL)", "features": {"question": {"dtype": "string", "id": null, "_type": "Value"}, "answer": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "wiki_movies", "config_name": "default", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 7274490, "num_examples": 96185, "dataset_name": "wiki_movies"}, "test": {"name": "test", "num_bytes": 755258, "num_examples": 9952, "dataset_name": "wiki_movies"}, "validation": {"name": "validation", "num_bytes": 754755, "num_examples": 10000, "dataset_name": "wiki_movies"}}, "download_checksums": {"https://thespermwhale.com/jaseweston/babi/movieqa.tar.gz": {"num_bytes": 57070041, "checksum": "ed062b49922b602ebee6073f58951bf38c4772a8b53d46682f3ff80ed57de948"}}, "download_size": 57070041, "post_processing_size": null, "dataset_size": 8784503, "size_in_bytes": 65854544}}
dummy/1.1.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e15b615a17084236994a7466f9292fde2e4100636d35124f4ec59ec9c414ecaa
3
+ size 39466
wiki_movies.py ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ """WikiMovies: A Question-Answering dataset that contains raw text alongside a preprocessed knowledge base, in the domain of movies from the Open Movie Database. It is the QA part of the Movie Dialog dataset.
16
+ It was built with the following goals in mind: (i) machine learning techniques should have ample training examples for learning; and (ii) one can analyze easily the performance of different representations of knowledge and break down the results by question type. The dataset can be downloaded fromhttp://fb.ai/babi
17
+ """
18
+
19
+ from __future__ import absolute_import, division, print_function
20
+
21
+ import os
22
+
23
+ import datasets
24
+
25
+
26
+ _CITATION = """\
27
+ @misc{miller2016keyvalue,
28
+ title={Key-Value Memory Networks for Directly Reading Documents},
29
+ author={Alexander Miller and Adam Fisch and Jesse Dodge and Amir-Hossein Karimi and Antoine Bordes and Jason Weston},
30
+ year={2016},
31
+ eprint={1606.03126},
32
+ archivePrefix={arXiv},
33
+ primaryClass={cs.CL}
34
+ }"""
35
+
36
+ _DESCRIPTION = """\
37
+ The WikiMovies dataset consists of roughly 100k (templated) questions over 75k entities based on questions with answers in the open movie database (OMDb).
38
+ """
39
+
40
+ _HOMEPAGE = "https://research.fb.com/downloads/babi/"
41
+
42
+ _LICENSE = "Creative Commons Public License (CCPL)"
43
+
44
+ # TODO: Add link to the official dataset URLs here
45
+ # The HuggingFace dataset library don't host the datasets but only point to the original files
46
+ # This can be an arbitrary nested dict/list of URLs (see below in `_split_generators` method)
47
+ _URLs = {"default": "https://thespermwhale.com/jaseweston/babi/movieqa.tar.gz"}
48
+
49
+
50
+ class WikiMovies(datasets.GeneratorBasedBuilder):
51
+ """The WikiMovies dataset consists of roughly 100k (templated) questions over 75k entities based on questions with answers in the open movie database (OMDb)."""
52
+
53
+ VERSION = datasets.Version("1.1.0")
54
+
55
+ def _info(self):
56
+ features = datasets.Features(
57
+ {
58
+ "question": datasets.Value("string"),
59
+ "answer": datasets.Value("string"),
60
+ # These are the features of your dataset like images, labels ...
61
+ }
62
+ )
63
+ return datasets.DatasetInfo(
64
+ # This is the description that will appear on the datasets page.
65
+ description=_DESCRIPTION,
66
+ # This defines the different columns of the dataset and their types
67
+ features=features, # Here we define them above because they are different between the two configurations
68
+ # If there's a common (input, target) tuple from the features,
69
+ # specify them here. They'll be used if as_supervised=True in
70
+ # builder.as_dataset.
71
+ supervised_keys=None,
72
+ # Homepage of the dataset for documentation
73
+ homepage=_HOMEPAGE,
74
+ # License for the dataset if available
75
+ license=_LICENSE,
76
+ # Citation for the dataset
77
+ citation=_CITATION,
78
+ )
79
+
80
+ def _split_generators(self, dl_manager):
81
+ """Returns SplitGenerators."""
82
+ # TODO: This method is tasked with downloading/extracting the data and defining the splits depending on the configuration
83
+ # If several configurations are possible (listed in BUILDER_CONFIGS), the configuration selected by the user is in self.config.name
84
+
85
+ # dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLs
86
+ # It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.
87
+ # By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
88
+ my_urls = _URLs[self.config.name]
89
+ data_dir = dl_manager.download_and_extract(my_urls)
90
+ return [
91
+ datasets.SplitGenerator(
92
+ name=datasets.Split.TRAIN,
93
+ # These kwargs will be passed to _generate_examples
94
+ gen_kwargs={
95
+ "filepath": os.path.join(
96
+ data_dir, "movieqa", "questions", "wiki_entities", "wiki-entities_qa_train.txt"
97
+ ),
98
+ "split": "train",
99
+ },
100
+ ),
101
+ datasets.SplitGenerator(
102
+ name=datasets.Split.TEST,
103
+ # These kwargs will be passed to _generate_examples
104
+ gen_kwargs={
105
+ "filepath": os.path.join(
106
+ data_dir, "movieqa", "questions", "wiki_entities", "wiki-entities_qa_test.txt"
107
+ ),
108
+ "split": "test",
109
+ },
110
+ ),
111
+ datasets.SplitGenerator(
112
+ name=datasets.Split.VALIDATION,
113
+ # These kwargs will be passed to _generate_examples
114
+ gen_kwargs={
115
+ "filepath": os.path.join(
116
+ data_dir, "movieqa", "questions", "wiki_entities", "wiki-entities_qa_dev.txt"
117
+ ),
118
+ "split": "dev",
119
+ },
120
+ ),
121
+ ]
122
+
123
+ def _generate_examples(self, filepath, split):
124
+ # It is in charge of opening the given file and yielding (key, example) tuples from the dataset
125
+ # The key is not important, it's more here for legacy reason (legacy from tfds)
126
+
127
+ with open(filepath, encoding="utf-8") as f:
128
+ for id_, row in enumerate(f):
129
+ tmp_data = row.split("\t")
130
+ tmp_question = tmp_data[0][1:]
131
+ yield id_, {
132
+ "question": tmp_question,
133
+ "answer": tmp_data[1],
134
+ }