This invention relates generally to minimum word error (MWE) training of a recurrent neural network language model (RNNLM) for speech recognition. Particularly the method uses a long short-term memory .and language models.
Language models are indispensable for large-vocabulary continuous-speech recognition. The models, which are usually based on n-grain statistics, provide prior probabilities of hypothesized sentences to disambiguate their acoustical similarities. To construct an n-grain model, text corpora are used to estimate the probability of a word's occurrence conditional on the preceding n−1 words, where n is typically 3 or 4.
On the other hand, continuous space language models based on neural networks have attracted increased attention in recent years. With that approach, word indexes are mapped to a continuous space and word probability distributions are estimated as smooth functions in that space. Consequently, that approach makes it possible to provide better generalization for unrecognized n-grams.
A recurrent neural network language model (RNNLM) is an instance of such continuous space language models. The RNNLM has a hidden layer with re-entrant connections to itself with a one word delay. Hence, the activations of the hidden units play a role of memory keeping a history from the beginning of the speech. Accordingly, the RNNLM can estimate word probability distributions by taking long-distance inter-word dependencies into account.
In addition, more advanced RNNLMs, Long Short-Term Memory (LSTM) RNNs are used in language modeling for speech recognition, which can characterize longer contextual information than the conventional RNNLMs by handling the memory with several gating functions, and improves the recognition accuracy.
In most cases, RNNLMs are trained to minimize a cross entropy of estimated word probabilities against the correct word sequence given a history, which corresponds to maximizing the likelihood for given training data. However, this training does not necessarily maximize a performance measure in a target task, i.e., it does not minimize word error rate (WER) explicitly in speech recognition. For n-gram-based language models, several discriminative training methods are known to solve this problem, but those for RNNLMs have been insufficiently investigated so far. A hidden activation vector of the RNNLM can be added to the feature vector for a log-linear language model. In addition, a cross entropy criterion can be modified based on word confidence measure.
Discriminative training methods are widely used in speech recognition, where acoustic or language models are trained to optimize their parameters based on a discriminative criterion. Unlike the maximum likelihood approach, those methods can improve discriminative performance of models by taking a set of competing hypotheses for each training sample into account.
In speech recognition, a hypothesis means a word sequence inferred by an ASR system for a given utterance. ASR systems find multiple hypotheses for an input utterance and select the best-scored hypothesis among them, where each hypothesis is scored with its probability obtained by the acoustic and language models. In discriminative training, the multiple hypotheses are usually used to train the models based on a discriminative criterion.
In language modeling, n-grain probabilities are directly optimized with a minimum classification error criterion, and log-linear language models with n-gram features are trained with a perceptron procedure, reranking boosting, and minimum word error rate training. Because those methods are designed for n-gram models or n-gram-feature-based models, they cannot be used directly for neural network-based language models including RNNLMs. Another method uses a hidden activation vector of an RNNLM as additional features for a log-linear language model. However, the RNNLM itself is not trained discriminatively.
A discriminative training method for RNNLMs uses a likelihood ratio of each reference word to the corresponding hypothesized word is used instead of the cross entropy. However, that method does not sufficiently exploit the potential ability of discriminative training with regards the following reasons;
It considers only one competitor for each reference word, where the competitor is a hypothesized word in the 1-best ASR result.
In general, it is better to consider multiple competitors in discriminative training.
It is not a sequence training because word-to-word alignment is fixed during the training. This means that inter-dependence of word errors is ignored.
It does not directly minimize word error rate that is the ASR performance measure.
The embodiments of the invention provide a method and system for training a language model to reduce recognition errors, wherein the language models is a recurrent neural network language model (RNNLMs) that can be used for speech recognition. RNNLMs are usually trained to minimize a cross entropy of estimated word probabilities of a correct word sequence, which corresponds to maximum likelihood criterion. That training does not necessarily maximize a performance measure in a target task, i.e., it does not minimize word error rate (WER) explicitly in speech recognition.
To solve such a problem, several discriminative training methods are known for n-gram language models, but those for RNNLMs have not been sufficiently described so far. The embodiments provide the a MWE training method for RNNLMs with significant WER reductions. The MWE method can be appled to a conventional Elman-type RNNLM, as well as a more advanced model, such as a Long Short-Tenn Memory (LSTM) RNNLM. Also disclosed is an efficient MWE training with N-best lists on graphics processer units (GPU).
The MWE criterion can be propogated in a back-propagation through time (BPTT) procedure for RNNLMs, which minimizes the expected word error rate using a set of N-best lists generated by a speech recognizer. Although that method increases the training computation in proportion to the size of N-best list, it can be performed in realistic time by parallelizing the BPTT over multiple word sequences using graphics processing untis (GPU) multi-processors.
The embodiments of the invention provide a method and system for training a language model to reduce recognition errors, wherein the language model is a recurrent neural network language model (RNNLM) that can be used for speech recognition. The RNNLM includes hypotheses.
We discriminatively train a word-based RNNLM, a class-based RNNLM, and an LSTM RNNLM based on a minimum word error criterion. For simplicity of this description, we start with a word-based RNNLM as shown in
Given a word sequence w1, . . . ,wt, . . . ,wT of a vocabulary V, the input vector xt∈{0,1}|v|110 for time index t is represented as
x
t=OneHot(wt−1), (1)
where OneHot(w) denotes a 1-of-N coding of word w, which converts a word index to a one hot vector representation.
The D dimensional activation vector ht∈[0,1]D 120 in the current hidden layer are determined as
h
t=σ(Wihxt+Whhht−1), (2)
where Wih∈RD×|V| and Whh∈RD×D are the input-hidden and hidden-hidden weight matrices, where σ(•) is an element-wise sigmoid function.
The output vector yt∈[0,1]|V|130, which corresponds to the predicted word distribution, is
y
t=ζ(Whoht), (3)
where Who is a weight matrix of the output layer. ζ(•) denotes a softmax function, or normalized exponents, which determines the softmax over the elements in a given vector. The word occurrence probability of wt in a context ht is
P(wt|ht)≡yt[wt], (4)
where yt[wt] indicates the wt-th element of vector yt . Hereafter, we use [•] to specify an element in the vector.
For comparison,
For a class-based RNNLM as shown in
which can be obtained as
y
t,m
(w)=ζ(Who,m(w)ht) (6)
y
t
(c)=ζ(Who (c)h t) (7)
where yt,m(w) and Who,m(w) are sub-vectors of yt(w) and a sub-matrix of Who corresponding to the words in an in m-th class, respectively, and Who(c) is a sub-matrix of Who for the class output.
A word occurrence probability is
P(wt|ht)≡y(w)t,C(w
where C(w) denotes an index of the class to which the word w belongs. With the class-based architecture, the complexity for propagating activations from the hidden layer to the output layer can be reduced, because we only use the words in the class of the current word to determine a softmax function rather than all the words in the vocabulary.
As an extension of RNNs, Long Short-Term Memory (LSTM) RNNs can be applied to language modeling. It is well known that the conventional RNNs cannot hold the hidden activation information for long time because the activation pattern at a certain time is exponentially decaying according as iterative propagation through time, and it is difficult to train interdependence between distant events.
To solve this problem, the LSTM has memory cells instead of regular network units. An LSTM cell can remember a value for an arbitrary length of time, which contains input, forget, and output gates that determine when the input is significant enough to remember, when it should continue to remember or forget the value, and when it should output the value. An example of LSTM cell is depicted in
A loss function of minimum word error training is
where Λ is a set of model parameters, K is the number of utterances in training data, Ok is a k-th acoustic observation sequence, and Wk(R)={wk,1(R), . . . , w(R)k,T
We use a set of N-best lists and obtain a loss function
where Wk,n={wk,n,1, . . . , wk,n,T
where gk,n is a log-likelihood score of hypothesis Wk,n obtained by
g
k,n=αlogPΛ
and ΛL and ΛA are sets of language and acoustic model parameters, respectively. We assume that ΛA is fixed in language model training. and α is a scaling factor to balance acoustic and language scores.
A language log-probability is obtained by the RNNLM as
where yk,n,t[k,n,t] corresponds to an output of the RNNLM for the t-th word in Wk,n. Each word probability can be determined using a word-based model (the upper part in the braced expression, or class-based model the lower part, according to Eq. (8).
Hereafter, we describe the optimization procedure only for the word-based RNNLMs, but the procedure can be easily extended for class-based RNNLMs.
We obtain partial derivatives of the loss function L(Λ) with respect to ΛL for back propagation over time with a (BPTT) procedure. For simplicity, here we only use the derivative with respect to each RNNLM's output ok,n,t before applying the softmax function, i.e., ∂L(Λ)/∂ok,n,t[i], where
The derivative can be factorized into two derivatives using a chain rule as
The first factor corresponds to the differences with respect to the N-best hypothesis scores, and the second factor corresponds to those of RNN's output. The first factor is the hypothesis gradient, and the second factor is the word gradient. Accordingly, if we obtain the hypothesis gradient for each N-best hypothesis, then the original BPTT procedure can be performed over N-best hypotheses using the multiplication of these two factors as the error signal for the RNNLM.
By substituting Eqs. (11) and (12) into Eq. (10), the hypothesis gradient can be obtained as
where Ē(k) stands for the expectation of the number of word errors, which corresponds to
The word gradient is obtained with the same way as the case of cross entropy criterion by using Eqs. (13) and (14).
As described in the above equations, the hypothesis gradient has an effect that when the number of errors is larger than its mean value, the error signal of Eq. (18), i.e., the word gradient, is emphasized toward the positive direction, and if the number of errors is smaller, the error signal is emphasized toward the negative direction.
In the training iterations, we apply a stochastic gradient descent method on an utterance-by-utterance basis, i.e., the gradients are accumulated over N-best hypotheses in the list. For each hypothesis, BPTT is performed with the error vector obtained by Eqs. (15-18). After processing each N-best list, the parameters are updated with the sum of gradients.
However, the method needs more computations than conventional cross-entropy-based training because the number of sentences increases by N times for N-best lists. We solve this problem by parallelization with graphics processing units (GPUs). Actually, gradient accumulation can be performed in parallel over multiple hypotheses in each N-best list. Ee input multiple words at the same time to the RNNLM, where all the words are located at the same position in the different sentences of the N-best list. Because the set of words, hidden activations, and output probabilities can be represented as a matrix, most steps in training can be performed by matrix-matrix operations on a graphic processer unit (GPU).
Although the invention has been described by way of examples of preferred embodiments, it is to be understood that various other adaptations and modifications can be made within the spirit and scope of the invention. Therefore, it is the object of the appended claims to cover all such variations and modifications as come within the true spirit and scope of the invention.
This Patent Application is related to U.S. Ser. No. 14/959,132. “Method and System for Role Dependent Context Sensitive Spoken and Textual Language Understanding with Neural Networks,” filed by Hori et al., on Dec. 4, 2015, and incorporated herein by reference. That Application discloses a method and system for processing utterances that are acquired either from an automatic speech recognition (ASR) system or text.