Query-by-example. Given a query (a speech sequence), the task is to retrieve all sequences with the same transcription in an audio file.
Previous works have used lists of words extracted from an audio file using forced alignment[1]}. This task is a little too easy, since the words are disjoint intervals in the speech signal, while a retrieval task on an unsegmented audio file would have to deal with potentially overlapping speech sequences that differ from the query by only one phoneme. To push the task closer to an unsegmented use case, here, we compute MAPs over randomly selected phoneme-ngrams, i.e non-silent speech sequences that start and end at phoneme boundaries. To avoid long computation of MAP, we reduce the number of such sequences by picking only those that are shorter than 1 second. Most of them will be phoneme-ngrams with unique transcription in force-alignment. We also remove all phoneme-ngrams with unique transcriptions. Prior experiments showed that it does not change the MAP scores much but drastically reduces computation time.
Given a query, we can compute precision and recall of the retrieved sequences as a function of the distance threshold \(r\) . The MAP score is obtained by varying \(r\)  between 0 and infinity and integrating the precision/recall curve. It results in a score between 0 and 1 (higher is better). We compute it using the pytorch-metric-learning library [2]}.
