Datasets:
Commit
·
b98d7ac
1
Parent(s):
bbf5dcc
tidy code
Browse files- illustrated_ads.py +4 -14
illustrated_ads.py
CHANGED
|
@@ -59,7 +59,7 @@ _DTYPES = {
|
|
| 59 |
|
| 60 |
|
| 61 |
class IllustratedAds(datasets.GeneratorBasedBuilder):
|
| 62 |
-
"""
|
| 63 |
|
| 64 |
VERSION = datasets.Version("1.1.0")
|
| 65 |
|
|
@@ -88,18 +88,10 @@ class IllustratedAds(datasets.GeneratorBasedBuilder):
|
|
| 88 |
)
|
| 89 |
|
| 90 |
return datasets.DatasetInfo(
|
| 91 |
-
# This is the description that will appear on the datasets page.
|
| 92 |
description=_DESCRIPTION,
|
| 93 |
-
|
| 94 |
-
features=features, # Here we define them above because they are different between the two configurations
|
| 95 |
-
# If there's a common (input, target) tuple from the features, uncomment supervised_keys line below and
|
| 96 |
-
# specify them. They'll be used if as_supervised=True in builder.as_dataset.
|
| 97 |
-
# supervised_keys=("sentence", "label"),
|
| 98 |
-
# Homepage of the dataset for documentation
|
| 99 |
homepage=_HOMEPAGE,
|
| 100 |
-
# License for the dataset if available
|
| 101 |
license=_LICENSE,
|
| 102 |
-
# Citation for the dataset
|
| 103 |
citation=_CITATION,
|
| 104 |
)
|
| 105 |
|
|
@@ -108,12 +100,10 @@ class IllustratedAds(datasets.GeneratorBasedBuilder):
|
|
| 108 |
annotations = dl_manager.download(
|
| 109 |
[
|
| 110 |
"https://zenodo.org/record/5838410/files/ads.csv?download=1",
|
| 111 |
-
"https://zenodo.org/record/5838410/files/sample.csv?download=1"
|
| 112 |
]
|
| 113 |
)
|
| 114 |
-
df_labels = pd.read_csv(
|
| 115 |
-
annotations[0], index_col=0
|
| 116 |
-
)
|
| 117 |
df_metadata = pd.read_csv(
|
| 118 |
annotations[1],
|
| 119 |
index_col=0,
|
|
|
|
| 59 |
|
| 60 |
|
| 61 |
class IllustratedAds(datasets.GeneratorBasedBuilder):
|
| 62 |
+
"""Illustated Historic Newspaper Ads datasets"""
|
| 63 |
|
| 64 |
VERSION = datasets.Version("1.1.0")
|
| 65 |
|
|
|
|
| 88 |
)
|
| 89 |
|
| 90 |
return datasets.DatasetInfo(
|
|
|
|
| 91 |
description=_DESCRIPTION,
|
| 92 |
+
features=features,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
homepage=_HOMEPAGE,
|
|
|
|
| 94 |
license=_LICENSE,
|
|
|
|
| 95 |
citation=_CITATION,
|
| 96 |
)
|
| 97 |
|
|
|
|
| 100 |
annotations = dl_manager.download(
|
| 101 |
[
|
| 102 |
"https://zenodo.org/record/5838410/files/ads.csv?download=1",
|
| 103 |
+
"https://zenodo.org/record/5838410/files/sample.csv?download=1",
|
| 104 |
]
|
| 105 |
)
|
| 106 |
+
df_labels = pd.read_csv(annotations[0], index_col=0)
|
|
|
|
|
|
|
| 107 |
df_metadata = pd.read_csv(
|
| 108 |
annotations[1],
|
| 109 |
index_col=0,
|