## 4 Data Extraction
### Training Data Extraction  
After the segment extraction procedure (Sections 4.1-4.5) is run on the Basque Parliament sessions from 2014 to 2021, a set of training segments \(S_{train}^{(1)}\) is obtained. New acoustic models can be trained on \(S_{train}^{(1)}\), models that are expected to perform better than the baseline models when applied to Basque Parliament sessions. Following this logic, successive iterations of the segment extraction procedure can be applied by using models increasingly adapted to the Basque Parliament sessions to obtain successive sets of training segments: \(S_{train}^{(2)}\), \(S_{train}^{(3)}\), etc. It is expected that the alignments will improve and a better training set will be obtained, with segments that better match their reference transcriptions. In practice, it is observed that with each iteration of the search procedure, the models increasingly conform to the provided transcripts. So much so, that after several iterations, the similarity score might reach 100% for all segments, making it impossible to distinguish between _truly good_ transcripts and _bad_ transcripts that the models have adjusted to. In other words, the models might be overfitting to training data so much that their performance would likely degrade when tested on an independent dataset. This unwanted effect forces us to check the performance of our models after each iteration by running ASR experiments on the test set. In this way, the procedure will stop when ASR performance (computed on the test set) does not improve or when the improvement is considered too small. A fully bilingual ASR system is built using the wav2 letter++ framework [40]. Besides the acoustic models, our wav2 letter++ system requires a vocabulary and a language model, both extracted from the normalized transcriptions. A single pronunciation baseform is considered for every word in the vocabulary, as generated by our in-house G2P converter. A trigram language model is estimated using KenLM [44]. Since the language model is derived from texts in Basque and Spanish, it inherently makes the ASR system generate a bilingual output which may likely include code-switching events. This is due to the consistent probability that a Basque word may follow a Spanish word, or vice versa. This capability, combined with the employment of a unified set of acoustic units, makes our ASR system thoroughly bilingual and robust to code-switchings. ASR experiments are carried out on the test set described in Section 4.6 under a cross-validation approach, by considering 20 random partitions and reporting the average ASR performance on them. The Word Error Rate (WER) metric is used to report performance. For each partition, the test set is randomly split into two halves, the first half (tuning set) being used to perform a random walk search of the optimal hyperparameters of the ASR \begin{table}
\begin{tabular}{l c c} \hline \hline
**Language** & **\#Segments** & **Duration** \\ \hline Spanish & 6057 & 11:18:19 \\ Basque & 2955 & 05:27:03 \\ Bilingual & 239 & 00:29:06 \\ \hline Total & 9251 & 17:14:28 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Number of segments and duration of the test set, disaggregated per language. system (see [39] for details) and the other half (evaluation set) being properly used to evaluate ASR performance. Three ASR systems are built by using three acoustic models: (1) baseline acoustic models obtained from generic out-of-domain datasets for Basque and Spanish; (2) acoustic models trained on the dataset \(S_{train}^{(1)}\) obtained after one iteration of the data extraction procedure using only those segments with alignment similarity \(\geq\)80% and (3) acoustic models trained on the dataset \(S_{train}^{(2)}\) obtained after a second iteration of the data extraction procedure using segments with the highest similarity amounting to the same duration as in (2).