Update coraal-asr.py
Browse files- coraal-asr.py +11 -2
coraal-asr.py
CHANGED
@@ -68,6 +68,7 @@ class coraal_asr(datasets.GeneratorBasedBuilder):
|
|
68 |
coraal_asr_config(name="ctc-large", version=VERSION),
|
69 |
coraal_asr_config(name="xlsr", version=VERSION),
|
70 |
coraal_asr_config(name="whisper-small", version=VERSION),
|
|
|
71 |
]
|
72 |
DEFAULT_CONFIG_NAME = "ctc-large" # It's not mandatory to have a default configuration. Just use one if it make sense.
|
73 |
BUILDER_CONFIG_CLASS = coraal_asr_config
|
@@ -103,6 +104,8 @@ class coraal_asr(datasets.GeneratorBasedBuilder):
|
|
103 |
urls = deepcopy(URLS["xlsr"])
|
104 |
if "whisper-small" in self.config.name:
|
105 |
urls = deepcopy(URLS["whisper-small"])
|
|
|
|
|
106 |
|
107 |
dl_path = dl_manager.download_and_extract(urls)
|
108 |
|
@@ -152,13 +155,19 @@ class coraal_asr(datasets.GeneratorBasedBuilder):
|
|
152 |
src = ''
|
153 |
if self.config.n_fronts > 0:
|
154 |
src += self.config.front_prefix
|
155 |
-
|
|
|
|
|
|
|
156 |
src += '\n'
|
157 |
src += self.config.body_prefix
|
158 |
src += '\n'.join(text_asr[self.config.n_fronts:self.config.n_fronts + self.config.n_bodies])
|
159 |
if self.config.n_rears > 0:
|
160 |
src += '\n' + self.config.rear_prefix
|
161 |
-
|
|
|
|
|
|
|
162 |
tgt = '\n'.join(text)
|
163 |
|
164 |
data = {
|
|
|
68 |
coraal_asr_config(name="ctc-large", version=VERSION),
|
69 |
coraal_asr_config(name="xlsr", version=VERSION),
|
70 |
coraal_asr_config(name="whisper-small", version=VERSION),
|
71 |
+
coraal_asr_config(name="oracle", version=VERSION),
|
72 |
]
|
73 |
DEFAULT_CONFIG_NAME = "ctc-large" # It's not mandatory to have a default configuration. Just use one if it make sense.
|
74 |
BUILDER_CONFIG_CLASS = coraal_asr_config
|
|
|
104 |
urls = deepcopy(URLS["xlsr"])
|
105 |
if "whisper-small" in self.config.name:
|
106 |
urls = deepcopy(URLS["whisper-small"])
|
107 |
+
if "oracle" in self.config.name:
|
108 |
+
urls = deepcopy(URLS["ctc-large"])
|
109 |
|
110 |
dl_path = dl_manager.download_and_extract(urls)
|
111 |
|
|
|
155 |
src = ''
|
156 |
if self.config.n_fronts > 0:
|
157 |
src += self.config.front_prefix
|
158 |
+
if "oracle" in self.config.name:
|
159 |
+
src += '\n'.join(text[:self.config.n_fronts])
|
160 |
+
else:
|
161 |
+
src += '\n'.join(text_asr[:self.config.n_fronts])
|
162 |
src += '\n'
|
163 |
src += self.config.body_prefix
|
164 |
src += '\n'.join(text_asr[self.config.n_fronts:self.config.n_fronts + self.config.n_bodies])
|
165 |
if self.config.n_rears > 0:
|
166 |
src += '\n' + self.config.rear_prefix
|
167 |
+
if "oracle" in self.config.name:
|
168 |
+
src += '\n'.join(text[self.config.n_fronts + self.config.n_bodies:])
|
169 |
+
else:
|
170 |
+
src += '\n'.join(text_asr[self.config.n_fronts + self.config.n_bodies:])
|
171 |
tgt = '\n'.join(text)
|
172 |
|
173 |
data = {
|