jamescalam
commited on
Commit
•
f0e4878
1
Parent(s):
eb7f508
Update reddit-topics-targz.py
Browse files- reddit-topics-targz.py +23 -11
reddit-topics-targz.py
CHANGED
@@ -1,7 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
# Lint as: python3
|
2 |
-
"""
|
|
|
3 |
|
4 |
import json
|
|
|
5 |
import datasets
|
6 |
from datasets.tasks import QuestionAnsweringExtractive
|
7 |
|
@@ -32,22 +49,17 @@ _URL = "https://github.com/jamescalam/hf-datasets/raw/main/01_builder_script/dat
|
|
32 |
|
33 |
class RedditTopicsTargz(datasets.GeneratorBasedBuilder):
|
34 |
"""SQUAD: The Stanford Question Answering Dataset. Version 1.1."""
|
35 |
-
|
36 |
def _info(self):
|
37 |
return datasets.DatasetInfo(
|
38 |
description=_DESCRIPTION,
|
39 |
features=datasets.Features(
|
40 |
{
|
41 |
-
"
|
42 |
"title": datasets.Value("string"),
|
43 |
-
"
|
44 |
-
"
|
45 |
-
"
|
46 |
-
|
47 |
-
"text": datasets.Value("string"),
|
48 |
-
"answer_start": datasets.Value("int32"),
|
49 |
-
}
|
50 |
-
),
|
51 |
}
|
52 |
),
|
53 |
# No default supervised_keys (as we have to pass both question
|
|
|
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 |
+
"""SQUAD: The Stanford Question Answering Dataset."""
|
18 |
+
|
19 |
|
20 |
import json
|
21 |
+
|
22 |
import datasets
|
23 |
from datasets.tasks import QuestionAnsweringExtractive
|
24 |
|
|
|
49 |
|
50 |
class RedditTopicsTargz(datasets.GeneratorBasedBuilder):
|
51 |
"""SQUAD: The Stanford Question Answering Dataset. Version 1.1."""
|
|
|
52 |
def _info(self):
|
53 |
return datasets.DatasetInfo(
|
54 |
description=_DESCRIPTION,
|
55 |
features=datasets.Features(
|
56 |
{
|
57 |
+
"sub": datasets.Value("string"),
|
58 |
"title": datasets.Value("string"),
|
59 |
+
"selftext": datasets.Value("string"),
|
60 |
+
"upvote_ratio": datasets.Value("string"),
|
61 |
+
"id": datasets.Value("string"),
|
62 |
+
"created_utc": datasets.Value("string"),
|
|
|
|
|
|
|
|
|
63 |
}
|
64 |
),
|
65 |
# No default supervised_keys (as we have to pass both question
|