## 1 Introduction
### Related Work
#### 1.4.2 Query-by-Example Spoken Term Detection  
It is possible to use a text-based STD system to solve the problem of QbE STD by first transcribing the acoustic query, which can be done automatically using an ASR system and, thus, converting the QbE STD problem into a text-based STD problem. However, errors produced in the transcription of the query are difficult to recover and lead to a significant performance degradation. Some examples of this approach using different models and units are [26; 27; 28; 80; 81; 82; 83; 84; 85; 86; 87; 88]. More recently, this approach has been extended with automatic unit discovery [89; 90; 91] and deep neural networks (DNNs) for extracting bottleneck features [92; 93].  
Another approach, perhaps the most common one, transforms audio (both queries and utterances) into sequences of acoustic features and then makes use of template matching methods to find subsequences in the utterance representations that are similar to the sequence representing the query. This approach typically outperforms transcription-based techniques in QbE STD [94]. In addition, this approach can lead to language-independent STD systems, since prior knowledge of the language is not needed. The two main variations of this approach are the features used to represent the audio and the template matching method used.  
The most commonly used features are posteriorgrams, and, among them, the most common type is the phoneme posteriorgram [87; 95; 96; 97; 98; 99; 100; 101; 102; 103; 104]. Another frequent type is the Gaussian posteriorgram [29; 82; 95; 105; 106]. Finally, there are also works exploring other types of posteriorgrams [107; 108; 109; 110]. In recent years, the use of bottleneck features extracted from DNNs became popular [87; 92; 93; 111; 112; 113; 114; 115].  
There are also methods that explore other types of features beyond posteriorgrams and bottlenecks [116; 117; 118; 119]. Most of the previous works make use of dynamic time warping (DTW) for query search, in many cases in the form of subsequence DTW (S-DTW) and some variants [29; 95; 100; 101; 103; 105; 108; 110; 112; 115; 120]. A well-known problem of these methods is the computational cost. To reduce this cost, Ref. [104] proposes hashing the phone posteriors to speed up the search and thus enable searching on massively large datasets.  
Aiming to keep the advantages of both methods, hybrid methods that combine the two previous approaches were proposed. Most works use logistic regression-based fusion of DTW and phoneme or syllable-based speech recognition systems [121; 122; 123; 124; 125; 126; 127]. Other hybrid approaches combine DTW with other techniques, such as subspace modelling [110]. Some more recent approaches use DNNs for posteriorgram-based rescoring [128; 129].  
In the last few years, there were a few novel proposals in QbE STD, most of them based on deep learning. The most direct use of deep learning is perhaps the one proposed in [130; 131], where a convolutional neural network (CNN) is used to decide whether the DTW cost matrix (considered as a grey scale image) contains a match. A less direct approach consists of replicating the standard approach of natural language processing (NLP) of representing a word with a fixed-length vector (embedding). In [120; 132; 133; 134], this is extended by obtaining the word embedding directly from the audio. Once the embeddings are obtained, matching words is trivial and can be done using nearest neighbours [132].  
Finally, attention mechanisms in DNNs allow the system to focus on the parts of the audio that are more relevant.  
This was applied in the context of QbE STD to train a neural end-to-end system in which the attention weights indicate the time span of the detected queries [135]. More recently, attention mechanisms were extended to two-way attention mechanisms in the NLP context of question answering [136], and this approach was also applied to the problem of QbE STD [137].