Machine translation learning method, device, and program, and machine translation method, device, and program

The neural machine translation method addresses the challenge of simultaneous translation by adaptively determining translation timing using delay symbols and error losses, enhancing accuracy and reducing delay for language pairs with different word orders.

JP7570666B2Active Publication Date: 2024-10-22NARA INSTITUTE OF SCIENCE AND TECHNOLOGY
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
JP2020137677
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2020-08-17
Publication Date
2024-10-22
Estimated Expiration
2040-08-17

AI Technical Summary

Technical Problem

Conventional machine translation devices face challenges in simultaneous translation due to unclear sentence boundaries in spoken language, leading to inconsistencies and reduced translation accuracy when attempting to minimize delay time by dividing sentences into small chunks, and existing methods fail to adaptively adjust delay for language pairs with significantly different word orders.

Method used

A neural machine translation method that adaptively determines translation start timing by adding delay symbols to the output sequence, using an objective function with error losses to optimize translation accuracy and delay, incorporating Connectionist Temporal Classification (CTC) for uncertain output timing.

Benefits of technology

The method achieves improved translation accuracy while minimizing delay time, particularly for language pairs with different word orders, by adaptively controlling translation start timing and optimizing the translation model parameters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007570666000017
    Figure 0007570666000017
  • Figure 0007570666000018
    Figure 0007570666000018
  • Figure 0007570666000019
    Figure 0007570666000019
Patent Text Reader

Abstract

To provide a machine translation learning method which allows for control of a translation start timing taking into consideration a tradeoff between reduction in delay and improvement in translation accuracy, in machine translation for translating to a target language and outputting without waiting for input completion of an original language sentence.SOLUTION: A pair is input consisting of a symbol string obtained by dividing an original language sentence by tokenizing, and a symbol string obtained by dividing a target language sentence being a parallel translation of the original language sentence by tokenizing. Next, an input sequence is input, and a sequence is output that predicts a symbol of the target language forming a translation of the input sequence according to a translation model at a timing which allows for translation output, and further, a delay symbol for delaying an individual translation output of the input sequence is added to the prediction symbol on a target language side, so that a delay symbol is output into an output sequence at a timing not allowing for translation output. An objective function based on an error loss of a correct answer symbol string on a target language side of the input sequence and a prediction symbol string of the output sequence, and an error loss based on an output step number of the delay symbol, is calculated as optimization index, in order to update parameters of a learning unit.SELECTED DRAWING: Figure 5
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to neural machine translation technology that uses a computer to translate languages, and to simultaneous machine translation technology that analyzes natural language sentences in the order in which words appear and performs real-time translation of gradual input by analyzing the meaning of sentences that have been input partway through. [Background technology]

[0002] Simultaneous translation is a computer processing task that starts translating a sentence before the input of the sentence is finished. Simultaneous translation helps achieve the real-time speech understanding required for spoken language lectures and conversations, and can promote smooth communication. Conventional machine translation devices perform processing such that translation is not performed until the end of a sentence is input. However, in spoken language, sentence boundaries are often unclear, and inconsistencies in sentence identification are likely to occur when sentences are treated as unified processing units. Therefore, there are cases where a combination of multiple sentences or an incomplete sentence is given as input to a machine translation device. Conventional devices assume that input is given in sentence units up to the end of a sentence, and therefore translation is performed in an environment different from that during learning, resulting in a decrease in translation accuracy.

[0003] To address this problem, conventional machine translation devices have attempted to reduce the delay time until a translation result is obtained in simultaneous translation by dividing a sentence into small chunks and translating them (see, for example, Patent Document 1). However, conversely, the shorter the delay time, the more limited the in-sentence context that can be referenced during translation, resulting in a problem of reduced translation accuracy. Thus, while simultaneous translation requires low-delay translation of the content corresponding to the input, if real-time translation is attempted to reduce delay, the translation quality may be reduced due to a lack of context information. Therefore, in the processing task of simultaneous translation, it is necessary to control the timing of the start of translation while considering the trade-off between reducing delay time and improving translation accuracy, and when building a translation device, it is necessary to appropriately determine the timing of translation.

[0004] Several methods have been proposed as models of Neural Machine Translation (hereinafter, also referred to as NMT) to solve the above problems. Gu et al. have proposed a method in which two actions, READ, which inputs one word, and WRITE, which translates one word, are defined for an existing translation model, and a classifier that determines which action the model should take at each time step is trained by reinforcement learning (see Non-Patent Document 1). The method proposed by Gu et al. has succeeded in reducing delays while maintaining a certain level of translation accuracy, but there is a problem in that the translation device is not optimized for translating from partial information of a sentence.

[0005] Ma et al. have also proposed a very simple translation model called the “Wait-k” model. In the translation model proposed by Ma et al., a translation is always generated with a delay of k tokens from the input of the source language sentence (see Non-Patent Document 2). With a delay of only k tokens, a situation may occur in which the words necessary for translation have not yet been input, but even in such a case, the translation is forcibly predicted and generated. This method makes it possible to handle both the translation mechanism and the word prediction mechanism in an integrated manner, and it is possible to train them in a framework (end-to-end) in which the input to output is completed by a single model. Despite the very simple method, it has achieved high accuracy in simultaneous translation tasks from English to German and Chinese to English. Another advantage is that the size of the delay can be intuitively adjusted by changing k. However, this method cannot adaptively adjust the delay, and so in language pairs with significantly different word orders, such as English and Japanese, translation can fail when the length of a phrase is greater than k.

[0006] In addition, Katsumi Chosa et al. point out that delays tend to be particularly large when translating between language pairs with significantly different word orders, such as English and Japanese, and that it is difficult to reduce delays in simultaneous translation without sacrificing translation accuracy (see non-patent document 3). [Prior art documents] [Patent documents]

[0007] [Patent Document 1] JP 2016-71761 A [Non-patent literature]

[0008] [Non-Patent Document 1] Jiatao Gu et al., “Learning to Translate in Real-time with Neural Machine Translation, Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics”, Volume 1 (Long Papers), pp. 1053-1062 (2017). [Non-Patent Document 2] Mingbo Ma et al., “STACL: Simultaneous Translation with Implicit Anticipation and Controllable Latency using Prefix-to-Prefix Framework”, Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 3025-3036 (2019). [Non-Patent Document 3] Katsumi Chosa et al., "A Study on Neural Machine Translation for English-Japanese Simultaneous Interpretation," Proceedings of the 25th Annual Conference of the Association for Natural Language Processing, pp.462-465 (2019). Summary of the Invention [Problem to be solved by the invention]

[0009] As described above, there are two conventional techniques for determining the translation start timing in simultaneous translation: the reinforcement learning-based method described in Non-Patent Document 1 and the fixed-length delay-based method described in Non-Patent Document 2. However, in the method described in Non-Patent Document 1, although the timing of starting translation can be adaptively determined, the parameters of the machine translation model are learned without considering delay, so there is a problem that translation selection suitable for simultaneous machine translation that performs incremental processing cannot be performed. In addition, in the method described in Non-Patent Document 2, although the parameters of the machine translation model optimized for incremental processing based on a fixed-length delay can be learned, there is a problem that if the delay is set too excessively, translation will be excessively delayed, and if it is too small, the accuracy of translation selection will decrease. Furthermore, in Non-Patent Document 3, there is a problem that when the method described in Non-Patent Document 2 is applied to English-Japanese translation, the delay must be set large in order to suppress translation errors caused by differences in word order.

[0010] In view of this situation, the present invention has an object to provide a machine translation learning method, device, and program that is capable of determining a translation start timing that is adaptive to gradual input and that is capable of learning parameters of a machine translation model optimized for gradual processing, as well as a machine translation method, device, and program that enables control of the translation start timing taking into account the trade-off between reducing delay time and improving translation accuracy. [Means for solving the problem]

[0011] In order to solve the above problems, the machine translation learning method of the present invention is a method for learning a translation model in neural machine translation that translates a source language sentence into a target language and outputs the translated sentence without waiting for completion of input of the source language sentence, and includes the following steps 1a to 4a. Step 1a) A training sentence pair input step of inputting a pair of a symbol string divided by tokenizing a source language sentence and a symbol string divided by tokenizing a target language sentence that is a translation of the source language sentence. Here, a symbol string divided by tokenization refers to a symbol string that is obtained by converting a sentence into the smallest unit (token) of an input sentence or output sentence by syntactic analysis such as morphological analysis, and dividing the sentence into token units. A token may be a character, symbol, or word, or may be a character bigram in which any character string consists of only two characters. Step 2a) An output prediction step during learning, in which an input sequence based on a symbol string is input to a learning device including a translation model, and a sequence of predicted target language symbols that form the translation of the input sequence by the translation model is output at a timing when translation output is possible, and a delay symbol that delays each translation output of the input sequence is added to the predicted symbols on the target language side, and the delayed symbol is output into the output sequence at a timing when translation output is not possible. In the present invention, a new metatoken (delay symbol) is added to the predicted symbol on the target language side, and the translation model outputs the delay symbol at the timing when translation should not be performed, thereby adaptively determining the translation timing. By adaptively determining the translation timing, it is possible to improve the translation accuracy while maintaining a certain delay in the processing task of simultaneous translation in a language pair with a significantly different word order, such as Japanese and English.

[0012] Step 3a) An objective function calculation step using an objective function based on the first error loss, the second error loss, and the third error loss as an optimization index. Here, the first error loss is an error loss calculated by ignoring the delayed symbols in the comparison between the correct symbol string on the target language side of the input sequence and the predicted symbol string of the output sequence. The second error loss is an error loss calculated by integrating predicted symbol string hypotheses in which only the position or number of delayed symbols differ from the correct symbol string in the comparison between the correct symbol string on the target language side of the input sequence and the predicted symbol string of the output sequence. That is, in the case of the second error loss, as described in the embodiment described later, there are multiple predicted symbol strings in which only the position or number of delayed symbols differ from the correct symbol string, and each sequence is called a "hypothesis", so that the multiple sequences are called "predicted symbol string hypotheses", and the second error loss is calculated based on the sum of the individual probabilities of the predicted symbol string hypotheses. And the third error loss is an error loss based on the number of output steps of the delayed symbols. The objective function may be a simple sum of the first error loss, the second error loss, and the third error loss, or a weighted sum of the three error losses. Step 4a) A parameter updating step of updating parameters of a learning device including a translation model based on the calculated value of the objective function.

[0013] In the above-mentioned first error loss, if a delayed symbol is output while an input sequence is being input, the error of the delayed symbol is set to 0, and in the second error loss, the error loss is preferably calculated based on the probability of a correct answer taking into account all paths that can be searched for the output timing of the delayed symbol.

[0014] Also, the second one above error loss Specifically, the loss function of CTC (Connectionist Temporal Classification) is used to calculate the delay symbol output timing based on the sum of the probabilities of the correct path among all the paths that can be searched. error loss is calculated. To solve the problem of not having correct data on when the delayed symbols should be output, we introduce an algorithm called CTC as a loss function. CTC is an error function used for modeling sequences with indefinite output timing, such as phoneme prediction of spoken speech. By using this error function, it becomes possible to perform optimization for correct sequences that include delayed symbols.

[0015] Next, the machine translation learning device of the present invention will be described. The machine translation learning device of the present invention is a learning device for a translation model in neural machine translation that translates a source language sentence into a target language and outputs the translated sentence without waiting for completion of input of the source language sentence, and includes the following 1b to 4b. 1b) A training sentence pair input unit that inputs pairs of symbol strings divided by tokenizing a source language sentence and symbol strings divided by tokenizing a target language sentence that is a translation of the source language sentence. 2b) A learning output prediction unit that inputs an input sequence based on a symbol string to a learning device including a translation model, and outputs a sequence of predicted symbols in a target language that form the translation of the input sequence by the translation model at a timing when translation output is possible, and adds delay symbols that delay each translation output of the input sequence to the predicted symbols in the target language, and outputs the delayed symbols in the output sequence at a timing when translation output is not possible. 3b) An objective function calculation unit that uses, as an optimization index, an objective function based on a first error loss calculated by ignoring delayed symbols in a comparison between a correct symbol sequence on the target language side of the input sequence and a predicted symbol sequence of the output sequence, a second error loss calculated by integrating predicted symbol sequence hypotheses that differ from the correct symbol sequence only in the position or number of delayed symbols in a comparison between a correct symbol sequence on the target language side of the input sequence and the predicted symbol sequence of the output sequence, and a third error loss based on the number of output steps of delayed symbols. 4b) A parameter update unit that updates parameters of a learning device including a translation model based on the calculated value of the objective function.

[0016] The machine translation learning program of the present invention is a machine translation learning method of the present invention. Learning sentence pair input step and Output prediction step and objective function calculation step during training and parameter update step It is a program for causing a computer to execute the above.

[0017] Next, a machine translation method, a machine translation device, and a machine translation program according to the present invention will be described. The machine translation method of the present invention includes a model loading step of loading a learning device including a translation model trained using the above-described machine translation learning method of the present invention or the machine translation learning apparatus of the present invention, a translation target sentence input step of inputting a symbol string divided by tokenizing the translation target sentence, and an output prediction step of inputting an input sequence based on the symbol string to the loaded learning device, outputting a sequence of predicted symbols in a target language that translates the input sequence by the translation model at a timing when translation output is possible, and outputting a delayed symbol into the output sequence at a timing when translation output is not possible. Computer-generated .

[0018] The machine translation device of the present invention includes a model loading unit that loads a learning device including a translation model trained using the above-mentioned machine translation learning method of the present invention or the machine translation learning device of the present invention, a translation target sentence input unit that inputs a symbol string divided by tokenizing the translation target sentence, and an output prediction unit that inputs an input sequence based on the symbol string to the loaded learning device, outputs a sequence of predicted symbols in a target language that translates the input sequence by the translation model at a timing when translation output is possible, and outputs a delayed symbol into the output sequence when translation output is not possible.

[0019] The machine translation program of the present invention is a program for causing a computer to execute the output prediction step in the above-mentioned machine translation method of the present invention. Effect of the Invention

[0020] The machine translation learning method, device, and program of the present invention have the advantage that it is possible to determine a translation start timing that is adaptive to gradual input, and to learn parameters of a machine translation model that are optimized for gradual processing. Furthermore, the machine translation method, device, and program of the present invention have the advantage that the translation start timing can be controlled in consideration of the trade-off between reducing delay time and improving translation accuracy. [Brief description of the drawings]

[0021] [Figure 1] Schematic diagram of the encoder-decoder model in NMT [Diagram 2] Simultaneous translation model [Diagram 3] Illustration of the prior art “Wait-k” model (3 token delay case) [Figure 4] Diagram of RNN in the encoder-decoder model [Diagram 5] Learning process flow of the machine translation learning method and translation process flow of the machine translation method of the present invention [Figure 6] Functional block diagram of the machine translation learning device and machine translation device of the present invention. [Figure 7] Example 1 of input and output sequences in Japanese-English translation [Figure 8] Example 2 of input and output sequences in Japanese-English translation [Figure 9] FIG. 2 is an explanatory diagram of multiple predicted symbol sequences in the second error loss BEST MODE FOR CARRYING OUT THEINVENTION

[0022] First, we will explain simultaneous translation using a known translation model in NMT and the “Wait-k” model, which is a translation model proposed by Ma et al. in the above-mentioned Non-Patent Document 2, and then we will explain the machine translation training method and machine translation method of the present invention. NMT is a machine translation method that uses deep learning in a neural network. In NMT, the neural network automatically learns the features of a language, expresses the correspondence between the source language and the target language as a numerical vector, and performs machine translation using an encoder-decoder model. Figure 1 shows a schematic diagram of the encoder-decoder model. Note that Figure 1 also shows a decoder with an attention mechanism, which will be described later.

[0023] In NMT, a neural network learns the source language using bilingual data (bilingual corpus) that structures a large amount of translated text between two languages ​​(learning process), and after learning is completed, the trained neural network model translates the input source language sentence into the target language sentence (translation process) as described below. In the trained neural network model, the source language sentence is first tokenized by syntactic analysis such as morphological analysis, and then divided into an input sequence (symbol string). As shown in Figure 1, the encoder inputs the input sequence (symbol string), converts the symbol string into a distributed representation (a representation of the features of the source language sentence as a sequence of numbers), and converts it into a numerical vector to create a vector of the source language sentence. Both the encoder and the decoder are configured using a recurrent neural network (RNN), and the created vectors are processed by the RNN in the middle layer. In a decoder with an attention mechanism, the attention mechanism identifies which word (symbol) in the source sentence is being focused on when generating each word (symbol) in the translation of the source sentence, and predicts the part of the input sentence that should be translated next.The decoder sequentially generates a string of symbols in the target sentence based on the vector of the source sentence and the attention information, generates a vector of the target sentence, and outputs a variable-length output sequence (symbol string). In this specification, a source language sentence (input sequence) X and a target language sentence (output sequence) Y are defined as follows.

[0024]

number

[0025] where x i (i=1,2,3,...,I) is a one-hot vector (a vector representation in which only the i-th element is 1 and the other elements are 0) that represents the i-th input symbol of the source language sentence (input sequence), I is the length of the input sequence, and y j (j=1,2,3,...,J) is a one-hot vector (a vector expression in which only the j-th element is 1 and the other elements are 0) representing the j-th output prediction symbol of the target sentence (output sequence), and J represents the length of the output sequence. In this case, the problem of translating a source sentence into a target sentence can be solved by finding the target sentence that maximizes the conditional probability p(Y|X) for the sentence shown in Equation 1 below. In the example shown in Figure 2, the source language sentence (input sequence) is a symbol string of length 7 (time steps 1 to 7), and the target language sentence (output sequence) is a symbol string of length 8 (time steps 1 to 8). In the intermediate layer, predicted symbols of the output sequence at each time step are output based on the hidden state and past output sequences.

[0026]

number

[0027] The conditional probability p(Y|X) shown in the above formula 1 is the probability that the source sentence X and the target sentence y generated up to time step j <j From the word y j This conditional probability p(Y|X) is decomposed as the product of conditional probabilities for Y and X. In conventional NMT translation models, this conditional probability p(Y|X) is decomposed as in Equation 2 below, whereas in the "Wait-k" model, translation must be performed after only the symbols from the beginning of the sentence to the middle have been input, so it is decomposed as in Equation 3 below.

[0028]

number

[0029] where x <g(j) represents the input sequence input up to time step j. Also, g(j) represents the number of tokens being processed by the encoder when the decoder generates tokens up to time step j, and is defined as in Equation 4 below.

[0030]

number

[0031] In the above formula 4, k is a parameter that indicates that the generation of the target language sentence is delayed by k tokens from the input of the source language sentence, and in the "Wait-k" model, k is a fixed value. The "Wait-k" model is composed of an encoder and a decoder with an attention mechanism, both of which are constructed using a recurrent neural network (RNN). That is, as shown in Figure 3, when the "Wait-k" model (k=3) is used, the translation is output with a delay of 3 tokens. As shown in Figure 4, the encoder calculates the input symbol x in the input sequence of the source sentence X at time step t. t Then, through the intermediate layer RNN, the previous (i-1) hidden state vector h i-1 Based on this, the forward hidden state vector h i(1≦i≦I), and the decoder predicts the symbol y at time step t based on the hidden state and the past output sequence. t Output.

[0032]

number

[0033] In conventional NMT translation models, the hidden state vector for the reverse direction is calculated by inputting the input sentence in the same way, arranged in reverse order. However, in the task of simultaneous translation, sentences must be processed in a situation where the end of the sentence is not certain, so only the forward vector is used.

[0034] The decoder with attention mechanism generates the translation words one by one from the hidden state vector of the input sentence calculated by the encoder. The decoder's RNN layer self-recursively generates words from the hidden state and the past output sequence. The output word y j Generation probability p θ (y j |y <j ,x ≦g(j) ) are defined as the following formulas 6 to 8.

[0035]

number

[0036] Here, W S ,W c is a weight matrix, which is a parameter of the translation model to be trained. j is a context vector, and c j That is, as shown in the above formula 8, d is calculated based on the information of the previous (j-1th) decoder and the j-1th output sequence. j is calculated, and the context vector c j and d jThe jth attention vector is calculated by combining the jth attention vector and the jth attention vector. The softmax function is an activation function that converts the output into a probability by making the sum of the output values ​​1, and the hyperbolic tangent (tanh) function is an activation function that converts each input element of the vector into a number in the range of -1.0 to 1.0 and outputs it.

[0037] In the attention mechanism, each hidden state vector h i At time step j corresponding to ij Calculate the weight α ij is the decoder state d j T In the hidden state vector h i It also represents the importance of the context vector c j is expressed by the weight α ij and its hidden state vector h i It is calculated by calculating the weighted average of

[0038]

number

[0039] As mentioned above, the well-known translation model and the "Wait-k" model in NMT have been briefly explained, but an example of an embodiment of the present invention will be explained in detail below with reference to the drawings. Note that the scope of the present invention is not limited to the following examples and illustrated examples, and many modifications and variations are possible. Example 1

[0040] The machine translation learning method of the present invention is a method for learning a translation model so that translation into a target language and output can be performed without waiting for completion of input of a source language sentence. In the following explanation, a translation example from Japanese to English (source language sentence is Japanese, target language is English) is used. In the learning process, it is assumed that a learning sentence pair database (Japanese-English bilingual corpus) for learning is prepared in advance. A learning sentence pair in Japanese-English translation learning is a Japanese sentence and its corresponding English sentence, for example, a pair such as "President Bush meets with Putin" and "President Bush meets with Putin." The learning process of the machine translation learning method of the present invention and the translation process of the machine translation method are basically the same as those of the above-mentioned "Wait-k" model. However, whereas in the above-mentioned "Wait-k" model, the generation of a translated sentence is always delayed by k tokens from the input of the source language sentence (k is a fixed value), the present invention is characterized in that the number of steps and the position of the delay symbol that delays the translation output are not fixed. Hereinafter, embodiments of the learning process in the machine translation learning method of the present invention and the translation process in the machine translation method of the present invention will be described with reference to FIG.

[0041] The learning process flow in the machine translation learning method of the present invention includes a learning sentence pair input step, a learning output prediction step, an objective function calculation step, and a parameter update step, as shown in the left flow diagram of Figure 5. Each step will be described in detail below. <Step 1a: Learning sentence pair input step> In the training sentence pair input step, a pair of symbol strings split by tokenizing a source language sentence (Japanese) and a symbol string split by tokenizing a target language sentence (English) that is the translation of the source language sentence (Japanese) is input. In the case of the Japanese sentence "President Bush meets with Putin," the symbol strings split by tokenization are "Bush," "President," "is," "Putin," "with," "meet," and "do." On the other hand, in the case of the English sentence "President Bush meets with Putin," the symbol strings split by tokenization are "President," "Bush," "meets," "with," and "Putin."

[0042] <Step 2a: Learning output prediction step> In the learning output prediction step, first, an input sequence based on a symbol string is input to a learning device including a translation model. In the above example, the input sequence is input in the order of appearance of "Bush", "President", "is", "Putin", "with", "meet", and "do". Then, at the timing when the translation can be output, a sequence predicting the symbols in the target language (English words) that are the translation of the input sequence by the translation model is output. If the input sequence is input to the end, the translation should be output correctly, but in order to reduce the delay time until the translation is output, it is preferable to output the translation as early as possible. However, if the translation is output too early, the translation may not be output correctly. In the above example, the input sequence includes "Bush", "President", "is", "Putin", "with", "meet", and "do", which are input in the order of appearance. If the translation is output as "Bush" when "Bush" is input, the translation will be "Bush President" when "President" is input next, and the translation will not be output correctly. Also, if the translation is output when "Bush", "President", "is", and "Putin" are input, the translation will be "President Bush is Putin", and the translation will not be output correctly.

[0043] Therefore, delay symbols (special symbols) that delay each translation output of the input sequence are added to the predicted symbols on the target language (English) side, and in the training output prediction step, the delay symbols are output in the output sequence at a timing when translation output is not possible. Here, the delay symbols added to the vocabulary on the target language (English) side are used as meta-tokens. <wait>In the learning output prediction step, when the information required for translation is insufficient and translation is not possible, the translation model <wait>By outputting the delayed symbol, the translation timing is adaptively determined by waiting for additional input. <wait>Then it waits for the next input in the input sequence and outputs the translation.

[0044] In Fig. 7, the input sequence is "Bush", "President", "Putin", "meet", and "will" in the order of appearance. When "Bush" and "President" are input, the translation model <wait>The model outputs "President" twice, and then when the next input "は" is input, it outputs the translation of "President". After that, when "Putin" is input, it outputs "Bush". Then, when "と" is input, the model outputs "President" twice. <wait>By outputting, wait for additional input. Further, then, at the timing when "会谈 (meeting)" is input, output "meets", at the timing when "する (do)" is input, output "with", and when the input of the input series ends, finally output "Putin".

[0045] As shown in Figure 8, at the timing when the first "ブッシュ (Bush)" of the input series is input, since it is still unknown whether "ブッシュ (Bush)" is the subject, there is insufficient information required for translation, and it is a timing when translation cannot be performed. Therefore, the translation model <wait>And even when "President" is input, it is still unclear whether "President Bush" is the subject, so the translation model <wait>In addition, when "と" is input, the verb is unknown and cannot be translated. <wait>Output.

[0046] <Step 3a: Objective function calculation step> In the objective function calculation step, an objective function based on the first error loss, the second error loss, and the third error loss is used as an optimization index to perform optimization calculation. The first to third types of error losses are mixed to form an objective function, which is then minimized. First, the first error loss is an error loss calculated by ignoring delayed symbols in the comparison between the correct symbol string in the target language of the input string and the predicted symbol string in the output string, and is similar to that used in known machine translation. Calculating the error loss by ignoring delayed symbols means, for example, that the translation model does not include the delayed symbols. <wait>As shown in Figure 8, the output sequence is <wait> <wait>President Bush <wait>meets with Putin, the three delay symbols <wait>The error loss based on the above is set to 0 (zero), and the error loss with the correct symbol string is calculated. In other words, it is the same as assuming that "President Bush meets with Putin" is translated and output as the predicted symbol string for the output sequence, and comparing it with the correct symbol string to calculate the error loss. A specific error function for calculating the first error loss can be Softmax Cross-Entropy (SCE). SCE is an error function commonly used for multi-class classification problems such as machine translation, and is defined as the following Equation 11.

[0047]

number

[0048] where y jk represents the k-th element of the 1-hot vector corresponding to the j-th word in the target language sentence (English), and p(y jk |·) is y jk When using SCE as the error function, a correct answer sequence that can be one-to-one matched with the output sequence is required. <wait>Since it is not clear when the <wait>At time step t (t ≦ g(I)) where g(I) can be output, that is, while the source language sentence is being input <wait>If this is output, the error for the token is set to 0, and the error loss with respect to the correct symbol string is calculated.

[0049] Next, the second error loss will be described. The second error loss is an error loss calculated by integrating predicted symbol sequence hypotheses that differ from the correct symbol sequence only in the position or number of delayed symbols in a comparison between the correct symbol sequence on the target language side of the input sequence and the predicted symbol sequence of the output sequence. In the predicted symbol sequence of the output sequence, the delayed symbol <wait>The position and number of do not affect the translation result. <wait>Although multiple output sequences with different positions and numbers of delay symbols are shown, the translation result is "President Bush meets with Putin" in all cases, and they do not affect the translation result. If "President Bush meets with Putin" is the correct symbol string, <wait>There are many other sequences that can be output at different positions and times than those shown in Figure 9. In the case with the highest number of times, the input sequence "Bush", "President", "is translated and output after the seven steps of "Putin", "meet", and "have" are completed. <wait> <wait> <wait> <wait> <wait> <wait> <wait>President Bush meets with Putin, <wait>is output seven times at time steps 1 to 7. In the output sequence shown in FIG. 9, for output sequence 1, <wait>is output twice at time steps 1 and 2, and for output sequence 2, <wait>is output three times at time steps 1, 2, and 5, and output sequence 3 is <wait>is output three times at time steps 1, 2, and 4, and output sequence 4 is <wait>is output three times at time steps 1, 3, and 5, and output sequence 5 is <wait>is output four times at time steps 1, 3, 5, and 6, and the output sequence is 6. <wait>is output three times at time steps 1, 2, and 3. There are many other sequences besides output sequences 1 to 6, but these output sequences are predicted symbol sequence hypotheses, and the second error loss is calculated based on the sum of the individual probabilities of the predicted symbol sequence hypotheses.

[0050] In the first error loss mentioned above, the SCE is used as the error function. <wait>The error loss based on the above is set to 0 (zero) and the error loss with the correct symbol string is calculated. <wait>The correct timing for translating is unclear, <wait>There is a problem that no learning is done for the generation of the correct symbol string. <wait>We list all the possibilities where only the position or number of occurrences differ, and calculate the error loss based on the sum of their probabilities. This allows us to optimize the translation model training by balancing delay and accuracy.

[0051] The specific error function for calculating the second error loss can be trained on a sequence-by-sequence basis using "Connectionist Temporal Classification" (CTC). The loss function for CTC is <wait>By inserting tokens such as <wait>By eliminating -1 (y) is restored. The loss function of CTC is defined as the sum of the probabilities of all paths of π∈Ω(y) as shown in the following formula 12, and is calculated by the forward-backward algorithm. In the following formula 12, π t is the output at time step t of π.

[0052]

number

[0053] Next, the third error loss is the delay symbol <wait>is the error loss based on the number of output steps. <wait>The more output steps there are, the larger the error loss becomes. <wait>The smaller the number of output steps, the smaller the error loss. The third error loss is to directly adjust the delay size, <wait>Calculation is performed only when the following is output. Specifically, the calculation shown in the following formulas 13 and 14 is performed.

[0054]

number

[0055] The three error functions described above were combined to obtain the error function of the following formula 15 for optimization. Here, α is a hyperparameter for adjusting the magnitude of the penalty for delay. Note that the weights of the first and second error losses may also be adjusted.

[0056]

number

[0057] <Step 4a: Parameter update step> An optimization calculation is performed using an objective function (formula 15) based on the above-mentioned first error loss, second error loss, and third error loss as an optimization index, and the parameters of the learning device including the translation model are updated based on the calculated value.

[0058] Next, the translation process flow of the machine translation method of the present invention will be described. As shown in the flow diagram on the right of Fig. 5, the machine translation method of the present invention comprises a model reading step, a translation target sentence input step, an output prediction step, and a translation output step. The model reading step is for reading setting parameters of a learning device including a trained translation model, and the translation target sentence input step is for inputting an input sequence to be translated from a file, a standard input device, or a network. The output prediction step is the same as the learning-time output prediction step in the machine translation learning method of the present invention described above. The translation output step is for outputting an output sequence of a translation sentence from a predicted symbol.

[0059] Moreover, embodiments of a learning function block in the machine translation learning device of the present invention and a translation function block in the machine translation device of the present invention will be described with reference to FIG. The machine translation learning device is composed of a training sentence pair input unit, a model initialization unit, a model learning unit, and a model writing unit. The model learning unit is composed of a training output prediction unit, an objective function calculation unit, and a parameter update unit. The training sentence pair input unit, the training output prediction unit, the objective function calculation unit, and the parameter update unit each have the function of performing the same processing as the training sentence pair input step, the training output prediction step, the objective function calculation step, and the parameter update step in the machine translation learning method of the present invention. The model initialization unit has a function of initializing the parameters of the translation model, and reads the model setting value file and run-time parameters from a storage device such as a memory or a disk. The model writing unit writes out model parameters such as a weight matrix learned by the model learning unit to a storage device such as a memory or a disk. On the other hand, a machine translation device is composed of a model loading unit, a translation target sentence input unit, an output prediction unit, and a translation output unit. The model loading unit, the translation target sentence input unit, the output prediction unit, and the translation output unit each have the same functions as the model loading step, the translation target sentence input step, the output prediction step, and the translation output step in the machine translation method of the present invention, respectively.

[0060] (Translation accuracy test results) In order to evaluate the machine translation learning method and the machine translation method of the present invention, an experiment was conducted on automatic simultaneous translation from English to Japanese, the results of which will be described below. In the machine translation learning method, the translation model was implemented using PyTorch, an open source machine learning library for Python (a general-purpose programming language for artificial intelligence). The encoder and decoder RNNs were each a two-layer unidirectional LSTM (Long short-term memory), and input feeding was performed. The number of dimensions of the word embedding vector and hidden state vector was 512, and the mini-batch size was 64. Adam was used as the optimization algorithm, with a learning rate of 10 -3 Training was performed with gradient clipping set to 50. The dropout probability p was set to 0.3, and the learning rate was attenuated by multiplying it by 1 / √2 only when the validation loss on the test data did not decrease each epoch.

[0061] In addition, the model with the smallest validation loss was used for the test. In conducting experiments on the simultaneous translation task from English to Japanese, we conducted two experiments using two corpora: "small_parallel_enja" (hereafter referred to as "Corpus A"; see "https: / / github.com / odashi / small_parallel_enja" for details), a Japanese-English parallel corpus for machine translation consisting of relatively short sentences, and "ASPEC (Asian Scientific Paper Excerpt Corpus)" (hereafter referred to as "Corpus B"; see "Toshiaki Nakazawa et al., "Aspec: Asian scientific paper excerpt corpus. In Proceedings of LREC 2016, pp.2204-2208, Portoro, Slovenia, 2016.5" for details). Corpus A is a small corpus consisting of sentences from general domains with 4 to 16 words. Corpus B is a medium-sized corpus that is composed of complex sentences that are relatively long and contain a lot of technical terminology.

[0062] Table 1 below shows detailed information about each corpus. The input unit for English and Japanese was a subword, and the input sequence was tokenized using Sentencepiece (for details, see "https: / / github.com / google / sentencepiece"). Separate vocabularies were prepared for the source and target languages, with vocabulary sizes set to 4,000 for corpus A and 8,000 for corpus B. Furthermore, any bilingual pairs with sentence lengths exceeding 60 tokens or sentence length ratios exceeding 9 were deleted from the training data.

[0063] [Table 1]

[0064] As a baseline, we used full sentence translation using an encoder-decoder model with an attention mechanism using unidirectional LSTM and the "Wait-k" model. In addition, we used BLEU (Bilingual Evaluation Understudy) and RIBES (Rank-based Intuitive Bilingual Evaluation Score), which are commonly used as automatic evaluation measures for machine translation, as evaluation measures of translation accuracy. For tokenization during evaluation, we used the morphological analysis tool kytea (for details, see "https: / / www.aclweb.org / anthology / P11-2093 / ").

[0065] (Regarding Experiment 1) In experiment 1, corpus A was used to confirm the model's performance with relatively short sentences, and three types of translation performance were compared: a method of translating one sentence at a time (Comparative Example 1), a method of translating using a "Wait-k" model (Comparative Example 2), and the machine translation method of the present invention (Example 1). The number of delayed tokens k in the "Wait-k" model in Comparative Example 2 was set to k=3 and k=5. In Example 1 (the machine translation method of the present invention), the hyperparameter α shown in the above formula 15 was set to α={0, 0.01, 0.03, 0.05}. Since a large α increases the penalty for delay and is expected to reduce translation quality, a comparison was made with no penalty for delay (α=0) and with three types of penalty settings. The evaluation results of the automatic evaluation scale and the magnitude of delay in this experiment 1 are shown in Table 2 below. In Table 2, the delay is expressed as the average and standard deviation of the number of tokens (shown in parentheses).

[0066] [Table 2]

[0067] Assuming that the full sentence score is the upper bound of the evaluation that the model can take, it can be seen that Example 1 (the machine translation method of the present invention) can achieve a small delay with almost the same performance. In addition, when Example 1 (the machine translation method of the present invention) is compared with Comparative Example 2 (the "Wait-k" model) with the same average delay, it can be seen that the accuracy is slightly decreased or the same accuracy is obtained. That is, when Comparative Example 2 (k=3) is compared with Example 1 (α=0.03), the delay time is about the same, and the BLEU and RIBES values ​​of Example 1 are slightly less accurate than those of Comparative Example 2, and when Comparative Example 2 (k=5) is compared with Example 1 (α=0.01), the delay time is about the same, and the BLEU and RIBES values ​​are about the same accuracy. This decrease in accuracy is presumed to be due to the fact that the delay in the "Wait-k" model of Comparative Example 2 is fixed and the variance is 0, whereas Example 1 (the machine translation method of the present invention) can adaptively determine the translation timing, which causes delay variance and reduces the translation accuracy in sentences with small delay.

[0068] (Regarding Experiment 2) In experiment 2, corpus B was used to confirm the model's performance in a situation where a sentence is long and one phrase is very long, and three types of translation performance were compared: a method of translating one sentence at a time (comparative example 3), a method of translating using a "Wait-k" model (comparative example 4), and the machine translation method of the present invention (embodiment 2). The number of delayed tokens k in the "Wait-k" model in comparative example 4 was set to k=5 and k=7. The hyperparameter α in embodiment 2 (machine translation method of the present invention) was set to α={0.03, 0.05, 0.1}. The evaluation results of experiment 2 based on the automatic evaluation scale and the magnitude of delay are shown in Table 3 below. In Table 3, the delay is expressed as the average and standard deviation of the number of tokens (shown in parentheses).

[0069] [Table 3]

[0070] From the results of Experiment 2, it can be seen that the delay in Example 2 (the machine translation method of the present invention) is much larger than that in Comparative Example 4 (the "Wait-k" model). It is presumed that this is because the domain of Corpus B (ASPEC) is scientific and technical papers, and the data contains many long phrases. When translating long phrases such as noun phrases, it is often necessary to input the entire phrase, but in Comparative Example 4 (the "Wait-k" model), the magnitude of the delay is fixed (k is a fixed value), so the delay can be kept small by forcibly translating by making predictions, etc. In contrast, in Example 2 (the machine translation method of the present invention), it is also possible to search for paths that cause delays until the entire phrase is input by CTC, and as a result, <wait>We speculate that this is causing the delay to increase because messages such as these are more likely to be output.

[0071] From the above experimental results, it can be seen that the machine translation method of the present invention tends to have a large delay for long sentences, but it is possible to adaptively determine the translation timing, and a certain level of translation accuracy can be achieved with a smaller delay than inputting the entire sentence. Table 4 below shows an example of the translation results in Experiment 1.

[0072] [Table 4]

[0073] From the example of the translation result in Experiment 1 shown in Table 4 above, it can be seen that in the embodiment (machine translation method of the present invention), the translation was correct by adaptively determining the translation timing. In this example, the word "swimming" input at the end of the source language sentence is translated as the word "swimming" at a very early stage in the reference translation. In the comparative example ("Wait-k" model), the magnitude of the delay is fixed (k=3), so when the range of word order changes as in this example exceeds k, it is not possible to translate properly, and it is possible that an incorrect translation is output. In contrast, in the embodiment (machine translation method of the present invention), until "swimming" is input, <wait>By outputting this and adjusting the translation timing, the word "swim" can be translated.

[0074] On the other hand, the translation result of the machine translation method (embodiment) of the present invention includes the following sentences: <wait>In this example, even though some translation should be possible at the latest when the period is input, <wait>We speculate that this occurs because in language pairs with significantly different word orders such as English and Japanese, translating from the full sentence and reducing the error in SCE or CTC can result in a smaller error in the overall error function than the penalty for outputting a delay.

[0075] [Table 5]

[0076] In particular, the corpora currently used for training and evaluation are those used for general machine translation tasks and are not optimized for simultaneous translation. Therefore, this problem could be alleviated by using reference translations, such as those produced by human simultaneous interpreters, as training data, which do not differ significantly from the word order of the source language sentences.

[0077] As described above, it has been found that the machine translation method of the present invention is capable of adaptively determining the translation timing, and can achieve a certain level of translation accuracy with a very small delay for relatively short sentences. [Industrial Applicability]

[0078] The present invention is useful in a simultaneous machine translator that translates input in real time.< / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait> < / wait>

Claims

1. A method for learning a translation model in neural machine translation that translates a source language sentence into a target language and outputs the translated sentence without waiting for completion of input of the source language sentence, comprising the steps of: a learning sentence pair input step of inputting pairs of symbol strings divided by tokenizing a source language sentence and symbol strings divided by tokenizing a target language sentence which is a translation of the source language sentence; an output prediction step during learning, in which an input sequence based on the symbol string is input to a learning device including the translation model, and a sequence of predicted target language symbols forming the translation of the input sequence by the translation model is output at a timing when translation output is possible, a delay symbol that delays each translation output of the input sequence is added to the predicted symbols on the target language side, and the delayed symbol is output into an output sequence at a timing when translation output is not possible; an objective function calculation step using, as an optimization index, an objective function based on a first error loss calculated by ignoring the delayed symbols in a comparison between a correct symbol string on the target language side of the input sequence and a predicted symbol string of the output sequence, a second error loss calculated by integrating predicted symbol string hypotheses that differ from the correct symbol string only in the position or number of delayed symbols in a comparison between a correct symbol string on the target language side of the input sequence and the predicted symbol string of the output sequence, and a third error loss based on the number of output steps of the delayed symbols; a parameter updating step of updating parameters of a learning device including the translation model based on the calculated value of the objective function; A machine translation learning method comprising:

2. In the first error loss, if the delayed symbol is output while the input sequence is being input, the error of the delayed symbol is set to 0; 2. The machine translation training method according to claim 1, wherein the second error loss is calculated based on a probability of a correct answer taking into account all possible paths for the output timing of the delayed symbol.

3. 3. The machine translation training method according to claim 1, wherein the second error loss is calculated using a Connectionist Temporal Classification (CTC) loss function based on the sum of the probabilities of paths that are correct among paths that can be searched for the output timing of the delayed symbol.

4. A learning device for a translation model in neural machine translation that translates a source language sentence into a target language and outputs the translated sentence without waiting for completion of input of the source language sentence, comprising: a learning sentence pair input unit for inputting pairs of symbol strings divided by tokenizing a source language sentence and symbol strings divided by tokenizing a target language sentence which is a translation of the source language sentence; an output prediction unit during learning that inputs an input sequence based on the symbol string to a learning device including the translation model, and outputs a sequence of predicted symbols in a target language that constitute the translation of the input sequence by the translation model at a timing when translation output is possible, and adds a delay symbol that delays each translation output of the input sequence to the predicted symbols on the target language side, and outputs the delayed symbol into an output sequence at a timing when translation output is not possible; an objective function calculation unit that uses, as an optimization index, an objective function based on a first error loss calculated by ignoring the delayed symbols in a comparison between a correct symbol sequence on the target language side of the input sequence and a predicted symbol sequence of the output sequence, a second error loss calculated by integrating predicted symbol sequence hypotheses that differ from the correct symbol sequence only in the position or number of delayed symbols in a comparison between a correct symbol sequence on the target language side of the input sequence and the predicted symbol sequence of the output sequence, and a third error loss based on the number of output steps of the delayed symbols; a parameter update unit that updates parameters of a learning device including the translation model based on the calculated value of the objective function; A machine translation learning device comprising:

5. A machine translation learning program for causing a computer to execute the training sentence pair input step, the training output prediction step, the objective function calculation step, and the parameter update step in the machine translation learning method according to any one of claims 1 to 3.

6. A model reading step of reading a learning device including the translation model trained using the machine translation training method according to any one of claims 1 to 3 or the machine translation training device according to claim 4; A translation target sentence input step of inputting a symbol string divided by tokenizing the translation target sentence; an output prediction step of inputting an input sequence based on the symbol string to the loaded learning device, outputting a sequence of predicted symbols in a target language that are translated from the input sequence by the translation model at a timing when translation output is possible, and outputting the delayed symbols into an output sequence at a timing when translation output is not possible; A machine translation method comprising the steps of:

7. A model reading unit that reads a learning device including the translation model trained using the machine translation training method of any one of claims 1 to 3 or the machine translation training device of claim 4; a translation target sentence input unit for inputting a symbol string divided by tokenizing a translation target sentence; an output prediction unit that inputs an input sequence based on the symbol string to the loaded learning device, and outputs a sequence of predicted symbols in a target language that are translated from the input sequence by the translation model at a timing when translation output is possible, and outputs the delayed symbols into an output sequence at a timing when translation output is not possible; A machine translation device comprising:

Citation Information

Patent Citations

  • Machine translation device, method, and program

    JP2016071761A

  • Conversion processor, transliteration processor, and program

    JP2018028848A

  • Systems and methods for simultaneous translation with integrated anticipation and controllable latency (STACL)

    US20200104371A1