Update coraal-asr.py
Browse files- coraal-asr.py +6 -2
coraal-asr.py
CHANGED
@@ -129,8 +129,12 @@ class coraal_asr(datasets.GeneratorBasedBuilder):
|
|
129 |
texts_asr = [utt['asr'] for utt in utterances]
|
130 |
texts = [utt['text'] for utt in utterances]
|
131 |
# window considering front and rear contexts
|
132 |
-
|
133 |
-
|
|
|
|
|
|
|
|
|
134 |
|
135 |
for text_asr, text, utt in zip(windowed_texts_asr, windowed_texts, utterances):
|
136 |
src = ''
|
|
|
129 |
texts_asr = [utt['asr'] for utt in utterances]
|
130 |
texts = [utt['text'] for utt in utterances]
|
131 |
# window considering front and rear contexts
|
132 |
+
if split == "train":
|
133 |
+
windowed_texts_asr = windowed([''] * self.config.n_fronts + texts_asr + [''] * self.config.n_rears, self.config.n_bodies + self.config.n_fronts + self.config.n_rears)
|
134 |
+
windowed_texts = windowed(texts, self.config.n_bodies)
|
135 |
+
else:
|
136 |
+
windowed_texts_asr = windowed([''] * self.config.n_fronts + texts_asr + [''] * self.config.n_rears, self.config.n_bodies + self.config.n_fronts + self.config.n_rears, fillvalue='', step=n_bodies)
|
137 |
+
windowed_texts = windowed(texts, self.config.n_bodies, fillvalue='', step=n_bodies)
|
138 |
|
139 |
for text_asr, text, utt in zip(windowed_texts_asr, windowed_texts, utterances):
|
140 |
src = ''
|