Machine translation method and device
By combining the first model and the second model, and using back-translation probability and context information for translation correction, the problem of errors and lack of naturalness in machine translation results is solved, and higher translation accuracy and naturalness are achieved.
Patent Information
- Application Number
- CN201810745435.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2017-11-23
- Filing Date
- 2018-07-09
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2038-07-09
AI Technical Summary
Errors in machine translation results make it difficult for users to understand, and it is difficult for existing technology to ensure the accuracy and naturalness of translation results.
Using a method that combines the first model and the second model, the translation results are corrected through back-translation probability and contextual information, and the translation accuracy is gradually improved. Specific steps include using the first model to translate the source sentence, using the second model to determine the back-translation probability, and applying the back-translation probability to the context information to re-translate the source sentence until a predetermined accuracy condition is met.
The accuracy and naturalness of the translation results are significantly improved, ensuring the full accuracy of the translation results and reducing the possibility of user misunderstandings.
Smart Images

Figure CN109829170B_ABST
Abstract
Description
[0001] This application claims the benefit of Korean Patent Application No. 10-2017-0157285, filed on November 23, 2017, in the Korean Intellectual Property Office, the disclosure of which is incorporated herein in its entirety for all purposes by reference. Technical Field
[0002] The following description relates to a machine translation method and apparatus. Background Art
[0003] A user may use machine translation to translate sentences, paragraphs, phrases or words expressed in a language different from the user's native language. However, when errors occur as a result of machine translation, the user may not be able to easily and correctly understand the result of the machine translation. Therefore, correctly translating a sentence in another language may be important. Summary of the invention
[0004] This Summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used as an aid in determining the scope of the claimed subject matter.
[0005] In one general aspect, a machine translation method includes: translating a source sentence using a first model; determining a back-translation probability that a translation result of the source sentence is translated back into the source sentence using a second model; applying the back-translation probability to context information extracted from the source sentence in the first model; and re-translating the source sentence based on the first model and the context information to which the back-translation probability is applied.
[0006] The back-translation probability may be determined for each of a plurality of words included in the source sentence.
[0007] The step of applying the back-translation probability to the context information may include applying a greater weight to the context information for a word having a lower back-translation probability among a plurality of words included in the source sentence.
[0008] The step of applying the back-translation probability to the context information may include applying a weight to the context information for each of a plurality of words included in the source sentence, wherein the weight is determined based on the back-translation probability of the corresponding word included in the translation result and position information of the corresponding word in the translation result.
[0009] The step of applying the back-translation probability to the context information may include applying a greater weight to the context information used to translate a word having a lower back-translation probability among a plurality of words included in the source sentence using the first model.
[0010] The machine translation method implemented by the processor may also include: determining whether the final translation result of the source sentence needs to be corrected; in response to the determination that the final translation result of the source sentence needs to be corrected, applying a back-translation probability that the final translation result is back-translated into the source sentence to context information, and re-translating the source sentence using the first model and the context information to which the back-translation probability is applied.
[0011] The step of determining whether the final translation result needs to be corrected may include determining whether the final translation result needs to be corrected based on a difference between the final translation result of the source sentence and a previous translation result of the source sentence.
[0012] The step of applying the back-translation probability to the context information may include: providing a back-translation probability for each of a plurality of words included in the source sentence to a user; receiving a user input from the user for changing a weight for a word among the plurality of words included in the source sentence; and applying the changed weight for the word to the context information in response to the received user input.
[0013] The translation result may include a plurality of target sentences obtained by translating the source sentence using the first model, and determining the back-translation probability may include determining an average of respective probabilities that the plurality of target sentences are back-translated into the source sentence as the back-translation probability.
[0014] The first model and the second model may be trained to maximize an expected reward, wherein the expected reward increases as the number of times the source sentence is re-translated decreases.
[0015] The first model and the second model may be trained to maximize an expected reward, wherein the expected reward increases as the number of times the source sentence is re-translated decreases and as the naturalness of the translation result in the target language increases.
[0016] The first model may be configured to generate a translation result expressed in a target language from a source sentence expressed in a source language, and the second model may be configured to generate a back-translation probability that the translation result expressed in the target language is back-translated into the source sentence expressed in the source language.
[0017] In another general aspect, a non-transitory computer-readable medium stores instructions that, when executed by a processor, cause the processor to perform the processor-implemented machine translation method described above.
[0018] In another general aspect, a machine translation device includes: a processor and a memory storing at least one instruction executed by the processor. In response to the instruction being executed, the processor executing the at least one instruction configures the processor to: translate a source sentence using a first model; determine a back-translation probability that a translation result of the source sentence is back-translated into the source sentence using a second model; apply the back-translation probability to context information extracted from the source sentence in the first model; and re-translate the source sentence using the first model and the context information to which the back-translation probability is applied.
[0019] The processor may be further configured to determine a back-translation probability for each of a plurality of words included in the source sentence.
[0020] The processor may be further configured to apply a greater weight to the context information for a word having a lower back-translation probability among a plurality of words included in the source sentence.
[0021] The processor may be further configured to apply a weight to context information for each of a plurality of words included in the source sentence, wherein the weight is determined based on a back-translation probability of the corresponding word included in the translation result and position information of the corresponding word in the translation result.
[0022] The processor may be further configured to, for a word having a lower back-translation probability among a plurality of words included in the source sentence, apply a greater weight to context information used to translate the word using the first model.
[0023] The processor may also be configured to: determine whether the last translation result of the source sentence needs to be corrected; in response to determining that the last translation result needs to be corrected, apply a back-translation probability that the last translation result is back-translated into the source sentence to the context information, and re-translate the source sentence using the first model and the context information to which the back-translation probability is applied.
[0024] The processor may also be configured to: provide a back-translation probability for each of a plurality of words included in a source sentence to a user; receive a user input from a user for changing a weight for a word among the plurality of words included in the source sentence; and apply the changed weight for the word to the context information in response to the received user input.
[0025] In another general aspect, a machine translation method includes: using a first model to translate a source sentence based on context information of the multiple words of a source sentence including multiple words to obtain a target sentence; using a second model to determine a back-translation probability that the target sentence is back-translated into the source sentence; applying the back-translation probability to the context information to obtain modified context information; and using the first model to re-translate the source sentence based on the modified context information to obtain an updated target sentence.
[0026] The target sentence may include multiple words, and the step of determining the back-translation probability may include: for each word of the multiple words of the source sentence, determining the back-translation probability that the corresponding word of the target sentence is back-translated into the word of the source sentence, and the step of applying the back-translation probability may include: applying the inverse of the back-translation probability determined for each word of the multiple words of the source sentence to the context information to obtain modified context information.
[0027] The target sentence may include multiple words, and the step of determining the back-translation probability includes: for each word of the multiple words of the source sentence, determining the back-translation probability that the corresponding word of the target sentence is back-translated into the word of the source sentence, and the step of applying the back-translation probability may include: for each word of the multiple words of the source sentence, applying the back-translation probability determined for the word of the source sentence and the position information of the corresponding word of the target sentence to the context information to obtain modified context information.
[0028] The step of translating the source sentence may include: using a first model to translate the source sentence based on context information to obtain a first target sentence and a second target sentence different from the first target sentence, the step of determining the back-translation probability may include: using a second model to determine a first back-translation probability that the first target sentence is back-translated into the source sentence; using the second model to determine a second back-translation probability that the second target sentence is back-translated into the source sentence, and the step of applying the back-translation probability may include: applying an average of the first back-translation probability and the second back-translation probability to the context information to obtain modified context information.
[0029] The processor-implemented machine translation method may further include: determining whether a difference between an updated target sentence and a source sentence satisfies a predetermined condition, wherein the predetermined condition indicates that the updated target sentence is a sufficiently accurate translation of the source sentence; in response to the difference not satisfying the predetermined condition, repeating the steps of determining a back-translation probability, applying the back-translation probability, re-translating the source sentence, and determining whether the difference satisfies the predetermined condition until the difference satisfies the predetermined condition; in response to the difference satisfying the predetermined condition, outputting the updated target sentence as a final translation result of translating the source sentence.
[0030] Other features and aspects will be apparent from the following detailed description, drawings, and claims. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 is a flowchart showing an example of the overall operation of the machine translation apparatus.
[0032] Figure 2 is a diagram illustrating an example of the operation of a neural machine translation (NMT) model.
[0033] Figure 3: is a diagram showing an example of a first model and a second model used in a machine translation apparatus.
[0034] Figures 4 to 6 is a diagram illustrating an example of the operation of a machine translation apparatus.
[0035] Figure 7 is a diagram illustrating an example of a user interface.
[0036] Figure 8 is a diagram showing an example of how the first model and the second model are trained.
[0037] Fig. 9 is a flow chart illustrating an example of a machine translation method.
[0038] Fig.10 is a diagram illustrating an example of a machine translation apparatus.
[0039] Throughout the drawings and detailed description, the same reference numerals represent the same elements. The drawings may not be to scale, and the relative size, proportions, and depiction of elements in the drawings may be exaggerated for clarity, illustration, and convenience. DETAILED DESCRIPTION
[0040] The following detailed description is provided to help the reader obtain a comprehensive understanding of the methods, devices and / or systems described herein. However, various changes, modifications and equivalents of the methods, devices and / or systems described herein will be clear after understanding the disclosure of the present application. For example, the order of operations described herein is only an example, and the order of operations is not limited to the order set forth herein, but can be changed as will be clear after understanding the disclosure of the present application, except for operations that must occur in a specific order. In addition, for greater clarity and simplicity, the description of features known in the art may be omitted.
[0041] The features described herein can be implemented in different forms and should not be interpreted as being limited to the examples described herein. Instead, the examples described herein are provided only to illustrate some of the many possible ways that will be clear after understanding the disclosure of the present application to implement the methods, devices and / or systems described herein.
[0042] Although terms such as "first," "second," and "third" may be used herein to describe various members, components, regions, layers, or portions, these members, components, regions, layers, or portions are not limited by these terms. Instead, these terms are used only to distinguish one member, component, region, layer, or portion from another member, component, region, layer, or portion. Therefore, without departing from the teachings of the examples described herein, a first member, component, region, layer, or portion referred to may also be referred to as a second member, component, region, layer, or portion.
[0043] Throughout the specification, when a component is described as being “connected to” or “coupled to” another component, the component may be directly “connected to” or “coupled to” the other component, or one or more other components may exist between them. Conversely, when an element is described as being “directly connected to” or “directly coupled to” another element, no other elements may exist between them. Similarly, similar expressions such as “between” and “directly between” and “adjacent to” and “directly adjacent to” are also to be interpreted in the same manner.
[0044] As used herein, the term "and / or" includes any one of the associated listed items or any combination of any two or more of the associated listed items.
[0045] The terms used herein are only for describing various examples and are not used to limit the present disclosure. Unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. The terms "comprise", "include" and "have" specify the presence of the described features, quantities, operations, components, elements and / or combinations thereof, but do not exclude the presence or addition of one or more other features, quantities, operations, components, elements and / or combinations thereof.
[0046] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those commonly understood by ordinary technicians in the field to which the present disclosure belongs, based on the understanding of the disclosure of the present application. Unless explicitly defined as such herein, terms (such as those defined in general dictionaries) will be interpreted as having the same meaning as they have in the context of the relevant field and the disclosure of the present application, and will not be interpreted as idealized or overly formal meanings.
[0047] Figure 1 is a flowchart showing an example of the overall operation of the machine translation apparatus.
[0048] The machine translation device described herein translates a source sentence into a target sentence. The machine translation device uses a neural machine translation (NMT) model. The NMT model encodes the source sentence and generates the target sentence by decoding. Figure 2 Describe the detailed operation of the NMT model.
[0049] Reference Figure 1 In operation 110, the machine translation device generates a target sentence through normal NMT decoding. Normal NMT decoding of the encoded source sentence is a decoding process of an NMT model in which other parameters are not applied to weights or context information used in the translation process. The target sentence generated in operation 110 is an initial translation result.
[0050] In operation 120, the machine translation device determines whether the generated target sentence needs to be corrected. The machine translation device uses the previously generated target sentence to determine whether the target sentence needs to be corrected. However, when the current target sentence is an initial translation result and there is no previous target sentence, the machine translation device determines that the current target sentence needs to be corrected.
[0051] In operation 130, the machine translation apparatus regenerates the target sentence through reward-aware NMT decoding. The machine translation apparatus may determine a back-translation probability that the target sentence is back-translated into a source sentence, apply the determined back-translation probability to context information extracted from the source sentence, and regenerate the target sentence from the source sentence using the context information to which the back-translation probability is applied. Reward-aware NMT decoding is a decoding process of an NMT model using context information to which the back-translation probability is applied.
[0052] The machine translation device re-translates the source sentence using the back-translation probability of the target sentence being back-translated into the source sentence so that words in the original sentence that are not sufficiently accurately translated in the currently generated target sentence will be more accurately translated in the next translation.
[0053] In operation 120, when the target sentence is regenerated, the machine translation apparatus determines whether the regenerated target sentence needs to be corrected. The machine translation apparatus determines whether the regenerated target sentence needs to be corrected based on a difference between the regenerated target sentence and a previously generated target sentence.
[0054] In response to the difference between the regenerated target sentence and the previously generated target sentence being greater than a preset threshold, the machine translation apparatus determines that the regenerated target sentence needs to be corrected. In response to such a determination, operation 130 is performed again based on the back-translation probability of the regenerated target sentence being back-translated into the source sentence.
[0055] Conversely, in response to the difference between the regenerated target sentence and the previously generated target sentence being equal to or less than the threshold, the machine translation apparatus determines that the regenerated target sentence does not need to be corrected. In response to such a determination, the machine translation apparatus outputs the most recently regenerated target sentence as a final translation result.
[0056] Therefore, as described above, the machine translation apparatus may regenerate the target sentence multiple times, thereby gradually improving the translation accuracy.
[0057] Figure 2 is a diagram illustrating an example of the operation of the NMT model.
[0058] Reference Figure 2The NMT model 200 includes an encoder 210 and a decoder 220, wherein the encoder 210 is configured to encode a source sentence and the decoder 220 is configured to decode the encoded result into a target sentence. The encoder 210 and the decoder 220 are based on a neural network.
[0059] like Figure 2 As shown in , the encoder 210 converts each word (e.g., "I", "ate", "pizza", and "yesterday") included in the source sentence into a hidden vector. Figure 2 In the example shown in represents a hidden vector of the encoder 210 obtained by converting the u-th word in the source sentence, where u represents the position information or index of the u-th word in the source sentence.
[0060] Weight a tu The hidden vector of the encoder 210 that is converted to the u-th word in the source sentence. tu Indicates how much the hidden vector for the uth word in the source sentence contributes to determining the tth word in the target sentence. Weight a tu The weight a is determined based on the hidden vector of the decoder 220 for the (t-1)th word in the target sentence and the hidden vector of the encoder 210 for the uth word in the source sentence. tu It can also be called the attention value.
[0061] Context informationc t Using the hidden vector and weight a of encoder 210 tu To determine. Context information c t It is determined that each hidden vector and the corresponding weight a tu The sum of the multiplication results between each hidden vector and the corresponding weight a tu The sum of the products between .
[0062] Decoder 220 uses context information c t and the (t-1)th word in the target sentence to determine the tth word in the target sentence. Figure 2 In the example shown in represents the hidden vector of the decoder 220 for the t-th word in the target sentence, where t represents the position information or index of the t-th word in the target sentence.
[0063] The machine translation device applies the back-translation probability of the target sentence being back-translated into the source sentence to the context information c t The source sentence can be translated again, thereby gradually improving the accuracy of translating the words in the source sentence that have not been sufficiently accurately translated in the current target sentence.
[0064] Figure 3 : is a diagram showing an example of a first model and a second model used in a machine translation apparatus.
[0065] Reference Figure 3 , the machine translation device translates the source sentence S 310 (e.g., Figure 3 “I ate pizza yesterday” as shown in the sentence “I ate pizza yesterday”.
[0066] The machine translation apparatus generates a first target sentence T by translating the source sentence S 310 using the first model. 1 320. The first model is an NMT model configured to generate a target sentence T expressed in a target language from a source sentence S 310 expressed in a source language.
[0067] The machine translation device uses the second model to determine the first target sentence T 1 320 is back-translated into the back-translation probability of the source sentence S 310. The second model is an NMT model configured to output the back-translation probability of generating the source sentence S 310 expressed in the source language from the target sentence T expressed in the target language. Figure 3 In the example shown in 1 ) represents the first target sentence T 1 320 is back-translated into the probability of the source sentence S 310 being back-translated.
[0068] The second model is used to determine the back-translation probability for each word included in the source sentence S 310. For example, Figure 3 As shown in , the back-translation probability p is determined for "I", "ate", "pizza" and "yesterday" respectively. 1 、p 2 、p 3 and p 4 . Back translation probability p 1 、p 2 、p 3 and p 4 has values between 0 and 1, and Figure 3 The graph is shown in a bar graph.
[0069] In the first target sentence T 1 320, the back translation probability of the word "yesterday" is p 4 Obviously smaller than other back-translation probabilities p 1 、p 2 and p 3 , which indicates that the word "yesterday" among the multiple words included in the source sentence S 310 is in the first target sentence T 1320 has not been translated sufficiently accurately.
[0070] Then, the machine translation apparatus re-translates the source sentence S310 by increasing the weight for the word "yesterday" among the plurality of words included in the source sentence S310 based on the determined back-translation probability. The first model is used again to perform the re-translation, and when the source sentence S310 is re-translated in the first model, a second target sentence T is generated by re-translating the word "yesterday" based on the increased weight. 2 330.
[0071] The machine translation device uses the second model to determine the second target sentence T 2 330 is translated back into the probability of the source sentence S 310. In the second target sentence T 2 330, the back translation probability of the word "yesterday" is p 4 The back-translation probability p of word “I” has increased greatly from its previous value. 1 Slightly reduced from its previous value, this indicates that the word "yesterday" is now in the second target sentence T 2 330 is fully accurately translated, but the word “I” is not in the second target sentence T 2 330 is not fully and accurately translated. Figure 3 In the example shown in 2 ) indicates the second target sentence T 2 330 is the probability of being back-translated into the source sentence S310.
[0072] The machine translation apparatus re-translates the source sentence S310 by increasing the weight for the word "I" among the plurality of words included in the source sentence S310 based on the currently determined back-translation probability. The first model is used again to perform the re-translation, and the third target sentence T310 is re-translated. 3 340 is generated. Then, the machine translation device uses the second model to determine the third target sentence T 3 340 is translated back into the probability of the source sentence S 310. Figure 3 In the example shown in 3 ) indicates the third target sentence T 3 340 is back-translated into the probability of the source sentence S 310 being back-translated.
[0073] As described above, the machine translation device translates the source sentence S 310 multiple times, thereby obtaining a target sentence with gradually improved accuracy. Hereinafter, for the convenience of description, the target sentence will also be referred to as a translation result.
[0074] Figures 4 to 6is a diagram illustrating an example of the operation of a machine translation apparatus.
[0075] Figure 4 is a diagram showing an example of how a machine translation apparatus performs translation by applying a back-translation probability to context information.
[0076] Reference Figure 4 The machine translation device translates the source sentence S 410 (e.g., Figure 4 ) to generate the first target sentence T 2 420. When the source sentence S 410 is initially translated, there is no target sentence, and therefore, the machine translation device assumes the initial back-translation probability of all words included in the source sentence S 410 (e.g., and ) is 1. That is, assuming there is a virtual target sentence T 1 (not shown). Figure 4 In the example shown in FIG. 1 , Pr(T i |S,c i ) indicates that when the source sentence S 410 and the context information c are given i Generate the (i-1)th target sentence T i The probability, for example, Pr(T 2 |S,c 2 ) indicates that when the source sentence S 410 and the context information c are given 2 Generate the first target sentence T 2 The probability of 420.
[0077] Then, the machine translation device determines the first target sentence T 2 420 whether it needs to be corrected. For example, Figure 4 As shown in FIG. 1 , the machine translation device is based on the first target sentence T as the current translation result. 2 420 and the difference between the previous target sentence to determine the first target sentence T 2 420 whether it needs to be corrected. However, since the first target sentence T 2 420 is the initial translation result, so there is no previous target sentence, so the machine translation device determines the first target sentence T 2 420 needs to be corrected.
[0078] The machine translation device uses the second model to determine the first target sentence T 2 420 is back-translated into the back-translation probability of the source sentence S 410. For each word included in the source sentence S 410, the back-translation probability (e.g., Figure 4 As shown in and ) is determined. Figure 4 In the example shown in i ) represents the (i-1)th target sentence T i The probability of being translated back into the source sentence S 410, for example, Pr(S|T 2 ) represents the first target sentence T 2 420 is the probability of being back-translated into the source sentence S410.
[0079] The machine translation device applies the determined back-translation probability to the context information according to Equation 1 below.
[0080]
[0081] In equation 1, represents the context information used to determine the tth word in the target sentence in the i-th translation stage. represents an attention value indicating how much the u-th word in the source sentence S 410 contributes to determining the t-th word in the target sentence in the i-th translation stage. represents the back-translation probability associated with the u-th word in the source sentence S 410 in the i-th translation stage.
[0082] As can be seen from Equation 1, the inverse of the back-translation probability is multiplied by the residual term, and therefore, a smaller back-translation probability has a greater influence on the context information. That is, the machine translation apparatus applies a greater weight to the context information for a word having a smaller back-translation probability among the plurality of words included in the source sentence S410.
[0083] exist Figure 4 In the example shown in , the back translation probability of the word "yesterday" Close to 0. Here, the back translation probability The reciprocal of is multiplied by the remaining term, and therefore, the word "yesterday" in the source sentence S 410 is reflected in the context information with a larger weight.
[0084] As described above, the machine translation apparatus re-translates the source sentence S 410 using the first model and the context information to which the back-translation probability is applied. As a result of the re-translation, the second target sentence T 3 430 is generated.
[0085] Then, the machine translation device determines the second target sentence T 3 430 whether it needs to be corrected. Figure 4 As shown in FIG. 1 , the machine translation device is based on the second target sentence T which is the current translation result or the last translation result. 3430 and the previous target sentence (in this example, the first target sentence T 2 420) to determine the second target sentence T 3 430 Whether it needs to be corrected.
[0086] In one example, in response to the second target sentence T 3 430 is less than or equal to a preset threshold, the machine translation device determines that the second target sentence T 3 430 does not need to be corrected and outputs the second target sentence T 3 430 as the final translation result. 3 430 and the previous target sentence is greater than a threshold, the machine translation device determines that the second target sentence T 3 430 needs to be corrected.
[0087] Optionally, in another example, in response to the second target sentence T 3 430 is less than a preset threshold, the machine translation device determines that the second target sentence T 3 430 does not need to be corrected and outputs the second target sentence T 3 430 as the final translation result. 3 430 is equal to or greater than a threshold value, the machine translation device determines that the second target sentence T 3 430 needs to be corrected. In one example, the difference between the current translation result and the previous translation result is determined based on a Bilingual Evaluation Undergraduate (BLEU) score as a translation evaluation indicator according to the following equation 2.
[0088] δ(T i )=BLEU(T i , T <i ) (2)
[0089] In Equation 2, T i represents the current target sentence, T <i represents all previous target sentences that have been generated. δ(T i ) represents the difference between the current target sentence and the previous target sentence based on the BLEU score, and δ(T i ) is compared with a preset threshold to determine whether the current target sentence needs to be corrected.
[0090] In one example, BLEU is used to evaluate whether the n-gram string in the current translation result is included in the previous target sentence. In this example, in response to the n-gram string not being included in the previous target sentence, δ(Ti ) is determined to be relatively small, so that the difference between the current target sentence and the previous target sentence is identified as relatively large. Conversely, in response to the n-gram string being included in the previous target sentence, δ(T i ) is determined to be relatively large, so that the difference between the current target sentence and the previous target sentence is identified as relatively small.
[0091] exist Figure 4 In the example shown in , in the second translation phase, δ(T i ) can be determined to be 0.7. i ) is less than a preset threshold (e.g., 0.8), therefore, the current target sentence (e.g., the second target sentence T 3 430) and the previous target sentence (e.g., the first target sentence T 2 420) have a large difference.
[0092] Then, the machine translation device determines the second target sentence T using the second model. 3 430 needs to be corrected, and the second target sentence T is determined 3 430 is back-translated into the back-translation probability of the source sentence S 410, and a third target sentence T is generated by applying the determined back-translation probability to the context information. 4 440.
[0093] The machine translation device is based on the third target sentence T 4 440 and the previous target sentence (eg, the first target sentence T 2 420 and the second target sentence T 3 430) to determine the third target sentence T 4 440 whether it needs to be calibrated. Figure 4 In the example shown in , in the third translation stage δ(T i ) is determined to be 1.0. In this example, the determined δ(T i ) is greater than a threshold value (e.g., 0.8), therefore, the third target sentence T is identified. 4 440 is smaller than the previous target sentence. Then, the machine translation device determines that the third target sentence T 4 440 does not need to be corrected, and outputs the third target sentence T 4 440 as the final translation result.
[0094] Figure 5 A diagram showing an example of how a machine translation apparatus performs translation by applying a back-translation probability of each target sentence generated from a source sentence to context information.
[0095] The parameters above Figure 4 An example of how to generate a single target sentence in a translation phase is described below. Figure 5 An example describing how to generate multiple target sentences in one translation phase.
[0096] Reference Figure 5 , the machine translation device uses the first model to translate the source sentence S 510 (e.g., Figure 5 ) generates multiple first target sentences T 2,1 and T 2,2 520. For example, the first target sentence T 2,1 and T 2,2 520 is a predetermined number of target sentences with high probability generated from the source sentence S 510. Figure 5 In the example shown in i,j |S,c i ) indicates that when the source sentence S 510 and the context information c are given i Generate the (i-1)th target sentence T i,1 and T i,2 The jth target sentence T i,j The probability, for example, Pr(T 2,j |S,c 2 ) indicates that when the source sentence S 510 and the context information c are given 2 Generate the first target sentence T 2,1 and T 2,2 The jth target sentence T among 520 2,j probability.
[0097] The machine translation device determines a first target sentence T 2,1 and T 2,2 520 or first target sentence T 2,1 and T 2,2 Whether the target sentence with the highest probability among the target sentences T in 520 needs to be corrected. The machine translation device determines whether the target sentence with the highest probability among the target sentences T in 520 needs to be corrected. 2,1 and T 2,2 520 or first target sentence T 2,1 and T 2,2 Whether such correction is required is determined by comparing the difference between the target sentence with the maximum probability in 520 and the previously generated target sentence. However, there is no previous target sentence in the case of the first translation operation, and therefore, the machine translation apparatus determines that correction is required after the first translation operation.
[0098] The machine translation device uses the second model to determine the first target sentence T 2,1 and T 2,2Each of 520 is back-translated into the back-translation probability of the source sentence S 510. Figure 5 In the example shown in i,j ) represents the (i-1)th target sentence T i,1 and T i,2 The jth target sentence T i,j The probability of being translated back into the source sentence S 510, for example, Pr(S|T 2,j ) represents the first target sentence T 2,1 and T 2,2 The jth target sentence T among 520 2,j The back-translation probability of being back-translated into the source sentence S 510. In this example, the back-translation probability (e.g., and ) is included in the first target sentence T 2,1 and T 2,2 520. Figure 5 In the example shown in is determined to be included in the first target sentence T 2,1 and T 2,2 The average value of the probability that the multiple words corresponding to "I" in 520 are translated into the word "I". The same method is used to determine the other back-translation probabilities and
[0099] The machine translation device retranslates the source sentence by applying the determined back-translation probability to the context information S510. Figure 3 In the illustrated example, the machine translation apparatus determines the back-translation probability based on a plurality of translation results in one translation phase, thereby effectively reducing the number of translation phases.
[0100] When it is determined that correction is no longer necessary, the machine translation apparatus outputs a target sentence having the highest probability among the final target sentences as a final translation result.
[0101] For the above reference Figure 5 For operations not described, please refer to Figure 4 The description is provided, therefore, for the sake of clarity and conciseness, a more detailed and repetitive description is omitted here.
[0102] Figure 6 is a diagram showing an example of how a machine translation apparatus performs translation by applying back-translation probability and position information of a word generated by a decoder of a first model to context information.
[0103] Referenced above Figure 4 An example of how the back-translation probability is applied to context information is described below with reference to Figure 6 An example of how to apply the position information of a word generated by the decoder of the first model to the context information in addition to the back-translation probability is described. In this example, the machine translation device applies the back-translation probability and the position information to the context information according to the following equation 3.
[0104]
[0105] In equation 3, Indicates that in the i-th translation stage, for the position information t of the word to be generated by the decoder of the first model, the source sentence S 610 (for example, Figure 6 The back-translation probability of the u-th word in “I ate pizza yesterday” shown in . It is determined based on the dimension of the hidden vector to be extracted by the encoder of the first model according to the following Equation 4.
[0106]
[0107] In equation 4, represents the m-dimensional hidden vector extracted from the encoder of the first model. M represents the total dimension of the hidden vector extracted from the encoder of the first model, and m has an integer value from 1 to M. The position information t indicates the position of the word in the target sentence. That is, t=1 is for the first word in the target sentence, t=2 is for the second word in the target sentence, and so on. The period of equation 4 is (2π×10000 m / M ). That is, the position information is an M-dimensional vector with a different period for each dimension m.
[0108] As can be seen from Equation 3, the machine translation apparatus applies a weight to the context information for each of the plurality of words included in the source sentence S 610, wherein the weight is determined based on the back-translation probability of the corresponding word among the plurality of words included in the source sentence S 610 and the position information of the corresponding word to be generated by the decoder of the first model. For example, the machine translation apparatus applies a larger weight to the context information to be used for translating the word with a lower back-translation probability for the word with a lower back-translation probability among the plurality of words included in the source sentence S 610.
[0109] like Figure 6 As shown in , in the first target sentence T 2 The probability of the back translation of the multiple words in 620 into the corresponding words in the source sentence S 610 is and Among them, the back translation probability of the word "yesterday" Minimum. Therefore, the machine translation device applies a larger weight for the word "yesterday" to the context information. The context information used here is limited to the context information for translating the word "yesterday" based on the position information of the word to be generated by the decoder of the first model. That is, the machine translation device does not apply a larger weight for the word "yesterday" to the context information for translating other words "I", "ate" and "pizza" in the source sentence S 610.
[0110] As described above, the position information of the word generated by the decoder of the first model is also applied to the context information. Therefore, when retranslating a word that is not sufficiently accurately translated in the target sentence among the plurality of words included in the source sentence S610, the machine translation apparatus effectively prevents the word that is not sufficiently accurately translated in the target sentence from affecting the translation of the remaining words in the target sentence S610.
[0111] Figure 7 is a diagram illustrating an example of a user interface.
[0112] Reference Figure 7 , providing a user interface 710 through a machine translation device.
[0113] The machine translation device provides the user with, for example, the source sentence, the target sentence, the back-translation probability of each word of the current target sentence, and the number of translations of the source sentence that have been performed by the machine translation device (indicated by the number before the target sentence, which is "1" in the user interface 710) through the user interface 710. The user interface 710 displays the back-translation probability for each word included in the source sentence in a bar graph.
[0114] Referring to the bar graph displayed in the user interface 710, the user can recognize that the back-translation probability of the word "yesterday" among the multiple words included in the source sentence is very low. Then, the user can input an input 711 for changing the weight for the word "yesterday" having such a low back-translation probability. For example, the user can input an input for changing the weight for the word "yesterday" (e.g., as shown in FIG. 1 ) by dragging or clicking a bar corresponding to the word "yesterday" in the bar graph. Figure 7 As shown in , in order to increase the weight for the word "yesterday"), input 711 is input.
[0115] Then, the machine translation device assigns a weight to the word “yesterday” based on the input 711 received from the user (e.g., Figure 7 The increased weights shown in ) are applied to the context information, and the source sentence is re-translated using the first model and the context information to which the changed weights are applied. Figure 7 , the user interface 720 displays the second target sentence " ”, and the probability of the second target sentence being translated back into the source sentence for each word.
[0116] In one example, the machine translation device determines whether the final translation result needs to be corrected based on the difference between the final translation result and the previous translation result. Optionally, when no input for changing the weight of at least one word among the multiple words included in the source sentence is received from the user, or when a command indicating that correction is not required is received from the user, the machine translation device determines that the final translation result does not need to be corrected.
[0117] As mentioned above Figure 7 As described above, by using such a user interface, the user can easily recognize whether a word in the source sentence is omitted from the target sentence or whether a word in the source sentence is not sufficiently accurately translated in the target sentence, and control the translation process.
[0118] Figure 8 is a diagram showing an example of how the first model and the second model are trained.
[0119] The first model and the second model used in the above-mentioned machine translation device are trained according to a reward determined based on the number of translations and the naturalness of the translation results. For example, the first model and the second model are trained according to reinforcement learning (e.g., policy gradient) based on dual learning and minimizing rewards.
[0120] For example, the number of translations of the source sentence is used to determine the reward according to the following Equation 5.
[0121] E[r]=∑ i λ i r i (2)
[0122] In Equation 5, r represents a reward, and λ represents a value between 0 and 1 that decreases as the number of translations i increases. The reward r is the probability Pr(S|T i ). The first model and the second model are trained to maximize the value of the expected reward E[r], and therefore, the first model and the second model are trained so that a larger reward is applied to a smaller number of translations of the source sentence.
[0123] In addition, the target language model is used to determine the degree of naturalness of the translation result in the target language. The first model and the second model are trained so that a larger reward is applied when the translation result corresponds to a more natural expression in the target language.
[0124] Fig. 9 is a flow chart illustrating an example of a machine translation method.
[0125] In the following, reference will be made to Fig. 9 The described machine translation method is executed by a processor of a machine translation device.
[0126] Reference Fig. 9 , in operation 910, the machine translation device translates a source sentence using a first model.
[0127] In operation 920 , the machine translation apparatus determines a back-translation probability that the translation result of the source sentence is back-translated into the source sentence using the second model.
[0128] In operation 930 , the machine translation apparatus applies the determined back-translation probability to context information extracted from the source sentence in the first model.
[0129] In operation 940 , the machine translation apparatus re-translates the source sentence using the first model and the context information to which the back-translation probability is applied.
[0130] Reference Figures 1 to 8 The description provided applies to the above reference Fig. 9 The machine translation method described herein is described, therefore, for the sake of clarity and conciseness, a more detailed and repetitive description is omitted here.
[0131] Fig.10 is a diagram illustrating an example of a machine translation apparatus.
[0132] Reference Fig.10 , the machine translation apparatus 1000 includes a memory 1010 and a processor 1020. The memory 1010 and the processor 1020 communicate with each other through a bus 1030.
[0133] The memory 1010 stores at least one instruction executed by the processor 1020. When the processor 1020 executes at least one instruction stored in the memory 1010, the processor 1020 performs the operations described herein. The memory 1010 may include one or both of a volatile memory and a nonvolatile memory.
[0134] The processor 1020 is a device capable of executing at least one instruction stored in the memory 1010 to control the operation of the machine translation apparatus 1000. The processor 1020 executing at least one instruction stored in the memory 1010 configures the processor 1020 to translate the source sentence using the first model, and determine the back-translation probability that the translation result of the source sentence is back-translated into the source sentence using the second model, apply the determined back-translation probability to the context information extracted from the source sentence in the first model, and re-translate the source sentence using the first model and the context information to which the back-translation probability is applied.
[0135] In one example, the machine translation apparatus 1000 may be combined with a language recognizer or a synthesizer and applied to unlimited translation and translation services.
[0136] For a more detailed description of the machine translation device 1000, please refer to the above Figures 1 to 9 The description is provided, so for the sake of clarity and conciseness, a more detailed and repeated description is omitted here.
[0137] The operations described in this application are implemented by hardware components. Fig.10The machine translation device 1000, memory 1010, processor 1020 and bus 1030 in the present invention are configured to perform the operations performed by the hardware components described in the present application. Examples of hardware components that can be used to perform the operations described in the present application include, where appropriate, controllers, sensors, generators, drivers, memories, comparators, arithmetic logic units, adders, subtractors, multipliers, dividers, integrators, and any other electronic components configured to perform the operations described in the present application. In other examples, one or more hardware components that perform the operations described in the present application are implemented by computing hardware (e.g., by one or more processors or computers). Processors or computers can be implemented by one or more processing elements (such as logic gate arrays, controllers and arithmetic logic units, digital signal processors, microcomputers, programmable logic controllers, field programmable gate arrays, programmable logic arrays, microprocessors, or any other device or combination of devices configured to respond and execute instructions in a limited manner to achieve the desired result). In one example, a processor or computer includes or is connected to one or more memories storing instructions or software executed by a processor or computer. The hardware components implemented by a processor or a computer can execute instructions or software (such as an operating system (OS) and one or more software applications running on the OS) to perform the operations described in this application. The hardware components can also access, manipulate, process, create and store data in response to the execution of instructions or software. For the sake of simplicity, the singular term "processor" or "computer" can be used for the description of the examples described in this application, but in other examples, multiple processors or computers can be used, or a processor or a computer can include multiple processing elements or multiple types of processing elements or both. For example, a single hardware component or two or more hardware components can be implemented by a single processor or two or more processors or a processor and a controller. One or more hardware components can be implemented by one or more processors or a processor and a controller, and one or more other hardware components can be implemented by one or more other processors or another processor and another controller. One or more processors or a processor and a controller can implement a single hardware component or two or more hardware components. The hardware components may have any one or more of different processing configurations, examples of which include: a single processor, independent processors, parallel processors, single instruction single data (SISD) multiprocessing, single instruction multiple data (SIMD) multiprocessing, multiple instruction single data (MISD) multiprocessing, and multiple instruction multiple data (MIMD) multiprocessing.
[0138] Executed by computing hardware (e.g., by one or more processors or computers implemented to execute instructions or software as described above to perform the operations performed by the methods described in this application) Figures 1 to 9The method of performing the operations described in the present application is shown. For example, a single operation or two or more operations may be performed by a single processor or two or more processors or a processor and a controller. One or more operations may be performed by one or more processors or a processor and a controller, and one or more other operations may be performed by one or more other processors or another processor and another controller. One or more processors or a processor and a controller may perform a single operation or two or more operations.
[0139] The instructions or software for controlling computing hardware (e.g., one or more processors or computers) to implement hardware components and perform the methods described above can be written as computer programs, code segments, instructions, or any combination thereof to individually or collectively instruct or configure one or more processors or computers to operate as a machine or special-purpose computer for performing the operations performed by the hardware components and the methods described above. In one example, the instructions or software include machine code (such as machine code generated by a compiler) directly executed by one or more processors or computers. In another example, the instructions or software include high-level code executed by one or more processors or computers using an interpreter. Instructions or software can be written in any programming language based on the block diagrams and flow charts shown in the accompanying drawings and the corresponding descriptions in the specification (which discloses algorithms for performing the operations performed by the hardware components and the methods described above).
[0140] The instructions or software for controlling computing hardware (e.g., one or more processors or computers) to implement hardware components and perform the methods described above and any associated data, data files, and data structures may be recorded, stored, or fixed in or on one or more non-transitory computer-readable storage media. Examples of non-transitory computer-readable storage media include: read-only memory (ROM), random access memory (RAM), flash memory, CD-ROM, CD-R, CD+R, CD-RW, CD+RW, DVD-ROM, DVD-R, DVD+R, DVD-RW, DVD+RW, DVD-RAM, BD-ROM, BD-R, BD-R LTH, BD-RE, magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid-state disk, and any other device, wherein any other device is configured to: store the instructions or software and any associated data, data files, and data structures in a non-transitory manner, and provide the instructions or software and any associated data, data files, and data structures to one or more processors or computers so that one or more processors or computers can execute the instructions. In one example, the instructions or software and any associated data, data files, and data structures are distributed across a networked computer system so that the instructions and software and any associated data, data files, and data structures are stored, accessed, and executed in a distributed manner by one or more processors or computers.
[0141] Although the present disclosure includes specific examples, various changes in form and detail can be made in these examples without departing from the spirit and scope of the claims and their equivalents, which will be clear after understanding the disclosure of the present application. The examples described herein will be considered to be descriptive only, not for the purpose of limitation. The description of the features or aspects in each example will be considered to be applicable to similar features or aspects in other examples. If the described technology is performed in a different order, and / or if the components in the described system, architecture, device or circuit are combined in different ways, and / or replaced or supplemented by other components or their equivalents, suitable results can be achieved. Therefore, the scope of the present disclosure is not limited by specific embodiments, but by the claims and their equivalents, and all changes within the scope of the claims and their equivalents will be interpreted as included in the present disclosure.
Claims
1. A processor-implemented machine translation method, include: Using the first model to translate the source sentence; Using a second model to determine a probability that the translation result of the source sentence is translated back into the source sentence; In the first model, the back-translation probability is applied to the context information extracted from the source sentence; Re-translate the source sentence using the first model and the contextual information with the back-translation probability applied, wherein the translation result includes a target sentence obtained by translating a source sentence using the first model, and the re-translation result of the source sentence includes an updated target sentence obtained by re-translating the source sentence using the first model and context information to which a back-translation probability is applied, wherein a back-translation probability is determined for each of a plurality of words included in the source sentence, The step of applying the back-translation probability to the context information includes: For a word having a lower back-translation probability among the plurality of words included in the source sentence, a larger weight is applied to the context information.
2. The processor-implemented machine translation method according to claim 1, in, The steps for applying the back-translation probability to the contextual information include: A weight is applied to context information for each of the plurality of words included in the source sentence, wherein the weight is determined based on a back-translation probability of the corresponding word included in the translation result and position information of the corresponding word in the translation result.
3. The processor-implemented machine translation method according to claim 2, in, The steps for applying the back-translation probability to the contextual information include: For a word having a lower back-translation probability among the plurality of words included in the source sentence, a larger weight is applied to context information used for translating the word using the first model.
4. The processor-implemented machine translation method according to claim 1, further comprising: include: Determine whether the final translation result of the source sentence needs to be corrected; In response to determining that the last translation result of the source sentence needs to be corrected, a back-translation probability that the last translation result is back-translated into the source sentence is applied to the context information, and the source sentence is re-translated using the first model and the context information to which the back-translation probability is applied.
5. The processor-implemented machine translation method according to claim 4, in, The steps to determine whether the final translation result needs to be corrected include: Whether the final translation result needs to be corrected is determined based on a difference between the final translation result of the source sentence and a previous translation result of the source sentence.
6. The processor-implemented machine translation method according to claim 1, in, The steps for applying the back-translation probability to the contextual information include: providing a user with a back-translation probability for each of the plurality of words included in the source sentence; receiving a user input from a user for changing a weight for a word among the plurality of words included in the source sentence; In response to receiving the user input, a changed weight for the word is applied to the context information.
7. The processor-implemented machine translation method according to claim 1, in, The translation result includes a plurality of target sentences obtained by translating the source sentence using the first model, The steps to determine the probability of back translation include: An average of the respective probabilities that the plurality of target sentences are back-translated into source sentences is determined as a back-translation probability.
8. The processor-implemented machine translation method according to claim 1, in, The first model and the second model are trained to maximize an expected reward, wherein the expected reward increases as the number of times the source sentence is re-translated decreases.
9. The processor-implemented machine translation method according to claim 1, in, The first model and the second model are trained to maximize an expected reward, wherein the expected reward increases as the number of times the source sentence is re-translated decreases and as the naturalness of the translation result in the target language increases.
10. The processor-implemented machine translation method according to claim 1, in, The first model is configured to generate a translation result expressed in a target language from a source sentence expressed in a source language, The second model is configured to generate a back-translation probability that the translation result expressed in the target language is back-translated into a source sentence expressed in the source language.
11. A non-transitory computer-readable medium storing instructions, which, when executed by a processor, causes the processor to perform the processor-implemented machine translation method of claim 1.
12. A machine translation device, include: processor; a memory storing at least one instruction executed by the processor, Wherein, the processor executing the at least one instruction configures the processor to: Using the first model to translate the source sentence; Using a second model to determine a probability that the translation result of the source sentence is translated back into the source sentence; In the first model, the back-translation probability is applied to the context information extracted from the source sentence; Re-translate the source sentence using the first model and the contextual information with the back-translation probability applied, wherein the translation result includes a target sentence obtained by translating a source sentence using the first model, and the re-translation result of the source sentence includes an updated target sentence obtained by re-translating the source sentence using the first model and context information to which a back-translation probability is applied, The processor is further configured to: determining a back-translation probability for each of a plurality of words included in the source sentence, For a word having a lower back-translation probability among the plurality of words included in the source sentence, a larger weight is applied to the context information.
13. The machine translation device according to claim 12, in, The processor is further configured to apply a weight to context information for each of the plurality of words included in the source sentence, wherein the weight is determined based on a back-translation probability of the corresponding word included in the translation result and position information of the corresponding word in the translation result.
14. The machine translation device according to claim 13, in, The processor is further configured to, for a word having a lower back-translation probability among the plurality of words included in the source sentence, apply a greater weight to context information used to translate the word using the first model.
15. The machine translation device according to claim 12, in, The processor is also configured to: Determine whether the final translation result of the source sentence needs to be corrected; In response to determining that the final translation result needs to be corrected, a back-translation probability that the final translation result is back-translated into a source sentence is applied to the context information, and the source sentence is re-translated using the first model and the context information to which the back-translation probability is applied.
16. The machine translation device according to claim 12, in, The processor is also configured to: providing a user with a back-translation probability for each of the plurality of words included in the source sentence; receiving a user input from a user for changing a weight for a word among the plurality of words included in the source sentence; In response to receiving the user input, a changed weight for the word is applied to the context information.
17. A processor-implemented machine translation method, include: translating a source sentence including a plurality of words based on context information of the plurality of words of the source sentence using the first model to obtain a target sentence; using a second model to determine a back-translation probability that the target sentence is back-translated into the source sentence; applying the back-translation probability to the context information to obtain modified context information; Retranslate the source sentence based on the modified context information using the first model to obtain an updated target sentence, wherein a back-translation probability is determined for each of the plurality of words included in the source sentence, The step of applying the back-translation probability to the context information includes: For a word having a lower back-translation probability among the plurality of words included in the source sentence, a larger weight is applied to the context information.
18. The processor-implemented machine translation method according to claim 17, in, The target sentence consists of multiple words. The step of determining the back-translation probability comprises: for each word of the plurality of words of the source sentence, determining the back-translation probability that the corresponding word of the target sentence is back-translated into the word of the source sentence, The step of applying the back-translation probability includes applying the inverse of the back-translation probability determined for each of the plurality of words of the source sentence to the context information to obtain modified context information.
19. The processor-implemented machine translation method according to claim 17, in, The target sentence consists of multiple words. The step of determining the back-translation probability comprises: for each word of the plurality of words of the source sentence, determining the back-translation probability that the corresponding word of the target sentence is back-translated into the word of the source sentence, The step of applying the back-translation probability includes: for each word of the plurality of words of the source sentence, applying the back-translation probability determined for the word of the source sentence and the position information of the corresponding word of the target sentence to the context information to obtain modified context information.
20. The processor-implemented machine translation method according to claim 17, in, The step of translating the source sentence includes: using a first model to translate the source sentence based on context information to obtain a first target sentence and a second target sentence different from the first target sentence, The steps to determine the probability of back translation include: determining, using the second model, a first back-translation probability that the first target sentence is back-translated into the source sentence; Determine a second back-translation probability of the second target sentence being back-translated into the source sentence using the second model, The steps to apply back-translation probability include: An average of the first back-translation probability and the second back-translation probability is applied to the context information to obtain modified context information.
21. The processor-implemented machine translation method according to claim 17, further comprising: include: determining whether a difference between the updated target sentence and the source sentence satisfies a predetermined condition, wherein the predetermined condition indicates that the updated target sentence is a sufficiently accurate translation of the source sentence; In response to the difference not satisfying the predetermined condition, repeating the steps of determining a back-translation probability, applying the back-translation probability, re-translating the source sentence, and determining whether the difference satisfies the predetermined condition until the difference satisfies the predetermined condition; In response to the difference satisfying the predetermined condition, an updated target sentence is output as a final translation result of translating the source sentence.
