Emission of word timing by end-to-end model
The two-pass neural network model integrates RNN-T and LAS to enhance ASR systems, achieving reduced latency and improved accuracy by constraining attention probabilities, allowing real-time voice transcription on mobile devices.
Patent Information
- Application Number
- JP2024156695
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2020-05-07
- Filing Date
- 2024-09-10
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2041-03-17
AI Technical Summary
Modern automatic speech recognition (ASR) systems face challenges in achieving low latency and high accuracy, particularly in mobile devices, as existing models like RNN-T struggle with word timing and require remote connectivity, while non-streaming E2E models like LAS lack real-time capabilities.
A two-pass neural network model is employed, combining RNN-T for low latency streaming and LAS for improved accuracy, with constrained attention training to generate word timings by aligning attention probabilities with ground truth alignments.
The two-pass model achieves a 17-22% reduction in Word Error Rate (WER) and provides accurate word timing, enabling real-time voice transcription on-device without increasing latency.
Smart Images

Figure 2025000668000001_ABST
Abstract
Description
[Technical field]
[0001] This disclosure relates to two-pass end-to-end speech recognition. [Background technology]
[0002] Modern automatic speech recognition (ASR) systems focus on providing not only high quality (e.g., low word error rate (WER)) but also low latency (e.g., short delay between a user's utterance and the appearance of a transcription). Moreover, when using an ASR system today, it is required that the ASR system decodes the utterance in a streaming manner corresponding to real time, or even faster than real time. To illustrate, when an ASR system is deployed on a mobile phone that receives direct user interactivity, an application on the mobile phone that uses the ASR system may require the speech recognition to be streaming, such that words appear on the screen as soon as they are spoken. Here, mobile phone users may also have low tolerance for latency. Because of this low tolerance, speech recognition strives to run on mobile devices in a manner that minimizes the impact of latency and inaccuracies that can adversely affect the user's experience. Summary of the Invention [Means for solving the problem]
[0003] One aspect of the disclosure provides a computer-implemented method that, when executed on data processing hardware, causes the data processing hardware to perform operations, the operations including receiving training examples for a second pass decoder of a two-pass neural network model. The training examples include audio data representing an oral utterance of one or more words and a corresponding ground truth transcription of the oral utterance. For each word in the oral utterance, the operations also include inserting a placeholder symbol before the respective word, identifying respective ground truth alignments for the start of the respective word and the end of the respective word, determining a start word piece of the respective word and an end word piece of the respective word, and generating a first constrained alignment for the start word piece of the respective word and a second constrained alignment for the end word piece of the respective word. The first constrained alignment is aligned with a ground truth alignment for the start of each word, and the second constrained alignment is aligned with a ground truth alignment for the end of each word. The operations also include constraining an attention head of a second pass decoder of the two-pass neural network model by applying training examples that include all of the first constrained alignment and the second constrained alignment for each word of the training examples.
[0004] Implementations of the present disclosure may include one or more of any of the following features. In some implementations, the operations further include, during training the second pass decoder on the training examples, identifying expected attention probabilities for the portions of the training examples, determining that the constrained attention head generates an attention probability for at least one of the portions of the training examples that fails to match the expected attention probability, and applying a training penalty to the constrained attention head. In these implementations, the attention probability for at least one of the portions of the training examples may occur at a time corresponding to either the first constrained alignment or the second constrained alignment. Meanwhile, the attention probability for at least one of the portions of the training examples may occur at a time that does not correspond to either the first constrained alignment or the second constrained alignment, in some cases.
[0005] The start word piece and the end word piece may include the same word piece for each word, but the second pass decoder may include multiple attention heads. In some examples, constraining the attention heads includes constraining attention probabilities derived from the attention heads of the second pass decoder. Each respective constrained alignment may include a timing buffer for the respective ground truth alignment, where the timing buffer constrains each of the first constrained alignment and the second constrained alignment to a time interval that includes a first time period before the respective ground truth alignment and a second time period after the respective ground truth alignment.
[0006] In some examples, the operations further include determining that the constrained attention head generates a non-zero attention probability outside the boundaries corresponding to the first constrained alignment and the second constrained alignment while training the second pass decoder on the training examples, and applying a training penalty to the constrained attention head. Additionally or alternatively, the operations may further include minimizing an attention loss for the constrained attention head and minimizing a cross entropy loss for the second pass decoder while training the second pass decoder on the training examples. During execution of the two-pass neural network while using the second pass decoder trained on the training examples, in some additional examples, the operations further include receiving audio data of the utterance, determining a time corresponding to a maximum probability in the constrained attention head of the second pass decoder, and generating a word start time or a word end time for the determined time corresponding to the maximum probability in the constrained attention head of the second pass decoder.
[0007] Another aspect of the present disclosure provides a system including data processing hardware and memory hardware in communication with the data processing hardware. The memory hardware stores instructions that, when executed by the data processing hardware, cause the data processing hardware to perform operations, the operations including receiving training examples for a second pass decoder of a two-pass neural network model. The training examples include audio data representing an oral utterance of one or more words and a corresponding ground truth transcription of the oral utterance. For each word in the oral utterance, the operations also include inserting a placeholder symbol before the respective word, identifying respective ground truth alignments for a start of the respective word and an end of the respective word, determining a start word piece of the respective word and an end word piece of the respective word, and generating a first constrained alignment for the start word piece of the respective word and a second constrained alignment for the end word piece of the respective word. The first constrained alignment is aligned with a ground truth alignment for the start of each word, and the second constrained alignment is aligned with a ground truth alignment for the end of each word. The operations also include constraining an attention head of a second pass decoder of the two-pass neural network model by applying training examples that include all of the first constrained alignment and the second constrained alignment for each word of the training examples.
[0008] This aspect may include one or more of any of the following features. In some implementations, the operations further include, during training the second pass decoder on the training examples, identifying expected attention probabilities for the portions of the training examples, determining that the constrained attention head generates an attention probability for at least one of the portions of the training examples that fails to match the expected attention probability, and applying a training penalty to the constrained attention head. In these implementations, the attention probability for at least one of the portions of the training examples may occur at a time corresponding to either the first constrained alignment or the second constrained alignment. Meanwhile, the attention probability for at least one of the portions of the training examples may occur at a time that does not correspond to either the first constrained alignment or the second constrained alignment, as the case may be.
[0009] The start word piece and the end word piece may include the same word piece for each word, but the second pass decoder may include multiple attention heads. In some examples, constraining the attention heads includes constraining attention probabilities derived from the attention heads of the second pass decoder. Each respective constrained alignment may include a timing buffer for the respective ground truth alignment, where the timing buffer constrains each of the first constrained alignment and the second constrained alignment to a time interval that includes a first time period before the respective ground truth alignment and a second time period after the respective ground truth alignment.
[0010] In some examples, the operations further include determining that the constrained attention head generates a non-zero attention probability outside the boundaries corresponding to the first constrained alignment and the second constrained alignment while training the second pass decoder on the training examples, and applying a training penalty to the constrained attention head. Additionally or alternatively, the operations may further include minimizing an attention loss for the constrained attention head and minimizing a cross entropy loss for the second pass decoder while training the second pass decoder on the training examples. During execution of the two-pass neural network while using the second pass decoder trained on the training examples, in some additional examples, the operations further include receiving audio data of the utterance, determining a time corresponding to a maximum probability in the constrained attention head of the second pass decoder, and generating a word start time or a word end time for the determined time corresponding to the maximum probability in the constrained attention head of the second pass decoder.
[0011] The details of one or more implementations of the disclosure are set forth in the accompanying drawings and the description below. Other aspects, features, and advantages will become apparent from the description and drawings, and from the claims. [Brief description of the drawings]
[0012] [Figure 1A] 1 is a schematic diagram of an exemplary speech environment using a two-pass architecture with joint acoustic and text models. [Figure 1B] 1 is a schematic diagram of an exemplary speech environment using a two-pass architecture with joint acoustic and text models. [Figure 1C] 1 is a schematic diagram of an exemplary speech environment using a two-pass architecture with joint acoustic and text models. [Diagram 2] FIG. 1 is a schematic diagram of an exemplary two-pass architecture for speech recognition. [Figure 3A] FIG. 3 is a schematic diagram of an exemplary training process for the two-pass architecture of FIG. 2 for speech recognition. [Figure 3B] FIG. 3B is a schematic diagram of exemplary constraints in a training example for the training process of FIG. 3A. [Figure 4] 3 is a flowchart of an exemplary arrangement of operations for a method of implementing the two-pass architecture of FIG. 2 that incorporates constrained attention. [Diagram 5] FIG. 1 is a schematic diagram of an example computing device that can be used to implement the systems and methods described herein. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0013] Like reference numbers in the various drawings indicate like elements.
[0014] Speech recognition continues to evolve to meet the demands of unconstrainedness and agility in the mobile environment. New speech recognition architectures, or improvements to existing architectures, continue to be developed that seek to improve the quality of automatic speech recognition systems (ASR). To illustrate, speech recognition initially employed multiple models, with each model having a specialized purpose. For example, ASR systems included an acoustic model (AM), a pronunciation model (PM), and a language model (LM). The acoustic model mapped segments of audio (i.e., frames of audio) to phonemes. The pronunciation model connected these phonemes together to form words, and the language model was used to represent the likelihood of a given phrase (i.e., the probability of a sequence of words). However, while these individual models operated together, each model was trained independently and was often manually designed on different datasets.
[0015] While the separate model approach enabled speech recognition systems to be fairly accurate, especially when the training corpus (i.e., body of training data) for a given model met the model's validity requirements, the need to train separate models independently brought its own complexities and led to architectures with integrated models. These integrated models attempted to use a single neural network to directly map an audio waveform (i.e., input sequence) to an output sentence (i.e., output sequence). This gave rise to sequence-to-sequence approaches, which generated a sequence of words (or graphemes) given a sequence of audio features. Examples of sequence-to-sequence models include "attention-based" models and "listen-attend-spell" (LAS) models. LAS models transcribe speech utterances into letters using a listener component, an attendant component, and a speller component. Here, the listener is a recurrent neural network (RNN) encoder that receives an audio input (e.g., a time-frequency representation of the speech input) and maps the audio input to a higher level feature representation. The Attender attends to higher-level features to learn alignments between input features and predicted subword units (e.g., graphemes or word pieces), or other units of speech (e.g., phonemes, sounds, or senomes). The Speller is an attention-based RNN decoder that generates character sequences from the input by creating probability distributions over a set of hypothesized words. With a unified structure, all components of the model can be trained jointly as a single end-to-end (E2E) neural network. Here, an E2E model refers to a model whose architecture is built entirely of neural networks. The complete neural network works without external and / or manually designed components (e.g., finite-state transducers, dictionaries, or text normalization modules).Additionally, when training E2E models, these models generally do not require bootstrapping from decision trees or time alignment from a separate system.
[0016] While early E2E models proved accurate and training improvements over individually trained models, these E2E models, such as the LAS model, worked by considering the entire input sequence before generating the output text and therefore did not allow streaming of the output as the input was received. Without streaming capabilities, the LAS model cannot perform real-time voice transcription. This deficiency can create problems with deploying the LAS model for speech applications that are latency sensitive and / or require real-time voice transcription. This makes the LAS model alone a less than ideal model for mobile technologies (e.g., mobile phones) that often rely on real-time applications (e.g., real-time communication applications).
[0017] Additionally, a speech recognition system having an acoustic model, a pronunciation model, and a language model, or such models configured together, may rely on a decoder that must search a relatively large search graph associated with these models. In the case of a large search graph, it is not beneficial to host this type of speech recognition system entirely on-device. Here, when a speech recognition system is hosted "on-device", the device that receives the audio input uses its processor to perform the functions of the speech recognition system. For example, when a speech recognition system is hosted entirely on-device, the device's processor does not need to cooperate with any off-device computing resources to perform the functions of the speech recognition system. A device that performs speech recognition that is not entirely on-device relies on remote computing (e.g., of a remote computing system or cloud computing) and thus online connectivity to perform at least some functions of the speech recognition system. For example, the speech recognition system uses a network connection with a server-based model to perform decoding with a large search graph.
[0018] Unfortunately, relying on remote connections makes speech recognition systems susceptible to latency issues and / or inherent unreliability of communication networks. To improve the usefulness of speech recognition by avoiding these issues, speech recognition systems have again evolved into a form of sequence-to-sequence model known as recurrent neural network transducer (RNN-T). Unlike other sequence-to-sequence models that do not employ attention mechanisms and generally need to process entire sequences (e.g., audio waveforms) to produce an output (e.g., a sentence), RNN-T processes input samples continuously and streams output symbols, a feature that is particularly attractive for real-time communications. For example, speech recognition using RNN-T may output characters one by one as they are spoken. Here, RNN-T uses a feedback loop that feeds back the symbol predicted by the model to itself to predict the next symbol. Because decoding an RNN-T involves a beam search through a single neural network rather than a large decoder graph, RNN-T can scale to a fraction of the size of server-based speech recognition models. Due to its reduced size, RNN-T can be deployed entirely on-device and run offline (i.e., without a network connection), thus avoiding unreliability issues with communication networks.
[0019] In addition to a speech recognition system operating with low latency, the speech recognition system also needs to be accurate in recognizing speech. For models that perform speech recognition, a metric that may define the accuracy of the model is often the word error rate (WER). WER refers to a measure of how many words are changed compared to the number of words actually spoken. Generally, these word changes refer to substitutions (i.e., when words are replaced), insertions (i.e., when words are added), and / or deletions (i.e., when words are omitted). To illustrate, a speaker says "car" but the ASR system transcribes the word "car" as "bar." This is an example of substitution for phonetic similarity. When measuring the capabilities of an ASR system compared to other ASR systems, the WER may indicate some measure of improvement or quality capability over another system or some baseline.
[0020] Although the RNN-T model shows promise as a strong candidate model for on-device speech recognition, the RNN-T model alone still lags behind large-scale state-of-the-art conventional models (e.g., server-based models with separate AM, PM, and LM) in terms of quality (e.g., speech recognition accuracy). However, the non-streaming E2E, LAS model has speech recognition quality comparable to large-scale state-of-the-art conventional models. To take advantage of the quality of the non-streaming E2E LAS model, a two-pass speech recognition system (e.g., as shown in FIG. 2A) was developed that includes a first pass component of an RNN-T network followed by a second pass component of an LAS network. In this design, the two-pass model benefits from the streaming nature of the RNN-T model, which is low latency, while increasing the accuracy of the RNN-T model through the second pass incorporating the LAS network. Although the LAS network increases latency compared to the RNN-T model alone, the increase in latency is moderately small and meets the latency constraints for on-device operation. In terms of accuracy, the two-pass model achieves a 17-22% WER reduction compared to RNN-T alone and has a similar WER compared to large-scale conventional models.
[0021] Unfortunately, this two-pass model, with a first pass of an RNN-T network and a second pass of an LAS network, has several deficiencies. For example, this type of two-pass model is generally not able to convey timings for words (e.g., start or end times for each word) because the two-pass model is not trained with alignment information like the conventional models. Without alignment information, the two-pass model often delays its output predictions, which can make it difficult to determine word timings. In contrast, conventional models are trained with alignment information, such as phoneme alignment or word alignment, which allows the conventional models to generate accurate word timings. This creates a trade-off for users of the speech recognition system. On the one hand, the two-pass model has the benefit of being done on-device, which provides privacy and minimal latency, but does not have the ability to emit word timings. On the other hand, large conventional models can generate accurate word timings, but are too large to be implemented on-device, forcing users to use remote-based, non-streaming speech recognition systems that may have increased latency (e.g., compared to the two-pass model).
[0022] In order for the two-pass model to emit word timings without compromising latency or loss of quality, the two-pass model may be adapted to utilize its own architecture with additional constraints. In other words, the two-pass model cannot incorporate elements of large conventional models based on the size constraints for the two-pass model to fit on-device, and the two-pass model also cannot increase its overall latency by using post-processing modules after generating the final hypothesis. Fortunately, during training of the second-pass LAS network, the attention probability for the LAS network learns the alignment between the audio corresponding to the training examples and the predicted sub-word units (e.g., graphemes, word pieces, etc.) for the training examples. By constraining the attention probability of the LAS network based on the word-level alignment, the two-pass model may generate start and end times for each word. With these word timings, users may use the two-pass model on-device with various applications, such as voice assistants, dictation applications, or video transcription.
[0023] 1A-1C are an example of a voice environment 100. In the voice environment 100, a way for a user 10 to interact with a computing device, such as a user device 110, may be through voice input. The user device 110 (also commonly referred to as device 110) is configured to capture sounds (e.g., streaming audio data) from one or more users 10 in the voice-enabled environment 100. Here, the streaming audio data 202 may refer to verbal utterances 12 by the user 10 that serve as audible queries (e.g., FIG. 1C), commands to the device 110, or audible communications captured by the device 110 (e.g., FIG. 1B). The voice-enabled system of the device 110 may respond to the queries or commands by replying to the queries and / or causing the commands to be executed.
[0024] Here, the user device 110 captures audio data 202 of an oral utterance 12 by the user 10. The user device 110 may correspond to any computing device associated with the user 10 and capable of receiving the audio data 202. Some examples of the user device 110 include, but are not limited to, mobile devices (e.g., mobile phones, tablets, laptops, etc.), computers, wearable devices (e.g., smart watches), smart appliances, Internet of Things (IoT) devices, smart speakers, etc. The user device 110 includes data processing hardware 112 and memory hardware 114 in communication with the data processing hardware 112 and that stores instructions that, when executed by the data processing hardware 112, cause the data processing hardware 112 to perform one or more operations. The user device 110 further includes an audio subsystem 116 having audio capture devices (e.g., microphones) 116, 116a for capturing and converting oral utterances 12 in the voice-enabled system 100 into electrical signals, and audio output devices (e.g., speakers) 116, 116b for communicating audible audio signals (e.g., as output audio data from the device 110). Although the user device 110 implements a single audio capture device 116a in the illustrated example, the user device 110 may implement an array of audio capture devices 116a without departing from the scope of this disclosure, such that one or more capture devices 116a in the array may not be physically present on the user device 110, but may be in communication with the audio subsystem 116.
[0025] The user device 110 (e.g., using hardware 112, 114) is further configured to perform speech recognition processing on the streaming audio data 202 using a speech recognizer 200. In some examples, an audio subsystem 116 of the user device 110, including an audio capture device 116a, is configured to receive the audio data 202 (e.g., the oral utterance 12) and convert the audio data 202 into a digital format compatible with the speech recognizer 200. The digital format may correspond to acoustic frames (e.g., parameterized acoustic frames), such as mel frames. For example, the parameterized acoustic frames correspond to log-mel filter bank energies.
[0026] In some implementations, such as FIG. 1A, a user 10 interacts with a program or application 118 of a user device 110 that uses a speech recognizer 200. For example, FIG. 1A shows a user 10 communicating with a transcription application 118 that can transcribe an utterance 12 spoken by the user 10. In this example, the oral utterance 12 of the user 10 is "What time is the concert tonight?" This question from the user 10 is an oral utterance 12 that is captured by an audio capture device 116a and processed by an audio subsystem 116 of the user device 110. In this example, the speech recognizer 200 of the user device 110 receives an audio input 202 of "what time is the concert tonight" (e.g., as acoustic frames) and transcribes the audio input 202 into a transcription 204 (e.g., a textual representation of "what time is the concert tonight?"). Here, the transcription application 118 labels each word of the transcription 204 with a corresponding start time and end time based on the word timing 206 generated by the speech recognizer 200. For example, using these start and end times, the user 10 can edit the transcription 204 or the audio corresponding to the transcription 204. In some examples, the transcription application 118 corresponds to a video transcription application that is configured to edit and / or process audio / video data on the user device 110 based on, for example, the start and end times that the speech recognizer 200 associates with the words of the transcription 204.
[0027] FIG. 1B is another example of speech recognition using a speech recognizer 200. In this example, a user 10 associated with a user device 110 is communicating with a friend named Jane Doe using a communication application 118. Here, the user 10 named Ted communicates with Jane by having the speech recognizer 200 transcribe his voice inputs. The audio capture device 116 captures these voice inputs and communicates them in digital form (e.g., acoustic frames) to the speech recognizer 200. The speech recognizer 200 transcribes these acoustic frames into text that is sent to Jane via the communication application 118. Because this type of application 118 communicates via text, the transcription 204 from the speech recognizer 200 may be sent to Jane without further processing (e.g., natural language processing). Here, the communication application 118 may use the speech recognizer 200 to associate time with one or more parts of the conversation. Depending on the communication application 118, these times may be quite detailed, corresponding to word timing 206 for each word of the conversation processed by the speech recognizer 200 (e.g., start and end times for each word), or may more generally correspond to times associated with portions of the conversation by each speaker (e.g., as shown in FIG. 1B).
[0028] FIG. 1C illustrates a conversation similar to FIG. 1B, but with a voice assistant application 118. In this example, a user 10 asks an automated assistant, "What time is the concert tonight?" This question from the user 10 is an oral utterance 12 that is captured by an audio capture device 116a and processed by an audio subsystem 116 of the user device 110. In this example, a speech recognizer 200 of the user device 110 receives an audio input 202 of "what time is the concert tonight" (e.g., as acoustic frames) and transcribes the audio input 202 into a transcription 204 (e.g., a textual representation of "what time is the concert tonight?"). The automated assistant of the application 118 can now use natural language processing to respond to the question posed by the user 10. Natural language processing generally refers to the process of interpreting written language (e.g., transcription 204) and determining whether the written language prompts any action. In this example, the automated assistant uses natural language processing to recognize that a question from the user 10 pertains to the user's schedule, and more specifically, a concert on the user's schedule. By using natural language processing to recognize these details, the automated assistant returns a response to the user's query, where the response states "Tonight's concert opens at 8:30 PM." In some configurations, the natural language processing occurs on a remote system in communication with the data processing hardware 112 of the user device 110. Similar to FIG. 1B, the speech recognizer 200 can emit times (e.g., word timing 206) that the voice assistant application 118 can use to provide additional details about the conversation between the user 10 and the automated assistant. For example, FIG. 1C shows the voice assistant application 118 labeling the user's question with the time the user's question occurred.
[0029] In some examples, such as FIG. 2, the speech recognizer 200 is configured in a two-pass architecture. Generally, the two-pass architecture of the speech recognizer 200 includes at least one encoder 210, an RNN-T decoder 220, and a LAS decoder 230. In two-pass decoding, the second pass 208, 208b (e.g., shown as the LAS decoder 230) may improve the initial output from the first pass 208, 208a (e.g., shown as the RNN-T decoder 220) using techniques such as lattice rescoring or n-best re-ranking. In other words, the RNN-T decoder 220 creates streaming predictions, and the LAS decoder 230 confirms the predictions. Here, specifically, the LAS decoder 230 converts the streamed hypothesis y from the RNN-T decoder 220 into a streamed hypothesis y. R The LAS decoder 230 rescores the streamed hypotheses y R Although generally described as functioning in a rescoring mode in which the LAS decoder 230 rescores the utterance, the LAS decoder 230 may also operate in a different mode, such as a beam search mode, depending on design or other factors (e.g., the length of the utterance).
[0030] At least one encoder 210 is configured to receive, as an audio input 202, acoustic frames corresponding to the streaming oral speech utterance 12. The acoustic frames may be pre-processed by the audio subsystem 116 into parameterized acoustic frames (e.g., mel-frames and / or spectral frames). In some implementations, the parameterized acoustic frames correspond to log-mel filter bank energies with log-mel features. For example, a parameterized input acoustic frame output by the audio subsystem 116 and input to the encoder 210 may be a set of 12 frames, x=(x1,...,x T ), where:
[0031]
number
[0032] is the log-mel filter bank energy, T denotes the number of frames in x, and d represents the number of log-mel features. In some examples, each parameterized acoustic frame includes 128-dimensional log-mel features calculated within a short shift window (e.g., 32 ms, and shifted every 10 ms). Each feature may be stacked with a previous frame (e.g., three previous frames) to form a higher dimensional vector (e.g., a 512-dimensional vector using three previous frames). The features forming the vector may then be downsampled (e.g., to a 30 ms frame rate). Based on the audio input 202, the encoder 210 is configured to generate an encoding e. For example, the encoder 210 generates an encoded acoustic frame (e.g., an encoded mel frame or an acoustic embedding).
[0033] Although the structure of the encoder 210 may be implemented in different ways, in some implementations, the encoder 210 is a long short-term memory (LSTM) neural network. For example, the encoder 210 includes eight LSTM layers, where each layer may have 2,048 hidden units followed by a 640-dimensional projection layer. In some examples, a time shortening layer is inserted after the second LSTM layer of the encoder 210 with a shortening factor N=2 (e.g., to ensure that the encoded features occur at a particular frame rate).
[0034] In some configurations, the encoder 210 is a shared encoder network. In other words, rather than each path network 208 having its own separate encoder, each path 208 shares a single encoder 210. By sharing an encoder, the ASR speech recognizer 200 using a two-pass architecture may reduce its model size and / or its computational cost. Here, the reduced model size may help enable the speech recognizer 200 to function fully on-device.
[0035] 2 also includes an additional encoder, such as acoustic encoder 250, to adapt the output 212 of encoder 210 to be suitable for the second pass 208b of LAS decoder 230. Acoustic encoder 250 is configured to further encode the output 212 to be an encoded output 252. In some implementations, acoustic encoder 250 is an LSTM encoder (e.g., a two-layer LSTM encoder) that further encodes the output 212 from encoder 210. By including an additional encoder, encoder 210 may still be maintained as a shared encoder between passes 208.
[0036] During the first pass 208a, the encoder 210 receives each acoustic frame of the audio input 202 and generates an output 212 (e.g., denoted as an encoding of the acoustic frame e). The RNN-T decoder 220 receives the output 212 for each frame and generates the hypothesis y RThe RNN-T decoder 220 generates an output 222 shown as . In some implementations, the RNN-T decoder 220 includes a prediction network and a joint network, where the prediction network may have two LSTM layers of 2,048 hidden units and 640-dimensional projections per layer, and an embedding layer of 128 units. The output 212 of the encoder 210 and the prediction network may be fed into a joint network that includes a softmax prediction layer. In some examples, the joint network of the RNN-T decoder 220 includes 640 hidden units and a subsequent softmax layer that predicts 4,096 mixed-case word pieces.
[0037] In the two-pass model of FIG. 2, during the second pass 208b, the LAS decoder 230 receives the output 212 from the encoder 210 for each frame and generates the hypothesis y L2. When the LAS decoder 230 operates in beam search mode, the LAS decoder 230 creates the output 232 only from the output 212 and ignores the output 222 of the RNN-T decoder 220. When the LAS decoder 230 operates in rescoring mode, the LAS decoder 230 gets the top-K hypotheses from the RNN-T decoder 220, and then the LAS decoder 230 runs on each sequence in a supervised forced mode, attending to the output 212, to calculate a score. For example, the score combines the log-probability of the sequence and an attention coverage penalty. The LAS decoder 230 selects the sequence with the highest score to be the output 232. Here, in the rescoring mode, the LAS decoder 230 may include multi-head attention (e.g., with four heads) to attend to the output 212. Furthermore, the LAS decoder 230 may be a two-layer LAS decoder 230 with a softmax layer for prediction. For example, each layer of the LAS decoder 230 has 2,048 hidden units followed by a 640-dimensional projection. The softmax layer may contain 4,096 dimensions to predict the same mixed-case word pieces from the softmax layer of the RNN-T decoder 220.
[0038] In general, the two-pass model of FIG. 2 without any additional constraints has difficulty detecting word timing 206. This difficulty exists, at least in part, because the two-pass model tokenizes or splits a word into one or more word pieces. Here, for example, when a single word piece corresponds to an entire word, the start time and end time for the entire word coincide with the start time and end time for the single word piece. However, when a word is composed of multiple word pieces, the start time for a word may correspond to one word piece, but the end time for the word corresponds to a different word piece. Unfortunately, therefore, a conventional two-pass model may strive to identify when a word starts and when a word ends based on the word pieces. To overcome these problems, a two-pass model may be trained with certain constraints on the alignment of word pieces to the start and end times for a given word of the training examples.
[0039] A conventional training process for the two-pass model of FIG. 2 may be carried out in two stages. During the first stage, the encoder 210 and the RNN-T decoder 220
[0040]
number
[0041] In the second stage, the encoder 210 is fixed and the LAS decoder 230 is trained to maximize
[0042]
number
[0043] When the two-pass model includes an additional encoder 250, the additional encoder 250 is trained to maximize
[0044]
number
[0045] , while the encoder 210 is fixed. As further illustrated by FIG. 3A and FIG. 3B, a conventional training process may be adapted to a training process 300 that includes additional constraints on the LAS decoder 230. For example, the training process 300 constrains an attention head of the LAS decoder 230 (e.g., one of the attention heads in the LAS decoder 230) to generate an attention probability indicative of the word timing 206 corresponding to the output 232 of the second pass 208b. In some configurations, by including this additional constraint, the training process 300 trains to minimize a standard cross entropy loss in the LAS decoder 230, as well as to minimize an attention alignment loss for the LAS decoder 230 (e.g., an attention alignment loss for the attention head of the LAS decoder 230).
[0046] In some examples, such as in FIG. 3A and FIG. 3B, the training process 300 trains the two-pass model architecture 200 on multiple training examples 302, each including audio data representing an oral utterance and a corresponding ground truth transcription of the oral utterance. For each word of the corresponding oral utterance, the corresponding training example 302 also includes a ground truth start time 312 for the word, a ground truth end time 314 for the word, and constraints 304 indicating where each word piece should occur in the word emanating from the LAS decoder 230. The training process 300 may run on a system 500 (FIG. 5) to train the speech recognizer 200. The trained speech recognizer 200 may be deployed to run on the user device 110 of FIG. 1A-1C. In some cases, the trained speech recognizer 200 may run on the system 500 or another system in communication with the user device 110. The training process 300 uses the constraints 304 of the training examples 302 to teach the two-pass model to generate (or insert) a placeholder symbol before each word 310 to indicate the start of the respective word 310 in the utterance and / or after the last word 310 of the spoken utterance 12. In some configurations, the placeholder symbol is a word boundary symbol before each word 310. <wb>3, the boundary word pieces 320 (e.g., shown as word pieces 320, 320a, 320d, 320g) and / or utterance boundary word pieces 320 after the last word 310 of the utterance 12. Although the training examples 302 with placeholder symbols correspond to words 310, the two-pass model learns to include the placeholder symbols as word pieces 320 during its generation of the transcription 204. During inference (i.e., use of the two-pass model), the boundary word pieces 320 (e.g., shown as word boundaries <wb>In the case of a two-pass model trained to generate utterance boundaries (and / or speech boundaries), the boundary word pieces 320 allow the speech recognizer 200 to have further detail for determining word timing 206.
[0047] To generate word timing 206 from the two-pass model using word pieces 320, the two-pass model is configured to focus on specific word pieces that correspond to the start of a respective word 310 or the end of a respective word 310. More specifically, the training process 300 desires to constrain the first word piece 320 that corresponds to the start of a respective word 310 to occur as close as possible to the start 312 of the alignment for the respective word 310, and to constrain the last word piece 320 that corresponds to the end of a respective word 310 to occur as close as possible to the end 314 of the alignment for the respective word 310. Here, the constraints 304 constrain all other word pieces 320 that make up a word 310 to occur anywhere within the ground truth start time 312 and ground truth end time 314 of the word 310.
[0048] Referring to FIG. 3B, during the training process 300, the LAS decoder 230 is trained using training examples 302 that include training example constraints 304. As explained above, the training example constraints 304 are configured to constrain a first word piece 320 corresponding to the start of a respective word 310 to occur as close as possible to the start of the alignment for the respective word 310, and to constrain a last word piece 320 corresponding to the end of a respective word 310 to occur as close as possible to the end of the alignment for the respective word 310. For illustration purposes, FIG. 3B shows a simple training example 302, "the cat sat," with three words 310, 310a-c, where each word 310 in the training example 302 has a known ground truth alignment, with a ground truth alignment start time 312 and a ground truth alignment end time 314. In Figure 3B, a first word 310a "the" has a first ground truth start time 312, 312a and a first ground truth end time 314, 314a. A second word 310b "cat" has a second ground truth start time 312, 312b and a second ground truth end time 314, 314b. A third word 310c "sat" has a third ground truth start time 312, 312c and a third ground truth end time 314, 314c.
[0049] Based on the ground truth alignments 312, 314 for each word 310, the training examples 302 include training example constraints 304 that constrain each word piece 320 corresponding to the word 310 to be aligned with the ground truth alignments 312, 314. Here, the first word 310a, “the”, is made up of three word pieces 320, 320a-c, i.e., boundary word pieces 320 (e.g., <wb>The second word 310b "cat" includes three word pieces 320, 320d-f, i.e., boundary word pieces 320 (e.g., <wb>The third word 310c includes three word pieces 320, 320g-i, i.e., boundary word pieces 320 (e.g., <wb>3, a seventh word piece 320g which is the utterance boundary 320 (denoted as, for example), an eighth word piece 320h which is "sat", and a ninth word piece 320i which is an utterance boundary 320 (denoted as, for example).
[0050] The training process 300 is configured to determine which word pieces 320 of each word 310 correspond to the beginning (i.e., the start word pieces) of each word 310 and which word pieces 320 of each word 310 correspond to the end (i.e., the end word pieces) of each word 310. For example, in the example of FIG. 3B, the training process 300 determines that the first word piece 320a is the start word piece for the first word 310a, the fourth word piece 320d is the start word piece for the second word 310b, and the seventh word piece 320g is the start word piece for the third word 310c. Similarly, the training process 300 determines that the third word piece 320c is the end word piece for the first word 310a, the sixth word piece 320f is the end word piece for the second word 310b, and the ninth word piece 320i is the end word piece for the third word 310c. In some instances, the start word piece 320 and the end word piece 320 are the same word piece 320 because a particular word 310 only contains one word piece 320 .
[0051] Once the training process 300 has determined the start and end word pieces for each word 310 in the training examples 302, the training process 300 is configured to generate a constrained alignment 330 for each of the start and end word pieces 320. In other words, the training process 300 generates alignment constraints that aim to establish when in an index of time a particular word piece 320 should occur based on the timing of the ground truth alignments 312, 314. In some implementations, the constrained alignment 330 for a word piece 320 spans a time interval extending from a word piece start time 322 to a word piece end time 324. When a word piece 320 is a start word piece 320 for a word 310, the start word piece 320 has a constrained alignment 330 that is aligned with the ground truth alignment start time 312. For example, the constrained alignment 330 for the beginning word piece 320 spans a time interval centered on the ground truth alignment start time 312. On the other hand, when the word piece 320 is the ending word piece 320 for the word 310, the ending word piece 320 has a constrained alignment 330 that is aligned with the ground truth alignment end time 314. For example, the constrained alignment 330 for the ending word piece 320 spans a time interval centered on the ground truth alignment end time 314. When the word piece 320 does not correspond to either the beginning or ending word piece 320, the word piece 320 may have a constrained alignment 330 that corresponds to a time interval that extends from the ground truth alignment start time 312 to the ground truth alignment end time 314. In other words, the training example constraint 304 indicates that a word piece 320 that does not correspond to either the start word piece 320 or the end word piece 320 may occur at any time between when the ground truth occurred for a word 310 that corresponds to the word piece 320.
[0052] In some configurations, the training process 300 includes an adjustable constrained alignment 330. In other words, the word piece start time 322 and / or the word piece end time 324 may be adjusted to define different time intervals for the ground truth alignment 312, 314. Here, the time intervals may be referred to as timing buffers, such that the timing buffer includes a first time period before the ground truth alignment 312, 314 and a second time period after the ground truth alignment 312, 314. In other words, the first time period of the timing buffer is equal to the length of time between the word piece start time 322 and the ground truth alignment 312, 314, and the second time period of the timing buffer is equal to the length of time between the word piece end time 324 and the ground truth alignment 312, 314. By adjusting the timing buffers, the training example constraints 304 may optimize the WER for the two-pass model while attempting to minimize latency. For example, experiments with timing buffers have shown that a timing buffer of approximately 180 ms is more optimal in terms of WER and latency than a timing buffer of 60 ms or 300 ms.
[0053] In some examples, the training process 300 applies a constrained alignment 330 (e.g., constrained alignment 330, 330a-i) to an attention mechanism associated with the LAS decoder 230. In other words, the training process 300 trains the LAS decoder 230 (e.g., an attention head of the LAS decoder 230) using one or more training examples 302 that include training example constraints 304. In some implementations, the LAS decoder 230 includes multiple attention heads, but the training process 300 constrains one or fewer than all of the attention heads of the LAS decoder 230 to allow one or more attention heads to operate without constraints. Here, during the training process 300, the constrained attention head generates an attention probability for each training example 302. When the attention probability generated by the attention head corresponds to a constrained alignment 330, the training process 300 is configured to compare the attention probability to an expected attention probability for the training example 302 in the constrained alignment 330. In some configurations, the training example constraints 304 indicate an expected attention probability for the constrained alignment 330 of each word piece 320. For example, the expected probability for the constrained alignment 330 between the word piece start time 322 and the word piece end time 324 is set to a high or non-zero value (e.g., a value of 1) to indicate that the alignment of the word piece 320 occurs at an acceptable time (i.e., within the constrained alignment 330). In some examples, the training example 302 includes an expected attention probability that is set to a low or 0 value to indicate that the alignment of the word piece 320 occurs at an alignment time that is not acceptable (e.g., not within the constrained alignment 330). During the training process 300, when the attention probabilities fail to match or meet the expected attention probabilities, the training process 300 is configured to apply a training penalty to the constrained attention head.In some examples, the training process 300 applies a training penalty such that the training penalty minimizes the attention loss for the LAS decoder 230 during training. In some examples, the attention loss is represented by the following equation:
[0054]
number
[0055] where β is the attention loss L attention where u corresponds to a word piece unit such that u∈U, t corresponds to time such that t∈T, c(u,t) corresponds to the training example constraints 304 for each word piece unit u over time t, and a(u,t) corresponds to the attention of the constrained attention head for each word piece unit u over time t. Additionally or alternatively, the training process 300 may apply a training penalty to minimize an overall loss for the LAS decoder 230 during training, where the overall loss is expressed by the following equation: L overall =L attention +L LAS (2)
[0056] By applying the training penalty, the training process 300 teaches the constrained attention head of the LAS decoder 230 to have a maximum attention probability for each word piece 320 at a time corresponding to when the word piece 320 occurs in time across multiple training examples 302. For example, if the training process 300 trains a two-pass model, during decoding, the LAS decoder 230 operates a beam search that emits a word piece unit u at each step in the beam search. Now, the speech recognizer 200 determines the word piece timing for each word piece unit u by finding the index of time that results in the maximum constrained attention head probability for this particular word piece unit u. From the word piece timing, the actual word timing 206 can be derived. For example, the word piece timing for a boundary word piece 320 corresponds to the start of a word 310 and the end of a word 310. Here, the start word piece 320 for a word 310 (e.g., a word boundary <wb>3B ) will have a timing that corresponds to the start time of the respective word 310, and the end word piece 320 of each word 310 (e.g., shown as an utterance boundary word piece 320 in FIG. 3B ) will have a timing that corresponds to the end time of the respective word 310. In other words, the speech recognizer 200 may determine that the actual word timing 206 (e.g., the start time of the word 310 and the end time of the word 310) is equal to the word piece timing for the start word piece 320 and the end word piece 320. Based on this determination, the speech recognizer 200 is configured to generate word timing 206 for the words output by the speech recognizer 200 (e.g., as shown in FIGS. 1A-1C ).
[0057] 4 is a flowchart of an exemplary arrangement of operations for a method 400 of implementing a speech recognizer 200 with constrained attention. In operation 402, the method 400 receives training examples 302 for a two-pass neural network model LAS decoder 230. In operation 404, the method 400 performs operations 404, 404a-d for each word 310 of the training examples 302. In operation 404a, the method 400 inserts a placeholder symbol before each word 310. In operation 404b, the method 400 identifies respective ground truth alignments 312, 314 for the start of each word 310 and the end of each word 310. In operation 404c, the method 400 determines a starting word piece 320 of each word 310 and an ending word piece 320 of each word 310. At operation 404d, the method 400 generates a first constrained alignment 330 for the starting word piece 320 of each word 310 and a second constrained alignment 330 for the ending word piece 320 of each word 310, where the first constrained alignment 330 is aligned with the ground truth alignment 312, 314 for the start of each word 310 (e.g., the ground truth alignment start time 312) and the second constrained alignment 330 is aligned with the ground truth alignment 312, 314 for the end of each word 310 (e.g., the ground truth alignment end time 314). In operation 406, the method 400 constrains the attention head of the LAS decoder 230 of the two-pass neural network model by applying the training examples 302, including all of the first constrained alignments 330 and the second constrained alignments 330 for each word 310 of the training examples 302.
[0058] 5 is a schematic diagram of an exemplary computing device 500 that may be used to implement the systems (e.g., speech recognizer 200) and methods (e.g., training process 300 and / or method 400) described herein. Computing device 500 is representative of various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. The components shown, their connections and relationships, and their functions are intended to be exemplary only and are not intended to limit the implementation of the invention described and / or claimed herein.
[0059] Computing device 500 includes a processor 510 (e.g., data processing hardware), a memory 520 (e.g., memory hardware), a storage device 530, a high-speed interface / controller 540 that connects to memory 520 and a high-speed expansion port 550, and a low-speed interface / controller 560 that connects to a low-speed bus 570 and storage device 530. Each of components 510, 520, 530, 540, 550, and 560 may be interconnected using various buses and mounted on a common motherboard or in other manners as appropriate. Processor 510 can process instructions for execution within computing device 500, including instructions stored in memory 520 or on storage device 530 for displaying graphical information for a graphical user interface (GUI) on an external input / output device, such as a display 580 coupled to high-speed interface 540. In other implementations, multiple processors and / or multiple buses may be used along with multiple memories and multiple types of memories, as appropriate. Also, multiple computing devices 500 may be connected, with each device providing a portion of the required operations (eg, as a bank of servers, a group of blade servers, or a multi-processor system).
[0060] The memory 520 stores information non-transiently within the computing device 500. The memory 520 may be a computer-readable medium, a volatile memory unit, or a non-volatile memory unit. The non-volatile memory 520 may be a physical device used to temporarily or permanently store programs (e.g., sequences of instructions) or data (e.g., program state information) for use by the computing device 500. Examples of non-volatile memory include, but are not limited to, flash memory and read-only memory (ROM) / programmable read-only memory (PROM) / erasable programmable read-only memory (EPROM) / electronically erasable programmable read-only memory (EEPROM) (e.g., typically used for firmware, such as boot programs). Examples of volatile memory include, but are not limited to, random access memory (RAM), dynamic random access memory (DRAM), static random access memory (SRAM), phase change memory (PCM), as well as disks or tapes.
[0061] The storage device 530 can provide mass storage for the computing device 500. In some implementations, the storage device 530 is a computer-readable medium. In various different implementations, the storage device 530 can be an array of devices, including a floppy disk device, a hard disk device, an optical disk device, or a tape device, a flash memory or other similar solid-state memory device, or a device in a storage area network or other configuration. In additional implementations, the computer program product is tangibly embodied in an information carrier. The computer program product includes instructions that, when executed, perform one or more methods, such as those described above. The information carrier is a computer or machine-readable medium, such as the memory 520, the storage device 530, or a memory on the processor 510.
[0062] The high-speed controller 540 manages bandwidth-intensive operations for the computing device 500, while the low-speed controller 560 manages less bandwidth-intensive operations. Such an allocation of functionality is merely exemplary. In some implementations, the high-speed controller 540 is coupled to the memory 520, to the display 580 (e.g., through a graphics processor or accelerator), and to a high-speed expansion port 550, which may accept various expansion cards (not shown). In some implementations, the low-speed controller 560 is coupled to the storage device 530 and to a low-speed expansion port 590. The low-speed expansion port 590 may include various communication ports (e.g., USB, Bluetooth, Ethernet, wireless Ethernet) and may be coupled to one or more input / output devices, such as a keyboard, pointing device, scanner, or to a networking device, such as a switch or router, for example, through a network adapter.
[0063] The computing device 500, as shown in the figure, may be implemented in a number of different forms. For example, the computing device 500 may be implemented as a standard server 500a or multiple times in a group of such servers 500a, as a laptop computer 500b, or as part of a rack server system 500c.
[0064] Various implementations of the systems and techniques described herein may be realized in digital electronic and / or optical circuitry, integrated circuits, specially designed ASICs (application specific integrated circuits), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include implementations in one or more computer programs executable and / or interpretable on a programmable system that includes at least one programmable processor, which may be special purpose or general purpose, coupled to receive data and instructions from and transmit data and instructions to a storage system, at least one input device, and at least one output device.
[0065] These computer programs (also known as programs, software, software applications, or code) contain machine instructions for a programmable processor and may be implemented in a high-level procedural and / or object-oriented programming language and / or in assembly / machine language. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, non-transitory computer-readable medium, apparatus and / or device (e.g., magnetic disk, optical disk, memory, programmable logic device (PLD)) used to provide machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and / or data to a programmable processor.
[0066] The processes and logic flows described herein may be executed by one or more programmable processors executing one or more computer programs to perform functions by operating on input data and generating output. The processes and logic flows may also be executed by special purpose logic circuitry, for example, an FPGA (field programmable gate array) or an ASIC (application specific integrated circuit). Processors suitable for executing computer programs include, by way of example, both general purpose and special purpose microprocessors, and any one or more processors of any kind of digital computer. Generally, a processor will receive instructions and data from a read-only memory, or a random access memory, or both. The essential elements of a computer are a processor for executing instructions, and one or more memory devices for storing instructions and data. Generally, a computer will also include one or more mass storage devices, for example, magnetic disks, magneto-optical disks, or optical disks, for storing data, or will be operatively coupled to receive data from or transfer data to them, or both. However, a computer need not have such devices. Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media and memory devices, including, by way of example, semiconductor memory devices, e.g., EPROM, EEPROM, and flash memory devices, magnetic disks, e.g., internal hard disks or removable disks, magneto-optical disks, and CD ROM and DVD-ROM disks. The processor and memory may be supplemented by, or incorporated in, special purpose logic circuitry.
[0067] To provide for interaction with a user, one or more aspects of the present disclosure may be implemented on a computer having a display device, e.g., a CRT (cathode ray tube), LCD (liquid crystal display) monitor, or touch screen, for displaying information to the user, and possibly a keyboard and pointing device, e.g., a mouse or trackball, by which the user can provide input to the computer. Other types of devices may also be used to provide for interaction with the user, e.g., feedback provided to the user may be any form of sensory feedback, e.g., visual feedback, auditory feedback, or tactile feedback, and input from the user may be received in any form, including acoustic input, speech input, or tactile input. In addition, the computer may interact with the user by sending documents to and receiving documents from a device used by the user, e.g., by sending a web page to a web browser on the user's client device in response to a request received from the web browser.
[0068] Although several implementations have been described, it will be understood that various modifications may be made without departing from the spirit and scope of the present disclosure. Accordingly, other implementations are within the scope of the following claims. [Explanation of symbols]
[0069] 10 users 12 Oral speech, speech, streaming oral speech 100 Audio environment, audio-enabled environment, audio-enabled system 110 User Device, Device 112 Data Processing Hardware, Hardware 114 Memory Hardware, Hardware 116 Audio capture devices, audio output devices, audio subsystems 116a Audio capture device, capture device 116b Audio output device 118 Programs or applications, transcription applications, communication applications, applications, voice assistant applications 200 Speech Recognizer, ASR Speech Recognizer, Two-Pass Model Architecture 202 Streaming audio data, audio data, audio input 204 Transcription 206 Word Timing 208 First path, second path, path network, path 208a 1st path 208, 1st path 208b Second path 208, second path 210 Encoder 212, 222, 232 Output 220 RNN-T Decoder 230 LAS decoder, 2-layer LAS decoder 250 acoustic encoders, additional encoders 252 encoded output 300 Training Processes 302 Training Examples 304 constraints, training example constraints 310 words 310a Word, first word 310b Word, second word 310c Word, third word 312 Ground truth start time, alignment start, ground truth alignment start time, ground truth alignment 312a First ground truth start time 312 312b Second ground truth start time 312 312c Third ground truth start time 312 314 Ground truth end time, alignment end, ground truth alignment end time, ground truth alignment 314a First ground truth end time 314 314b Second ground truth end time 314 314c Third ground truth end time 314 320 Word Boundaries <wb>word piece, word piece, utterance boundary word piece, boundary word piece, first word piece, last word piece, utterance boundary, start word piece, end word piece 320a Word Piece, First Word Piece 320b Word Piece, Second Word Piece 320c Word Piece, Third Word Piece 320d Word Piece, 4th Word Piece 320e Word Piece, 5th Word Piece 320f Word Piece, 6th Word Piece 320g Word Piece, 7th Word Piece 320h Word Piece, 8th Word Piece 320i Word Piece, 9th Word Piece 322 Word Piece Start Time 324 Word Piece End Time 330 constrained alignment, adjustable constrained alignment, first constrained alignment, second constrained alignment 330a~i Constrained alignment 500 Systems, Computing Devices 500a Standard Server, Server 500b Laptop Computer 500c Rack Server System 510 Processor, components 520 Memory, components, non-volatile memory 530 Storage devices, components 540 High Speed Interface / Controller, Components, High Speed Interface, High Speed Controller 550 High Speed Expansion Port, Components 560 Low Speed Interface / Controller, Components, Low Speed Controller 570 Slow Bus 580 Display 590 Low Speed Expansion Port< / wb> < / wb> < / wb> < / wb> < / wb> < / wb> < / wb>
Claims
1. A computer-implemented method (400) that, when executed on data processing hardware (112), causes the data processing hardware (112) to perform operations, the operations comprising: receiving training examples (302) for a second pass decoder (230) of a two-pass neural network model, the training examples (302) comprising audio data (202) representing an oral utterance (12) of one or more words (310) and a corresponding ground truth transcription (204) of the oral utterance (12); For each word (310) in the spoken utterance (12), inserting a placeholder symbol before each of said words (310); identifying a respective ground truth alignment (312, 314) for the start of the respective word (310) and the end of the respective word (310); determining a start word piece (320) of each of said words (310) and an end word piece (320) of each of said words (310); and generating a first constrained alignment (330) for the starting word piece (320) of each of the words (310) and a second constrained alignment (330) for the ending word piece (320) of each of the words (310), where the first constrained alignment (330) is aligned with the ground truth alignment (312, 314) for the start of each of the words (310) and the second constrained alignment (330) is aligned with the ground truth alignment (312, 314) for the end of each of the words (310); constraining an attention head of the second pass decoder (230) of the two-pass neural network model by applying the training examples (302) comprising all of the first constrained alignment (330) and the second constrained alignment (330) for each word (310) of the training examples (302). A computer-implemented method (400).
2. 2. The computer-implemented method of claim 1, wherein the beginning word piece and the ending word piece comprise the same word piece for the respective word.
3. 3. The computer-implemented method of claim 1, wherein the second pass decoder comprises a plurality of attention heads.
4. 4. The computer-implemented method (400) of claim 1, wherein constraining the attention head comprises constraining attention probabilities derived from the attention head of the second pass decoder (230).
5. The operation, During training of the second pass decoder (230) on the training examples (302), identifying an expected attention probability for a portion of the training examples (302); determining that the constrained attention head generates an attention probability for at least one of the portions of the training examples (302) that fails to match the expected attention probability; and applying a training penalty to the constrained attention head; 5. The computer-implemented method (400) of claim 1, further comprising:
6. 6. The computer-implemented method of claim 5, wherein the attention probability for the at least one of the portions of the training examples occurs at a time corresponding to either the first constrained alignment or the second constrained alignment.
7. 6. The computer-implemented method of claim 5, wherein the attention probability for the at least one of the portions of the training examples occurs at a time that does not correspond to either the first constrained alignment or the second constrained alignment.
8. The operation, During training of the second pass decoder (230) on the training examples (302), determining that the constrained attention head generates a non-zero attention probability outside of a boundary corresponding to the first constrained alignment (330) and the second constrained alignment (330); and applying a training penalty to the constrained attention head; 8. The computer-implemented method (400) of any one of claims 1 to 7, further comprising:
9. The operation, During training of the second pass decoder (230) on the training examples (302), Minimizing attention loss for the constrained attention head; and Minimizing the cross entropy loss for the second pass decoder (230).
9. The computer-implemented method (400) of any one of claims 1 to 8, further comprising:
10. each respective constrained alignment (330) comprising a timing buffer for said respective ground truth alignment (312, 314); 10. The computer-implemented method of claim 1, wherein the timing buffer constrains each of the first constrained alignment (330) and the second constrained alignment (330) to a time interval comprising a first time period before the respective ground truth alignment (312, 314) and a second time period after the respective ground truth alignment (312, 314).
11. The operation, During execution of the two-pass neural network model using the second pass decoder (230) trained on the training examples (302), Receiving audio data (202) of an utterance (12); determining a time corresponding to a maximum probability in the constrained attention head of the second pass decoder (230); and generating a word start time or a word end time for the determined time corresponding to a maximum probability in the constrained attention head of the second pass decoder (230); 11. The computer-implemented method (400) of any one of claims 1 to 10, further comprising:
12. A system (500), Data processing hardware (112); memory hardware (114) in communication with said data processing hardware (112); the memory hardware (114) stores instructions that, when executed on the data processing hardware (112), cause the data processing hardware (112) to perform operations, the operations comprising: receiving training examples (302) for a second pass decoder (230) of a two-pass neural network model, the training examples (302) comprising audio data (202) representing an oral utterance (12) of one or more words (310) and a corresponding ground truth transcription (204) of the oral utterance (12); For each word (310) of the spoken utterance (12), inserting a placeholder symbol before each of said words (310); identifying a respective ground truth alignment (312, 314) for the start of the respective word (310) and the end of the respective word (310); determining a start word piece (320) of each of said words (310) and an end word piece (320) of each of said words (310); and generating a first constrained alignment (330) for the starting word piece (320) of each of the words (310) and a second constrained alignment (330) for the ending word piece (320) of each of the words (310), where the first constrained alignment (330) is aligned with the ground truth alignment (312, 314) for the start of each of the words (310) and the second constrained alignment (330) is aligned with the ground truth alignment (312, 314) for the end of each of the words (310); constraining an attention head of the second pass decoder (230) of the two-pass neural network model by applying the training examples (302) comprising all of the first constrained alignment (330) and the second constrained alignment (330) for each word (310) of the training examples (302). A system (500).
13. 13. The system (500) of claim 12, wherein the starting word piece (320) and the ending word piece (320) comprise the same word piece (320) for the respective word (310).
14. 14. The system (500) of claim 12 or 13, wherein the second path decoder (230) comprises a plurality of attention heads.
15. 15. The system (500) of claim 12, wherein constraining the attention head comprises constraining attention probabilities derived from the attention head of the second pass decoder (230).
16. The operation, During training of the second pass decoder (230) on the training examples (302), identifying an expected attention probability for a portion of the training examples (302); determining that the constrained attention head generates an attention probability for at least one of the portions of the training examples (302) that fails to match the expected attention probability; and applying a training penalty to the constrained attention head; 16. The system (500) of any one of claims 12 to 15, further comprising:
17. 17. The system (500) of claim 16, wherein the attention probability for the at least one of the portions of the training examples (302) occurs at a time corresponding to either the first constrained alignment (330) or the second constrained alignment (330).
18. 17. The system (500) of claim 16, wherein the attention probability for the at least one of the portions of the training examples (302) occurs at a time that does not correspond to either the first constrained alignment (330) or the second constrained alignment (330).
19. The operation, During training of the second pass decoder (230) on the training examples (302), determining that the constrained attention head generates a non-zero attention probability outside of a boundary corresponding to the first constrained alignment (330) and the second constrained alignment (330); and applying a training penalty to the constrained attention head; 19. The system (500) of any one of claims 12 to 18, further comprising:
20. The operation, During training of the second pass decoder (230) on the training examples (302), Minimizing attention loss for the constrained attention head; and Minimizing the cross entropy loss for the second pass decoder (230).
20. The system (500) of any one of claims 12 to 19, further comprising:
21. each respective constrained alignment (330) comprising a timing buffer for said respective ground truth alignment (312, 314); 21. The system (500) of any one of claims 12 to 20, wherein the timing buffer constrains each of the first constrained alignment (330) and the second constrained alignment (330) to a time interval comprising a first time period before the respective ground truth alignment (312, 314) and a second time period after the respective ground truth alignment (312, 314).
22. The operation, During execution of the two-pass neural network model using the second pass decoder (230) trained on the training examples (302), Receiving audio data (202) of an utterance (12); determining a time corresponding to a maximum probability in the constrained attention head of the second pass decoder (230); and generating a word start time or a word end time for the determined time corresponding to a maximum probability in the constrained attention head of the second pass decoder (230); 22. The system (500) of any one of claims 12 to 21, further comprising:
Citation Information
Patent Citations
Speech recognition system and speech recognition method
JP2020505650A
Editing support system, editing support method and editing support program
WO2010146869A1
Two-pass end to end speech recognition
WO2020247489A1