Machine translation method, electronic device, and storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- AISPEECH CO LTD
- Filing Date
- 2022-05-17
- Publication Date
- 2026-08-07
AI Technical Summary
[0004]相关技术中,通过非自回归神经机器翻译的方法将待翻译句子中的待翻译词按照目标语言的结构进行重排序,得到伪翻译句子,再将伪翻译句子使用非自回归方法翻译成所述目标语言的目标句子,缺陷是在非自回归模型中,每个单词之间没有依赖关系,整个输出序列的每个单词被并行地同步预测,虽然其推断速度得到了很大改善,但是生成质量却往往较差
[0010] The method, electronic device, and storage medium of this application construct the input of the decoding end by predicting the position and probability of each word in the source language text in the target language text, as well as predicting the translation of each word in the source language text into the corresponding target language text and the probability. This allows the decoding end to know in advance which words need to be output at each position in the output, thereby greatly reducing the search space during decoding and improving the quality of the generated results.
Smart Images

Figure CN115204195B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence technology, and in particular relates to machine translation methods, electronic devices, and storage media. Background Technology
[0002] Machine translation is the process of converting one natural language into another using computers. It is a branch of computational linguistics, one of the ultimate goals of artificial intelligence, and has significant scientific research value.
[0003] At the same time, machine translation also has significant practical value. With economic globalization and the rapid development of the internet, machine translation technology is playing an increasingly important role in promoting political, economic, and cultural exchanges.
[0004] In related technologies, non-autoregressive neural machine translation is used to reorder the words to be translated in the sentence according to the structure of the target language to obtain a pseudo-translated sentence. The pseudo-translated sentence is then translated into the target sentence of the target language using a non-autoregressive method. The drawback is that in the non-autoregressive model, there is no dependency between each word. Each word in the entire output sequence is predicted synchronously in parallel. Although the inference speed is greatly improved, the generation quality is often poor.
[0005] Furthermore, methods to improve the quality of non-autoregressive neural machine translation by modeling collaborative relationships are used to generate translation results. However, due to the low accuracy of current dependency parsing and the inability of existing models to model dependency parsing trees effectively, errors are easily introduced, which negatively impacts the translation results. Summary of the Invention
[0006] This invention provides a machine translation method and apparatus to at least solve one of the above-mentioned technical problems.
[0007] In a first aspect, embodiments of the present invention provide a machine translation method, comprising: encoding source language text to obtain an encoded representation; performing length prediction on the encoded representation corresponding to a target language text; and performing word-level translation on the encoded representation corresponding to the target language text; and constructing a decoder input based at least on the results of the length prediction and the word-level translation.
[0008] In a second aspect, an electronic device is provided, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the steps of the machine translation method of any embodiment of the present invention.
[0009] Thirdly, embodiments of the present invention also provide a computer program product, the computer program product including a computer program stored on a non-volatile computer-readable storage medium, the computer program including program instructions, which, when executed by a computer, cause the computer to perform the steps of the machine translation method of any embodiment of the present invention.
[0010] The method, electronic device, and storage medium of this application construct the input of the decoding end by predicting the position and probability of each word in the source language text in the target language text, as well as predicting the translation of each word in the source language text into the corresponding target language text and the probability. This allows the decoding end to know in advance which words need to be output at each position in the output, thereby greatly reducing the search space during decoding and improving the quality of the generated results. Attached Figure Description
[0011] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 A flowchart illustrating a machine translation method according to an embodiment of the present invention;
[0013] Figure 2 A flowchart illustrating another machine translation method provided in an embodiment of the present invention;
[0014] Figure 3 A flowchart illustrating yet another machine translation method provided in an embodiment of the present invention;
[0015] Figure 4 A flowchart illustrating another machine translation method provided in an embodiment of the present invention;
[0016] Figure 5 A flowchart illustrating yet another machine translation method provided in an embodiment of the present invention;
[0017] Figure 6 A flowchart illustrating a specific example of a machine translation method provided in an embodiment of the present invention;
[0018] Figure 7 Constructing a decoder input graph as a specific example of a machine translation method provided in an embodiment of the present invention;
[0019] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] Please refer to Figure 1 The diagram shows a flowchart of an embodiment of the machine translation method of this application. The machine translation method of this embodiment can be applied to terminals with communication or real-time voice dialogue functions, such as smartphones, tablets, and computers.
[0022] like Figure 1 As shown, in step 101, the source language text is encoded to obtain an encoded representation;
[0023] In drive b102, the encoded representation is used to predict the length of the target language text, and the encoded representation is used to perform word-level translation of the target language text.
[0024] In step 103, the decoder input is constructed based at least on the results of length prediction and word-level translation.
[0025] In this embodiment, for step 101, the machine translation device encodes the source language text to obtain an encoded representation. For example, the acquired source language text is preprocessed accordingly, such as adding start and stop symbols and / or word segmentation. Then, LSTM (Long Short-Term Memory), GRU (Gated Recurrent Unit), or transformer can be used as encoders to encode the preprocessed source language text to obtain an encoded representation.
[0026] Then, for step 102, the machine translation device performs length prediction on the encoded representation corresponding to the target language text, and performs word-level translation on the encoded representation corresponding to the target language text. For example, it predicts the probability distribution of the length of the target language text using the encoded representation corresponding to the start symbol, and then predicts the position and corresponding word in the target language text for each word in the language text.
[0027] Finally, for step 103, the machine translation device constructs a decoder input based at least on the length prediction result and the word-level translation result. For example, it can use LSTM (Long Short-Term Memory), GRU (Gated Recurrent Unit), or transformer as a decoder to decode the decoder input and the encoded representation of the source language text after the encoder to obtain the target language text.
[0028] The method in this embodiment constructs the input for the decoding end by predicting the position and probability of each word in the source language text in the target language text, as well as predicting the translation of each word in the source language text into the corresponding target language text and the probability. This allows the decoding end to know in advance which words need to be output at each position in the output, thereby greatly reducing the search space during decoding and improving the quality of the generated results.
[0029] Further reference Figure 2 The flowchart illustrates another machine translation method provided in an embodiment of this application. This flowchart primarily describes the process... Figure 1 A flowchart further defines the steps of the process of “predicting the length of the encoded representation corresponding to the target language text, and performing word-level translation of the encoded representation corresponding to the target language”.
[0030] like Figure 2 As shown, in step 201, the length of the encoded representation corresponding to the target language text is predicted;
[0031] In step 202, the predicted position of each word in the source language text in the target language text is predicted based on the length prediction result;
[0032] In step 203, the encoded representation is translated at the word level corresponding to the target language text to obtain the predicted word of the target language text corresponding to each word in the source language text;
[0033] In step 204, the predicted position and predicted word of each word in the source language text are determined in the target language text.
[0034] In this embodiment, for step 201, the machine translation device predicts the length of the encoded representation corresponding to the target language text. Taking "China's capital is Beijing" as an example, after preprocessing and word segmentation, it becomes "start symbol, China, of, capital, is, Beijing, ., end symbol". The start symbol is 0, and the corresponding end symbol is 8. Therefore, the predicted length of the target language text is 8.
[0035] Then, for step 202, the machine translation device predicts the predicted position of each word in the source language text in the target language text based on the result of length prediction. Taking the Chinese sentence "The capital of China is Beijing." translated into English as an example, the predicted position of the word "China" translated into English at the fourth position is 0.83, which is greater than the preset threshold.
[0036] After that, for step 203, the machine translation device performs word-level translation of the encoded representation corresponding to the target language text to obtain the predicted word in the target language text corresponding to each word in the source language text. Taking the Chinese sentence "The capital of China is Beijing." translated into English as an example, the probability that the word "capital" is translated into "Capital" is 0.96, and the probability that the word "Beijing" is translated into "Beijin" is 0.97.
[0037] Finally, for step 204, the machine translation device determines the predicted position and predicted word of each word in the source language text in the target language text. Taking the Chinese sentence "The capital of China is Beijing." translated into English as an example, the probability that "China" is translated into "China" is 0.96, and the predicted position is the position of the fourth word.
[0038] The method of this embodiment determines the predicted position and predicted word of each word in the source language text in the target language text by performing length prediction corresponding to the target language text on the encoded representation of the source language text, as well as the predicted position and corresponding word of each word in the source language text in the target language text. This greatly reduces the search space during decoding and improves the quality of the generated result.
[0039] Further referring to Figure 3 , which shows a flowchart of another machine translation method provided by an embodiment of the present application. This flowchart is mainly a flowchart of steps further defining the process Figure 1 "Performing length prediction corresponding to the target language text on the encoded representation".
[0040] As Figure 3 shown, in step 301, length prediction is performed on the encoded representation to obtain the first predicted length of the target language text corresponding to the encoded representation;
[0041] In step 302, a second predicted length is determined based on the maximum position of the word-level translation of the encoded representation; [[ID=2,6]]
[0042] In step 303, the final predicted length is determined based on the first predicted length and the second predicted length.
[0043] In this embodiment, for step 301, the machine translation device performs length prediction on the encoded representation to obtain a first predicted length of the target language text corresponding to the encoded representation; then, for step 302, the machine translation device determines a second predicted length based on the maximum position of the word-level translation of the encoded representation; finally, for step 303, the machine translation device determines a final predicted length based on the first predicted length and the second predicted length. For example, the first predicted length is the length of the target language text predicted based on the source language text, and the second predicted length is the length of the target language text predicted based on the source language text translated into the target language text.
[0044] The method in this embodiment determines the final prediction length by combining a first predicted length of the target language text corresponding to the encoded representation obtained by length prediction of the encoded representation and a second predicted length determined by the maximum position of the word-level translation based on the encoded representation, thereby enhancing robustness.
[0045] Further reference Figure 4 The flowchart illustrates another machine translation method provided in an embodiment of this application. This flowchart primarily describes the process... Figure 3 The flowchart further defines the steps of the process of "predicting the length of the encoded representation to obtain the first predicted length of the target language text corresponding to the encoded representation".
[0046] like Figure 4 As shown, in step 401, the encoding is used to represent the probability distribution of predicting the length of the target language text;
[0047] In step 402, the length corresponding to the maximum probability in the probability distribution of the length is determined as the first predicted length.
[0048] In this embodiment, for step 401, the machine translation device uses the encoding corresponding to the start symbol to represent the probability distribution of the predicted length of the target language text; then, for step 402, the machine translation device determines the length corresponding to the maximum probability in the probability distribution of the length as the first predicted length. Taking "start symbol, China, of, capital, is, Beijing, ., end symbol" as an example, the start symbol is at position 0 in the target language text with a probability of 0.99, the start symbol of China is at position 4 in the target language text with a probability of 0.83, of is at position 3 in the target language text with a probability of 0.33, and the predicted end symbol is at position 8 in the target language text with a probability of 0.58. Therefore, the predicted first predicted length is 8.
[0049] The method in this embodiment uses encoding to represent the probability distribution of the predicted length of the target language text, thereby determining the length corresponding to the maximum probability in the length probability distribution as the first predicted length.
[0050] Further reference Figure 5 The flowchart illustrates another machine translation method provided in an embodiment of this application. This flowchart mainly describes the process... Figure 4 A flowchart further defines the steps of the process of "determining the second prediction length based on the maximum position of the word-level translation of the encoded representation".
[0051] like Figure 5 As shown, in step 501, the probability distribution of the position of each word in the source language text in the target language text is predicted, and the position corresponding to the highest probability in the probability distribution of the position is determined as the predicted position.
[0052] In step 502, the probability distribution of the word corresponding to each word in the source language text in the target language text is predicted, and the word with the highest probability in the probability distribution of the word is determined as the predicted word;
[0053] In step 503, the maximum position is determined based on the predicted position and probability of the target language text corresponding to each word and the predicted word and its probability;
[0054] In step 504, a second predicted length is determined based on the maximum position.
[0055] In this embodiment, for step 501, the machine translation device predicts the probability distribution of the position of each word in the source language text in the target language text, and determines the position corresponding to the highest probability in the probability distribution of the position as the predicted position. Taking "The capital of China is Beijing" as an example, the predicted position of the capital in each position of the target language text is 2, so the position of the capital can be determined as 2.
[0056] Then, for step 502, the machine translation device predicts the probability distribution of the word corresponding to each word in the source language text in the target language text, and determines the word with the highest probability in the probability distribution as the predicted word. Taking "China's capital is Beijing" as an example, the word with the highest probability of being translated into English is Capital, so it can be determined that the capital is Capital in the target language text.
[0057] Next, for step 503, the maximum position is determined based on the predicted position and probability of the target language text corresponding to each word and the predicted word and its probability. For example, the starting symbol is position 0 and the ending symbol is the maximum position.
[0058] Finally, for step 504, the machine translation device determines the second prediction length based on the maximum position.
[0059] The method in this embodiment predicts the probability distribution of the position of each word in the source language text in the target language text, thereby determining the position with the highest probability in the probability distribution as the predicted position. Then, it predicts the probability distribution of the word corresponding to each word in the source language text in the target language text, thereby determining the word with the highest probability in the probability distribution as the predicted word. Furthermore, based on the predicted position and probability of each word in the target language text and the predicted word and its probability, the maximum position is determined, thereby determining the second prediction length.
[0060] In some optional embodiments, determining the final prediction length based on the first prediction length and the second prediction length includes:
[0061] The machine translation device determines the final prediction length based on the longer of the first and second prediction lengths.
[0062] The method in this embodiment can greatly enhance robustness by determining the final prediction length.
[0063] In some optional embodiments, the decoder input, constructed based at least on the length prediction result and the word-level translation result, includes: the predicted position and probability of each word in the source language text, and the predicted word and its probability. Two probabilities greater than a threshold are selected to construct the decoder input. For example, 0.6 is used as the preset threshold for selecting the two probabilities. If the probability of the first word in the predicted position and its probability is 0.83, and the probability of the first word in the predicted word and its probability is 0.96, then the first word is selected. Then, if the probability of the second word in the predicted position and its probability is 0.33, and the probability of the second word in the predicted word and its probability is 0.47, then the second word is not selected, and a symbol representing concealment is filled into this missing position. Further, if the probability of the third word in the predicted position and its probability is 0.58, and the probability of the third word in the predicted word and its probability is 0.74, and only one probability is greater than the preset threshold, then the third word is also not selected.
[0064] The method in this embodiment improves the fluency of the translation results and greatly enhances the quality by selecting two parts whose probabilities are both greater than a threshold to construct the decoder input.
[0065] In any of the foregoing embodiments, after constructing the decoder input based at least on the length prediction result and the word-level translation result, the method further includes:
[0066] Machine translation devices use decoders to decode decoder inputs and encoded representations to generate target language text outputs. Here, the decoder is similar to the encoder. For example, LSTM, GRU, or transformer can be used as the decoder to decode decoder inputs and encoded source language text representations to obtain target language text outputs.
[0067] It should be noted that the above method steps are not intended to limit the execution order of each step. In fact, some steps may be executed simultaneously or in the reverse order of the steps, and this application does not impose any restrictions on this.
[0068] The following description addresses some problems encountered by the inventors in realizing this invention and provides a specific embodiment of the final solution, so that those skilled in the art can better understand the solution of this application.
[0069] The inventors discovered that the defects in the prior art during the development of this application were mainly caused by the following reasons:
[0070] In non-autoregressive models, there are no dependencies between words, and each word in the entire output sequence is predicted synchronously in parallel. While this greatly improves inference speed, the generation quality is often poor. These shortcomings have led to long-standing problems in this field.
[0071] The inventors also discovered that in non-autoregressive models, there are no dependencies between words, and each word in the entire output sequence is predicted synchronously in parallel, resulting in poor generation quality. The classic optimization method is to iterate through the non-autoregressive generation results multiple times. Although the generated results improve with increasing iterations, the generation speed also slows down.
[0072] The solution proposed in this application is designed and optimized from the following aspects:
[0073] Non-autoregressive translation models need to predict the length of the decoder, typically using the start symbol of the input text. <s>The length of the output text is predicted by passing the output of the corresponding encoder or the average of the outputs of the encoders of all input texts through a fully connected layer. This invention, however, builds upon the above method by using the output of the encoder corresponding to each word in the input text to predict the position of the corresponding word in the target layer. In the prediction stage, this invention combines the two prediction results to determine the final length of the decoded text, thus exhibiting stronger robustness.
[0074] This invention encodes the input text to obtain the output of the encoding end containing context information for each word, and simultaneously performs a word-level translation to obtain the target language expression corresponding to each word in the context representation.
[0075] Typically, in non-autoregressive translation, the input for the first decoding step is a mask of length N (the predicted target length). This invention, however, constructs the decoding input by matching the output position and word for each word in the predicted input text. This allows the decoder to know in advance which words should be output at each position in the output, significantly reducing the search space during decoding and improving the quality of the generated results.
[0076] Please refer to Figure 6 The diagram illustrates a flowchart of a specific example of a machine translation method provided in an embodiment of the present invention.
[0077] like Figure 6 As shown, taking Chinese-English translation as an example, step 1: Obtain the source language text and perform corresponding preprocessing, adding start symbols. <s> and Termination Symbol< / s> Etc. Chinese characters require word segmentation, etc.
[0078] For example: The capital of China is Beijing. <s> The capital of China is Beijing.< / s>
[0079] Step 2: Encoder. LSTM, GRU, or transformer can be used as the encoder to encode the input text. Specifically, for the segmented input text X = {x0, x1, ..., x...} n The encoder is used to encode the data, resulting in the encoded representation H = Encoder(X) = {h0, h1, ..., h...}. n }
[0080] Step 3: Length prediction and word-level translation.
[0081] 3.1: Based on the encoded representation H of the input text obtained in the previous step, use the start symbol. <s>The corresponding encoding is h0, and the probability distribution p predicts the length of the target text. len =softmax(MLP) len (h0)), where MLP len represents the multilayer perceptron, represents the parameters of the length predictor, and softmax is the normalized exponential function. Let p... len The one with the highest probability is denoted as argmax(p). len ), whose corresponding probability is max(p len ).
[0082] 3.2: Based on the encoded representation H of the input text obtained in the previous step, predict the position of each word in the input text in the target language text and the corresponding word below it.
[0083] p pos_i =softmax(MLP) pos (h i MLP pos represents the multilayer perceptron, which contains the parameters of the target language location predictor, and softmax is the normalized exponential function. Let p... pos_i The one with the highest probability is denoted as argmax(p). pos_i ), whose corresponding probability is max(p pos_i ).
[0084] p word =softmax(Embed T (MLP word (h i ))), where MLP word Representing a multilayer perceptron, it consists of parameters for a word predictor in the target language. T is the transpose of the word embedding matrix, and softmax is the normalized exponential function.
[0085] 3.3: Retrieve pos max =max(argmax(p pos_0 ), argmax(p pos_1 ), ..., argmax(p pos_n The corresponding probability value is p. pos_max By comparing p pos_max and max(p len The larger of the two values corresponds to the prediction length L of the target language.
[0086] Step 4: Construct the decoder input. After obtaining the predicted length L of the target language from Step 3, and the position and word in the target language corresponding to each word in the source language text, we select the parts with a probability greater than 0.6 to construct the decoder input, and fill in the missing positions. <mask>Symbol
[0087] As Figure 7 shown, construct the decoder input Z from the parts where both the position and word probability are greater than 0.6:
[0088] <s> <mask>capital <mask>China <mask> Beijing.< / mask> < / mask> < / mask> < / s> .
[0089] Step 5: The decoder decodes to generate the target language text. Similar to the encoder, LSTM, GRU, or transformer can be used as the decoder Decoder to decode the decoder input Z and the source language text representation H encoded by the encoder to obtain the target language text output Y = {y0, y1,..., y m} where y i = argmax(softmax(Decoder(, Z, H))).
[0090] In Figure 7 , the translation corresponding to "The capital of China is Beijing" is "The capital of China is Beijing", because each word in Chinese and English is not completely one-to-one. For example, "The" cannot be reflected in Chinese, so there will be some missing indexes (there is no position "1" in the figure, and position "1" corresponds to "the" that cannot be reflected in Chinese).
[0091] Comparing with the effect of the ordinary autoregressive translation model, it can be seen that the translation result of the method proposed in this invention is smoother and has higher quality.
[0092] For example, 1. Fill in the form with words describing people.
[0093] Ordinary autoregressive: Fill out the form with a word describing the human matter.
[0094] This invention: Fill out the form with words describing human.
[0095] 2. Listen and tick the types of music that Tony and Betty like.
[0096] Ordinary autoregressive: Listen to and sok out Tony and Betty'favorite types of music.
[0097] This invention: Listen and outline the types of music Tony and Betty like.
[0098] 3. You will make mistakes along the way, but the key is to learn from your mistakes and never give up.
[0099] Ordinary autoregression: You will make a mistake on the way, but learning from your mistakes never give up is key.
[0100] Invention: You will make mistakes along the way, but it is key to learn from your mistakes and never give up.
[0101] In other embodiments, the present invention also provides a non-volatile computer storage medium storing computer-executable instructions that can execute the machine translation method in any of the above method embodiments;
[0102] In one embodiment, the non-volatile computer storage medium of the present invention stores computer-executable instructions, which are configured as follows:
[0103] Encode the source language text to obtain an encoded representation;
[0104] The encoded representation is used to predict the length of the target language text, and the encoded representation is used to perform word-level translation of the target language text.
[0105] The decoder input is constructed based at least on the results of length prediction and word-level translation.
[0106] Non-volatile computer-readable storage media may include a stored program area and a stored data area, wherein the stored program area may store an operating system and an application program required for at least one function; the stored data area may store data created based on the use of the machine translation device, etc. Furthermore, the non-volatile computer-readable storage medium may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, the non-volatile computer-readable storage medium may optionally include memory remotely located relative to the processor, and this remote memory may be connected to the machine translation device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0107] This invention also provides a computer program product, which includes a computer program stored on a non-volatile computer-readable storage medium. The computer program includes program instructions, which, when executed by a computer, cause the computer to perform any of the machine translation methods described above.
[0108] Figure 8 This is a schematic diagram of the structure of the electronic device provided in the embodiment of the present invention, such as... Figure 8 As shown, the device includes one or more processors 810 and a memory 820. Figure 8 Taking a processor 810 as an example, the machine translation method device may further include an input device 830 and an output device 840. The processor 810, memory 820, input device 830, and output device 840 can be connected via a bus or other means. Figure 8 Taking a bus connection as an example, the memory 820 is the aforementioned non-volatile computer-readable storage medium. The processor 810 executes various server functions and data processing by running non-volatile software programs, instructions, and modules stored in the memory 820, thereby implementing the machine translation method described in the above embodiment. The input device 830 can receive input digital or character information and generate key signal inputs related to user settings and function control of the communication compensation device. The output device 840 may include a display device such as a screen.
[0109] The above-described product can execute the method provided in the embodiments of the present invention, and has the corresponding functional modules and beneficial effects for executing the method. Technical details not described in detail in this embodiment can be found in the method provided in the embodiments of the present invention.
[0110] In one embodiment, the above-described electronic device is used in a machine translation apparatus for a client, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
[0111] Encode the source language text to obtain an encoded representation;
[0112] The encoded representation is used to predict the length of the target language text, and the encoded representation is used to perform word-level translation of the target language text.
[0113] The decoder input is constructed based at least on the results of length prediction and word-level translation.
[0114] The electronic devices described in this application exist in various forms, including but not limited to:
[0115] (1) Mobile communication devices: These devices are characterized by their mobile communication capabilities and primarily aim to provide voice and data communication. These terminals include: smartphones (e.g., iPhones), multimedia phones, feature phones, and low-end phones, etc.
[0116] (2) Ultra-mobile personal computer devices: These devices fall under the category of personal computers, possessing computing and processing capabilities, and generally also have mobile internet access features. These terminals include PDAs, MIDs, and UMPCs, such as the iPad.
[0117] (3) Portable entertainment devices: These devices can display and play multimedia content. This category includes: audio and video players (e.g., iPods), handheld game consoles, e-book readers, as well as smart toys and portable car navigation devices.
[0118] (4) Server: A device that provides computing services. The components of a server include a processor, hard disk, memory, system bus, etc. Servers are similar to general computer architectures, but because they need to provide highly reliable services, they have higher requirements in terms of processing power, stability, reliability, security, scalability, and manageability.
[0119] (5) Other electronic devices with data interaction functions.
[0120] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0121] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.
[0122] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.< / mask> < / s> < / s>
Claims
1. A machine translation method, comprising: Encode the source language text to obtain an encoded representation; The encoded representation is used to predict the length of the target language text, and the encoded representation is used to perform word-level translation of the target language text. The decoder input is constructed based at least on the results of length prediction and word-level translation. The step of predicting the length of the encoded representation corresponding to the target language text includes: predicting the probability distribution of the length of the target language text using the encoded representation corresponding to the start symbol in the encoded representation; determining the length corresponding to the maximum probability in the probability distribution of the length as the first predicted length; predicting the probability distribution of the position of each word in the source language text in the target language text; determining the position corresponding to the maximum probability in the probability distribution of the position as the predicted position; determining the maximum position based on the predicted position corresponding to each word; and determining the second predicted length based on the maximum position; and determining the final predicted length based on the longer of the first predicted length and the second predicted length. The process of constructing the decoder input based at least on the length prediction result and the word-level translation result includes: selecting two parts with probabilities greater than a threshold from the predicted position and probability of each word in the source language text and the predicted word and probability obtained from the word-level translation to construct the decoder input, and filling in symbols representing concealment for missing positions.
2. The method according to claim 1, wherein, The steps of predicting the length of the encoded representation corresponding to the target language text and performing word-level translation of the encoded representation corresponding to the target language include: The length of the encoded representation corresponding to the target language text is predicted. Based on the length prediction results, predict the predicted position of each word in the source language text in the target language text; The encoded representation is translated at the word level corresponding to the target language text to obtain the predicted word in the target language text for each word in the source language text; Determine the predicted position and predicted word of each word in the source language text in the target language text.
3. The method according to any one of claims 1 or 2, wherein, After constructing the decoder input based at least on the results of length prediction and word-level translation, the method further includes: The decoder is used to decode the decoder input and the encoded representation to generate target language text output, wherein the decoder includes LSTM, GRU or transformer.
4. An electronic device comprising: At least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the steps of the method according to any one of claims 1 to 3.
5. A storage medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Method, apparatus, and computer program for statistical translation decoding
US20060015323A1