upd: over-engineering
Browse files
rwth_phoenix_weather_2014.py
CHANGED
@@ -39,7 +39,7 @@ _LICENSE = "CC BY-NC 4.0"
|
|
39 |
class RWTHPhoenixWeather2014Config(datasets.BuilderConfig):
|
40 |
"""BuilderConfig for RWTHPhoenixWeather2014Config."""
|
41 |
|
42 |
-
def __init__(self, main_data_folder, **kwargs):
|
43 |
"""BuilderConfig for RWTHPhoenixWeather2014Config.
|
44 |
Args:
|
45 |
main_data_folder: name of the RWTHPhoenix variant folder.
|
@@ -47,6 +47,7 @@ class RWTHPhoenixWeather2014Config(datasets.BuilderConfig):
|
|
47 |
"""
|
48 |
super(RWTHPhoenixWeather2014Config, self).__init__(version=datasets.Version("1.0.0"), **kwargs)
|
49 |
self.main_data_folder = main_data_folder
|
|
|
50 |
|
51 |
|
52 |
class RWTHPhoenixWeather2014(datasets.GeneratorBasedBuilder):
|
@@ -59,12 +60,14 @@ class RWTHPhoenixWeather2014(datasets.GeneratorBasedBuilder):
|
|
59 |
RWTHPhoenixWeather2014Config(
|
60 |
name="multisigner",
|
61 |
description="",
|
62 |
-
main_data_folder="phoenix-2014-multisigner"
|
|
|
63 |
),
|
64 |
RWTHPhoenixWeather2014Config(
|
65 |
name="signerindependent",
|
66 |
description="",
|
67 |
-
main_data_folder="phoenix-2014-signerindependent-SI5"
|
|
|
68 |
),
|
69 |
]
|
70 |
|
@@ -73,7 +76,7 @@ class RWTHPhoenixWeather2014(datasets.GeneratorBasedBuilder):
|
|
73 |
description=_DESCRIPTION + self.config.description,
|
74 |
features=datasets.Features(
|
75 |
{
|
76 |
-
"tokens": datasets.Sequence(feature=
|
77 |
"frames": datasets.Sequence(feature=datasets.Image()),
|
78 |
}
|
79 |
),
|
@@ -102,7 +105,8 @@ class RWTHPhoenixWeather2014(datasets.GeneratorBasedBuilder):
|
|
102 |
]:
|
103 |
base_url = f"data/{self.config.main_data_folder}"
|
104 |
|
105 |
-
data_csv = dl_manager.download(
|
|
|
106 |
df = pd.read_csv(data_csv, sep='|')
|
107 |
|
108 |
split_tokens[split] = df.annotation.map(
|
|
|
39 |
class RWTHPhoenixWeather2014Config(datasets.BuilderConfig):
|
40 |
"""BuilderConfig for RWTHPhoenixWeather2014Config."""
|
41 |
|
42 |
+
def __init__(self, main_data_folder, corpus_file_suffix, **kwargs):
|
43 |
"""BuilderConfig for RWTHPhoenixWeather2014Config.
|
44 |
Args:
|
45 |
main_data_folder: name of the RWTHPhoenix variant folder.
|
|
|
47 |
"""
|
48 |
super(RWTHPhoenixWeather2014Config, self).__init__(version=datasets.Version("1.0.0"), **kwargs)
|
49 |
self.main_data_folder = main_data_folder
|
50 |
+
self.corpus_file_suffix = corpus_file_suffix
|
51 |
|
52 |
|
53 |
class RWTHPhoenixWeather2014(datasets.GeneratorBasedBuilder):
|
|
|
60 |
RWTHPhoenixWeather2014Config(
|
61 |
name="multisigner",
|
62 |
description="",
|
63 |
+
main_data_folder="phoenix-2014-multisigner",
|
64 |
+
corpus_file_suffix=".corpus.csv"
|
65 |
),
|
66 |
RWTHPhoenixWeather2014Config(
|
67 |
name="signerindependent",
|
68 |
description="",
|
69 |
+
main_data_folder="phoenix-2014-signerindependent-SI5",
|
70 |
+
corpus_file_suffix=".SI5.corpus.csv"
|
71 |
),
|
72 |
]
|
73 |
|
|
|
76 |
description=_DESCRIPTION + self.config.description,
|
77 |
features=datasets.Features(
|
78 |
{
|
79 |
+
"tokens": datasets.Sequence(feature=datasets.Value(dtype='string')),
|
80 |
"frames": datasets.Sequence(feature=datasets.Image()),
|
81 |
}
|
82 |
),
|
|
|
105 |
]:
|
106 |
base_url = f"data/{self.config.main_data_folder}"
|
107 |
|
108 |
+
data_csv = dl_manager.download(
|
109 |
+
f"{base_url}/annotations/manual/{dataDirMapper[split]}{self.config.corpus_file_suffix}")
|
110 |
df = pd.read_csv(data_csv, sep='|')
|
111 |
|
112 |
split_tokens[split] = df.annotation.map(
|