Update HuffPost.py
Browse files- HuffPost.py +3 -16
HuffPost.py
CHANGED
|
@@ -87,19 +87,13 @@ class HuffPost(datasets.GeneratorBasedBuilder):
|
|
| 87 |
"link": datasets.Value("string"),
|
| 88 |
"short_description": datasets.Value("string"),
|
| 89 |
"date": datasets.Value("string"),
|
| 90 |
-
# These are the features of your dataset like images, labels ...
|
| 91 |
}
|
| 92 |
)
|
| 93 |
|
| 94 |
return datasets.DatasetInfo(
|
| 95 |
-
|
| 96 |
description=_DESCRIPTION,
|
| 97 |
-
|
| 98 |
-
features=features, # Here we define them above because they are different between the two configurations
|
| 99 |
-
# If there's a common (input, target) tuple from the features, uncomment supervised_keys line below and
|
| 100 |
-
# specify them. They'll be used if as_supervised=True in builder.as_dataset.
|
| 101 |
-
# supervised_keys=("sentence", "label"),
|
| 102 |
-
# Homepage of the dataset for documentation
|
| 103 |
homepage=_HOMEPAGE,
|
| 104 |
# License for the dataset if available
|
| 105 |
license=_LICENSE,
|
|
@@ -125,11 +119,4 @@ class HuffPost(datasets.GeneratorBasedBuilder):
|
|
| 125 |
data = json.loads(row)
|
| 126 |
|
| 127 |
# Yields examples as (key, example) tuples
|
| 128 |
-
yield key,
|
| 129 |
-
"category": data["category"],
|
| 130 |
-
"headline": data["headline"],
|
| 131 |
-
"authors": data["authors"],
|
| 132 |
-
"link": data["link"],
|
| 133 |
-
"short_description": data["short_description"],
|
| 134 |
-
"date": data["date"],
|
| 135 |
-
}
|
|
|
|
| 87 |
"link": datasets.Value("string"),
|
| 88 |
"short_description": datasets.Value("string"),
|
| 89 |
"date": datasets.Value("string"),
|
|
|
|
| 90 |
}
|
| 91 |
)
|
| 92 |
|
| 93 |
return datasets.DatasetInfo(
|
| 94 |
+
|
| 95 |
description=_DESCRIPTION,
|
| 96 |
+
features=features,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
homepage=_HOMEPAGE,
|
| 98 |
# License for the dataset if available
|
| 99 |
license=_LICENSE,
|
|
|
|
| 119 |
data = json.loads(row)
|
| 120 |
|
| 121 |
# Yields examples as (key, example) tuples
|
| 122 |
+
yield key, data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|