Translation method, device and storage medium
By introducing user-determined translation precedent and cluster search decoding algorithms in machine translation, the translation model is used to predict the subsequent translation of the source text, and the problem of insufficient accuracy of existing machine translation technologies in semantic capture is solved, and higher translation accuracy is achieved.
Patent Information
- Application Number
- CN202010641748.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-06
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2040-07-06
AI Technical Summary
Existing machine translation technologies have insufficient accuracy in capturing source text semantics and cannot meet actual needs.
By introducing the user-determined pre-order part of the translation, combined with the bundled search decoding algorithm, the translation model is used to predict the subsequent translation of the source text, and the accuracy of the translated text is improved.
This method improves accuracy in machine translation, making the translation results closer to the quality of manual translation, and meets the demand for high accuracy.
Smart Images

Figure CN113901841B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to language processing technology, and more particularly, to a translation method, a translation device, and a computer-readable storage medium. Background Art
[0002] Machine translation is widely used in daily life and is also an important research direction in the field of machine learning in language processing. In the process of machine translation, it is necessary to accurately capture the semantics of the source text in order to accurately generate the corresponding translated text. The accuracy of current machine translation technology cannot meet the needs, and it is necessary to provide a new translation solution. Summary of the invention
[0003] The disclosed embodiments provide a new translation solution to improve the accuracy of the translated text.
[0004] According to a first aspect of an embodiment of the present disclosure, a translation method is provided, comprising:
[0005] Get the source text;
[0006] Translating the source text using a translation model to obtain a translation result;
[0007] receiving a modification of the translation result by a user, and determining a translation preamble of the source text according to the modification result;
[0008] The translation model is used to predict the subsequent translation according to the translation preamble of the source text to obtain a subsequent translation prediction result.
[0009] Optionally, the translation model includes an encoder and a decoder, and the decoder adopts a beam search decoding algorithm;
[0010] The using the translation model to predict the subsequent translation of the source text according to the translation preamble of the source text includes:
[0011] Initializing the translation preamble of the source text as a preamble decoding sequence of the decoder in a manner that the bundle width is 1;
[0012] The decoder is used to calculate the score of the pre-order decoding sequence and the attention weights of the decoding units in the pre-order decoding sequence; and a post-order decoding sequence is determined according to a preset beam width, the score of the pre-order decoding sequence and the attention weights of the decoding units in the pre-order decoding sequence, wherein the preset beam width is a natural number greater than 1.
[0013] Optionally, the method further comprises:
[0014] The subsequent translation prediction result is provided to a user, so that the user can determine the translation post-order part of the source text according to the subsequent translation prediction result.
[0015] Optionally, the method further comprises:
[0016] Receive user feedback on the subsequent translation prediction result, and determine the accuracy of the prediction based on the feedback.
[0017] Optionally, the translation model is a neural network model based on an attention mechanism.
[0018] According to a second aspect of an embodiment of the present disclosure, a translation device is provided, including:
[0019] An acquisition module, used to acquire source text;
[0020] A translation module, used to translate the source text using a translation model to obtain a translation result;
[0021] A first determination module is used to receive a modification of the translation result by a user, and determine a translation preamble of the source text according to the modification result;
[0022] The prediction module is used to use the translation model to predict the subsequent translation according to the translation preamble of the source text to obtain a subsequent translation prediction result.
[0023] Optionally, the translation model includes an encoder and a decoder, and the decoder adopts a beam search decoding algorithm;
[0024] The prediction module predicts the subsequent translation of the source text according to the translation preamble of the source text using the translation model, including:
[0025] Initializing the translation preamble of the source text as a preamble decoding sequence of the decoder in a manner that the bundle width is 1;
[0026] The decoder is used to calculate the score of the pre-order decoding sequence and the attention weights of the decoding units in the pre-order decoding sequence; and a post-order decoding sequence is determined according to a preset beam width, the score of the pre-order decoding sequence and the attention weights of the decoding units in the pre-order decoding sequence, wherein the preset beam width is a natural number greater than 1.
[0027] Optionally, the translation device further includes a second determination module;
[0028] The second determination module is used to receive user feedback on the subsequent translation prediction result, and determine the accuracy of the prediction according to the feedback.
[0029] According to a third aspect of an embodiment of the present disclosure, a translation device is provided, including a processor and a memory, wherein the memory stores computer instructions, and when the computer instructions are executed by the processor, the translation method of the first aspect of the present disclosure is implemented.
[0030] According to a fourth aspect of an embodiment of the present disclosure, there is provided a computer-readable storage medium on which computer instructions are stored. When the computer instructions are executed by a processor, the translation method of the first aspect of the present disclosure is implemented.
[0031] The translation method provided by the embodiment of the present disclosure introduces a translation prefix determined by a user during machine translation, thereby improving the accuracy of machine translation.
[0032] Features and advantages of embodiments of the present disclosure will become apparent from the following detailed description of exemplary embodiments of the present disclosure with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the embodiments of the present disclosure.
[0034] Figure 1 is a block diagram of a text generation system provided by an embodiment of the present disclosure;
[0035] Figure 2 is a flowchart of a translation method provided by an embodiment of the present disclosure;
[0036] Figure 3 is a schematic diagram of predicting subsequent translation provided by an embodiment of the present disclosure;
[0037] Figure 4 is a schematic diagram of a translation interface provided by an embodiment of the present disclosure;
[0038] Figure 5 is a schematic diagram of a translation interface provided by an embodiment of the present disclosure;
[0039] Figure 6 is a block diagram of a translation device provided by an embodiment of the present disclosure;
[0040] Figure 7 It is a block diagram of a translation device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0041] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings.
[0042] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the embodiments of the present disclosure and its application or uses.
[0043] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0044] The translation solution provided by the embodiments of the present disclosure can introduce user modifications to the translation during the process of machine-generated translation text, organically combine human translation and machine translation, and improve the accuracy of translation.
[0045] <Text Generation System>
[0046] Figure 1 is a block diagram of a text generation system provided by an embodiment of the present disclosure. Figure 1 As shown, the text generation system includes a server 101 providing text generation services (hereinafter referred to as "text generation server 101") and a user's terminal device 103. The text generation server 101 and the terminal device 103 can be connected to each other through a network 102 for communication.
[0047] The configuration of the text generation server 101 may include but is not limited to: a processor 1011, a memory 1012, an interface device 1013, a communication device 1014, an input device 1015, and an output device 1016. The processor 1011 may include but is not limited to a central processing unit CPU, a microprocessor MCU, etc. The memory 1012 may include but is not limited to a ROM (read-only memory), a RAM (random access memory), a non-volatile memory such as a hard disk, etc. The interface device 1013 may include but is not limited to a USB interface, a serial interface, a parallel interface, etc. The communication device 1014 may, for example, be capable of wired communication or wireless communication, and may specifically include WiFi communication, Bluetooth communication, 2G / 3G / 4G / 5G communication, etc. The input device 1015 includes but is not limited to a keyboard, a mouse, a touch screen, a microphone, etc. The output device 1016 includes but is not limited to a display screen, a speaker, etc. The configuration of the server 101 may also include only some of the above devices.
[0048] The terminal device 103 may be, for example, an electronic device installed with an intelligent operating system (e.g., Android, IOS, Windows, Linux, etc.), including but not limited to a portable computer, a desktop computer, a mobile phone, a tablet computer, etc. The configuration of the terminal device 103 includes but is not limited to a processor 1031, a memory 1032, an interface device 1033, a communication device 1034, a GPU (Graphics Processing Unit, image processor) 1035, a display device 1036, an input device 1037, a speaker 1038, a microphone 1039, and a camera 1030. The processor 1031 includes but is not limited to a central processing unit CPU, a microprocessor MCU, etc. The memory 1032 includes but is not limited to a ROM (read-only memory), a RAM (random access memory), a non-volatile memory such as a hard disk, etc. The interface device 1033 includes but is not limited to a USB interface, a serial interface, a parallel interface, etc. The communication device 1034 may, for example, be capable of wired communication or wireless communication, and may specifically include WiFi communication, Bluetooth communication, 2G / 3G / 4G / 5G communication, etc. The GPU 1035 is used to process the image. The display device 1036 includes but is not limited to a liquid crystal screen, a touch screen, etc. The input device 1037 includes but is not limited to a keyboard, a mouse, a touch screen, etc. The configuration of the terminal device 103 may also include only some of the above devices.
[0049] In one embodiment of the present disclosure, the text generation server 101 may be a server that provides translation services. A user may submit a source text and modifications to a translation result to the text generation server 101 through a terminal device 103, and the text generation server 101 may predict a subsequent translation of the source text.
[0050] In one embodiment of the present disclosure, the text generation server 101 may be a server that provides summary generation services. A user may submit source text and modifications to an initial machine-generated summary to the text generation server 101 via a terminal device 103 , and the text generation server 101 may perform subsequent summary prediction.
[0051] Figure 1The text generation system shown is merely illustrative and does not in any way imply any limitation on the embodiments of the present disclosure, its application or use. Those skilled in the art should understand that, although multiple devices of the text generation server 101 and the terminal device 103 are described above, the embodiments of the present disclosure may only involve some of the devices. For example, the text generation server 101 may only involve a processor, a memory, and a communication device, and the terminal device 103 may only involve a processor, a memory, a communication device, an input device, and a display screen. Those skilled in the art can design instructions according to the scheme disclosed in the embodiments of the present disclosure. How instructions control the processor to operate is a well-known technology in the art, so it will not be described in detail here.
[0052] <Translation Method Example>
[0053] See also Figure 2 As shown, a translation method provided by an embodiment of the present disclosure is described. The translation method can be executed by a translation device.
[0054] In a specific example, the translation device may be a terminal device equipped with offline translation software. The terminal device may be, for example, an electronic device installed with an intelligent operating system (such as Android, IOS, Windows, Linux, etc.), including but not limited to a portable computer, a desktop computer, a mobile phone, a tablet computer, etc. The terminal device may have a similar Figure 1 The hardware configuration of the terminal device is shown.
[0055] In another specific example, the translation device may be Figure 1 The text generation server 101 in.
[0056] Below Figure 1 The text generation system shown is used as an example to illustrate the translation method, which may include steps S202-S208.
[0057] S202: Obtain source text.
[0058] The user can input the source text in the human-computer interaction interface provided by the terminal device 103. The terminal device 103 uploads the source text to the translation device, and the translation device obtains the source text.
[0059] S204: Using the translation model to translate the source text to obtain a translation result.
[0060] In a specific example, after obtaining the source text, the translation device inputs the source text into the translation model, and the translation model translates the source text to obtain a translation result, that is, an initial machine translation of the source text. The translation device sends the initial machine translation of the source text to the terminal device 103, and the terminal device 103 displays the initial machine translation of the source text to the user.
[0061] The translation model can be a neural network-based machine translation model (Neural Machine Translation, NMT), which can directly learn the mapping of an input sentence in one language to an output sentence in another language. The NMT model adopts an encoder-decoder architecture. Specifically, the source text is first learned using an encoder to construct a vector representing the semantics of the source text, and then the decoder processes the semantic vector to obtain the translation. In this way, the NMT model solution can capture the long-term dependencies of the language (such as grammatical structure, etc.) and produce a more fluent translation.
[0062] The encoder and decoder can be implemented using a recurrent neural network, a convolutional neural network, or a neural network based on an attention mechanism. A recurrent neural network (RNN) is a type of recurrent neural network that takes sequence data as input, recursively in the direction of sequence evolution, and all nodes are connected in a chain. A convolutional neural network (CNN) is a type of feedforward neural network that includes convolution calculations and has a deep structure. Recurrent neural networks have memory, parameter sharing, and Turing completeness, and convolutional neural networks have representation learning capabilities. Both have application advantages in natural language processing (NLP), speech recognition, language modeling, text generation, machine translation, and other fields. A neural network based on an attention mechanism can use the attention mechanism to select key information for processing in the process of processing a large amount of information, which is conducive to improving the efficiency and accuracy of the neural network.
[0063] In a specific example, the translation model may be a Transformer model, which is a natural language translation model based on an encoder-decoder architecture and implemented using a neural network based on an attention mechanism.
[0064] The translation model can generate target words in sequence from left to right to form a translation. The process of the translation model translating the source text to obtain the translation result can be a process of predicting the target word from the vocabulary.
[0065] S206: receiving the user's modification of the translation result, and determining the translation preamble of the source text according to the modification result.
[0066] The terminal device 103 displays the translation result, that is, the initial machine translation of the source text, to the user, and the user can modify the translation result through the terminal device 103, and the terminal device submits the modified result to the translation device. After receiving the translation result, the translation device determines the translation preamble of the source text according to the translation result.
[0067] In translation work, due to different ways of expression in different languages, the word order of the source text and its translation is not necessarily the same. In the embodiments of the present disclosure, the "translation preamble" does not refer to the translation of the first part of the source text, but refers to the first part of the translation of the source text. Similarly, the "translation postamble" does not refer to the translation of the second part of the source text, but refers to the latter part of the translation of the source text.
[0068] The translation preamble of the source text includes all the contents from the beginning of the initial machine translation to the modification end position. For example, the initial machine translation of the source text includes 50 translation words in total, the user approves the first i translation words, disapproves the i+1 translation word, and the user modifies the i+1 translation word, then the translation from the first translation word to the modified i+1 translation word will be determined as the translation preamble of the source text.
[0069] S208: using the translation model to predict the subsequent translation according to the translation preamble of the source text, to obtain a subsequent translation prediction result.
[0070] The translation device uses the translation model to predict subsequent translations. The following uses the translation model based on the encoder-decoder architecture with an attention mechanism as an example to illustrate how to predict subsequent translations:
[0071] The translation model can generate target words from left to right to form a translation. The translation model translates the source text to obtain the translation result, that is, the process of predicting the target word from the word list. The subsequent translation prediction results predicted by the translation model may be one or more.
[0072] In the machine translation scenario, the translation word y predicted at the tth decoding time step is t , depends on the source text X, and the predicted translation words y1,…,y from the 1st decoding time step to the t-1th decoding time step t-1 , that is:
[0073] p(y t |{y1,…,y t-1},X)=g(y t-1 ,c t ,st )
[0074] Among them, p() represents probability, g() represents the decoder network, c t Generate the translation word y for the tth decoding time step t The context variable s t is the hidden state of the decoder at the t-th decoding time step.
[0075] In the embodiment of the present disclosure, the translation preamble of the source text includes the translation word Target word The translated word Target word are successively regarded as the translation word predicted at the first decoding time step, ..., the translation word at the t-1th decoding time step, then the decoder predicts the translation word y at the tth decoding time step t The probability is:
[0076]
[0077] In a specific example, the decoder uses the beam search algorithm to predict the target word. Beam search is a heuristic graph search algorithm, usually used when the graph solution space is relatively large. In order to reduce the space and time occupied by the search, some nodes with poor quality are cut off at each step of depth expansion, and some nodes with higher quality are retained. This reduces space consumption and improves time efficiency. Beam search uses beam width to limit the number of possible words retained at each step.
[0078] When the decoder adopts a beam search algorithm, the process of predicting the translation post-order part of the source text may include steps S2082-S2086.
[0079] S2082: Initialize the translation preamble of the source text as a preamble decoding sequence of the decoder in a manner that the bundle width is 1.
[0080] In a specific example, the translation preamble can be segmented to obtain each decoding unit (token) in the preamble decoding sequence. The decoding unit is the basic unit of decoding, which can be a word, a letter (character), or a letter fragment (subword). In the disclosed embodiment, a letter fragment (subword) can be used to count the number of occurrences of letter strings (that is, letter fragments) in a large-scale monolingual, and fix the high-frequency letter fragments as a basic decoding unit (token).
[0081] S2084. Use the decoder to calculate the score of the previous decoding sequence and the attention weight of the decoding unit in the previous decoding sequence.
[0082] In a specific example, the score of the preamble decoding sequence may be the product of the probabilities of each decoding unit in the preamble decoding sequence at the position.
[0083] S2086. Determine a post-order decoding sequence according to a preset beam width, scores of decoding units in a pre-order decoding sequence, and attention weights of decoding units in a pre-order decoding sequence, wherein the preset beam width is a natural number greater than 1.
[0084] See also Figure 3 In a specific example shown, the source text and the translation preamble of the source text are provided to the translation model. According to the beam width of 1, the preamble decoding sequence determined according to the translation preamble of the source text is "q1-r1", which includes the only decoding unit q1 of the first decoding time step t1 and the only decoding unit r1 of the second decoding time step t2. The decoder starts from the third decoding time step t3 and performs a local optimal search according to the beam width of 3 (that is, the preset beam width is 3) until an end symbol appears (the end symbol indicates the end of the translation). Specifically, at the third decoding time step t3, the three local optimal solutions after the decoding unit r1 are s1, s2, and s3. At the fourth decoding time step t4, the three local optimal solutions after decoding unit s1 are e1, e2, e3, the three local optimal solutions after decoding unit s2 are u1, u2, u3, and the three local optimal solutions after decoding unit s3 are v1, v2, v3. Only the three best decoding units e3, u2, v3 are retained. At the fifth decoding time step t5, the three local optimal solutions after decoding unit e3 are z1, z2, z3. The decoding unit u2 is followed by the terminator, and the decoding unit v3 is followed by the terminator. At the sixth decoding time step t6, the decoding unit z3 is followed by the terminator. The three sets of decoding sequences that are finally retained are "q1-r1-s1-e3-z3", "q1-r1-s2-u2", and "q1-r1-s3-v3". In a specific example, the second half of the three decoding sequences, namely "s1-e3-z3", "s2-u2", and "s3-v3", are used as subsequent translation prediction results. In another specific example, the scores of the decoding sequences "q1-r1-s1-e3-z3", "q1-r1-s2-u2", and "q1-r1-s3-v3" are calculated respectively, and the second half of the decoding sequence with the highest score is used as the subsequent translation prediction result.
[0085] After the translation device obtains the subsequent translation prediction result, it sends the subsequent translation prediction result to the terminal device 103. The terminal device 103 displays the subsequent translation prediction result to the user, so that the user can determine the translation post-order part of the source text according to the subsequent translation prediction result. That is, after step S208, the user can see the translation pre-order part of the source text (the translation pre-order part is determined based on machine translation and user modification), and the subsequent translation prediction result predicted by the machine based on the translation pre-order part, and the user can use the subsequent translation prediction result to determine the translation post-order part of the source text.
[0086] In a specific example, the user accepts the subsequent translation prediction result, that is, does not modify the subsequent translation prediction result, and uses the subsequent translation prediction result as the translation post-sequence part of the source text. In a specific example, there are multiple subsequent translation prediction results obtained in step S208, and the user can select one subsequent translation prediction result as the translation post-sequence part of the source text.
[0087] In another specific example, if the user does not approve the subsequent translation prediction result and modifies the subsequent translation prediction result, steps S206-S208 are performed again, that is, the translation device redetermines the translation prefix of the source text and predicts the subsequent translation based on the redetermined translation prefix.
[0088] The user's acceptance, modification, and selection of the subsequent translation prediction results are all feedback from the user on the subsequent prediction translation results. The terminal device 103 can upload the user's feedback on the subsequent prediction translation results to the translation device. The translation device can determine the accuracy of the translation model prediction based on the user's feedback on the subsequent translation prediction results, thereby improving the translation model. For example, the total number of subsequent predictions and the number of times the user modifies the subsequent prediction results are counted, and the ratio of the number of times the user modifies the subsequent prediction results to the total number of subsequent predictions is calculated as the prediction accuracy of the translation model.
[0089] Figure 4 2 is a schematic diagram of a translation interface of a translation method based on an embodiment of the present disclosure. The translation application installed in the terminal device provides a Chinese-to-English translation service, and the content on the translation interface includes a Chinese source text area, an English translation area, and a translation button 200. The user can enter the Chinese source text to be translated in the Chinese source text area, "Due to heavy rain, the game was delayed for half an hour."
[0090] After the user directly clicks the translation button 200, the terminal device translates the source text to obtain a translation result, that is, an initial machine translation text. The initial machine translation text of the Chinese source text "The match was delayed for half an hour because of the heavy rain" will appear in the English translation area of the translation interface.
[0091] The user modified the initial machine translated text by changing "because" to "due". The translation preamble includes the part from the beginning to "due", that is, "The match was delayed for half an hour due".
[0092] The translation device predicts the subsequent translation prediction result "to heavy rain" based on the Chinese source text "The match was delayed for half an hour due" and the English translation preamble "The match was delayed for half an hour due".
[0093] Figure 5 The translation interface diagram of the translation method according to the embodiment of the present disclosure includes a first language source text area, a second language translation area, and a translation button.
[0094] The user can input the source text "xxxxxxxxx" of the first language to be translated in the first language source text area, and obtain the translation result "aa-bb-cc-dd-ee", wherein "aa", "bb", "cc", "dd", and "ee" respectively represent a translated word in the second language. The user modifies the translated word "dd" to "gg", and the translation prefix is "aa-bb-cc-gg". The translation device predicts the subsequent translation based on the translation prefix "aa-bb-cc-gg", and obtains three subsequent translation prediction results, namely, the translated word "kk", the translated word "ss", and the translated word "rr". The user selects the translated word "ss" from the three subsequent translation prediction results, and the final translation of the source text "xxxxxxxxx" is "aa-bb-cc-gg-ss".
[0095] The translation method of the embodiment of the present disclosure can introduce user modifications to the translation during the process of machine-generated translation text, organically combine manual translation and machine translation, and improve the accuracy of translation. The translation method of the embodiment of the present disclosure allows users to intervene in the generation of translation in real time, and can predict the subsequent translation based on the previous translation modified by the user, meeting the needs of human-computer interaction for translation. The translation method of the embodiment of the present disclosure can organically combine manual translation and machine translation, allowing the technology of machine translation to better assist manual translation and improve translation speed.
[0096] The translation method of the embodiment of the present disclosure can provide the translation results and the predicted results of subsequent translations to users such as enterprises, translation companies, and individuals, providing these users with accurate and fast translation services. Enterprises, translation companies, and individuals can obtain the translation results and the predicted results of subsequent translations through the translation software installed on their terminal devices. Enterprises, translation companies, and individuals can also access the text generation server through their terminal devices to obtain the translation results and the predicted results of subsequent translations. The translation method of the embodiment of the present disclosure can introduce manual modification of the translation in the process of machine-generated translation text, organically combining manual translation and machine translation, thereby improving the accuracy of translation and the speed of translation.
[0097] <Translation Device Embodiment>
[0098] Figure 6 is a schematic diagram of a translation device 20 provided by an embodiment of the present disclosure. The translation device 20 includes the following modules:
[0099] The acquisition module 21 is used to acquire the source text.
[0100] The translation module 22 is used to translate the source text using the translation model to obtain a translation result.
[0101] The first determination module 23 is used to receive the modification of the translation result by the user, and determine the translation preamble part of the source text according to the modification result.
[0102] The prediction module 24 is used to predict the subsequent translation according to the translation preamble of the source text using the translation model to obtain the subsequent translation prediction result.
[0103] In a specific example, the translation model includes an encoder and a decoder, and the decoder adopts a beam search decoding algorithm.
[0104] The prediction module uses the translation model to predict the subsequent translation of the source text based on the translation prequel of the source text, including:
[0105] Initialize the translation preamble of the source text as the preamble decoding sequence of the decoder in a way that the beam width is 1;
[0106] The decoder is used to calculate the score of the previous decoding sequence and the attention weight of the decoding unit in the previous decoding sequence; and the post-order decoding sequence is determined according to a preset beam width, the score of the previous decoding sequence and the attention weight of the decoding unit in the previous decoding sequence, wherein the preset beam width is a natural number greater than 1.
[0107] In a specific example, the translation device 20 may further include a second determination module. The second determination module is configured to receive user feedback on subsequent translation prediction results and determine the accuracy of the prediction based on the feedback.
[0108] In a specific example, the translation model is a neural network model based on an attention mechanism.
[0109] Figure 7 3 is a schematic diagram of a translation device 30 provided by an embodiment of the present disclosure. The translation device 30 includes a processor 31 and a memory 32. The memory 32 stores computer instructions. When the computer instructions are executed by the processor 31, the translation method disclosed in any of the above embodiments is implemented.
[0110] The translation device of the embodiment of the present disclosure can introduce user modifications to the translation during the process of machine-generated translation text, organically combine manual translation and machine translation, and improve the accuracy of translation. The translation device of the embodiment of the present disclosure allows the user to intervene in the translation generation in real time, and can predict the subsequent translation based on the previous translation modified by the user, meeting the needs of human-computer interaction for translation. The translation device of the embodiment of the present disclosure can organically combine manual translation and machine translation, allowing the technology of machine translation to better assist manual translation and improve translation speed.
[0111] <Text summary generation method embodiment>
[0112] The embodiment of the present disclosure provides a text summary generation method. The text summary generation method can be executed by a text summary generation device.
[0113] In a specific example, the text summary generating device may be a terminal device equipped with offline text summary generating software. The terminal device may be, for example, an electronic device installed with an intelligent operating system (such as Android, IOS, Windows, Linux, etc.), including but not limited to a portable computer, a desktop computer, a mobile phone, a tablet computer, etc. The terminal device may have a similar Figure 1 The hardware configuration of the terminal device is shown.
[0114] In another specific example, the terminal device of the offline text summary generation software can be Figure 1 The text generation server 101 in.
[0115] The text summary generation method provided by this embodiment is described below. The text summary generation method includes the following steps:
[0116] S302: Obtain source text.
[0117] S304: Generate an initial summary based on the source text using a text summary generation model.
[0118] S306: Receive the user's modification of the initial abstract, and determine the abstract preamble according to the modification result.
[0119] S308. Use the text summary generation model to predict the subsequent summary according to the preamble of the summary to obtain a subsequent summary prediction result.
[0120] The text summary generation model can be based on a neural network text summary generation model. The text summary generation model can be an encoder-decoder structure, and the encoder and decoder can be implemented using a recurrent neural network, a convolutional neural network, or a neural network based on an attention mechanism. The text summary generation model can generate a summary of target words in order from left to right. The process of generating a summary based on the source text by the text summary generation model can be a process of predicting the target word from a vocabulary.
[0121] When the decoder adopts the beam search algorithm, the process of predicting the subsequent summary may also include steps S3082-S3086.
[0122] S3082: Initialize the summary preamble of the source text as a preamble decoding sequence of the decoder in a manner that the bundle width is 1.
[0123] S3084. Use the decoder to calculate the score of the previous decoding sequence and the attention weight of the decoding unit in the previous decoding sequence.
[0124] S3086. Determine a post-order decoding sequence according to a preset beam width, a score of a decoding unit in a pre-order decoding sequence, and an attention weight of a decoding unit in a pre-order decoding sequence, wherein the preset beam width is a natural number greater than 1.
[0125] Steps S302-S308 are similar to the aforementioned steps S202-208, and steps S3082-S3086 are similar to the aforementioned steps S2082-S2086. For specific details, please refer to the aforementioned steps and no further explanation will be given here.
[0126] In a specific example, the text summary generation method further includes: providing a subsequent summary prediction result to a user, so that the user can determine a subsequent part of the summary according to the subsequent summary prediction result.
[0127] In a specific example, feedback from users on subsequent summary prediction results is received, and the accuracy of the prediction is determined based on the feedback.
[0128] The text summary generation method of the embodiment of the present disclosure allows the user to intervene in the summary generation in real time, and can predict the subsequent summary according to the summary prefix modified by the user. The text summary generation method of the embodiment of the present disclosure can introduce the user's modification of the summary during the machine-generated summary to improve the accuracy of the summary.
[0129] The embodiment of the present disclosure also provides a text summary generation device, including a processor and a memory, wherein the memory stores computer instructions, and when the computer instructions are executed by the processor, the text summary generation method disclosed in any of the aforementioned embodiments is implemented.
[0130] <Computer Readable Storage Medium Embodiment>
[0131] The embodiments of the present disclosure also provide a computer-readable storage medium on which computer instructions are stored. When the computer instructions are executed by a processor, the translation method disclosed in any of the aforementioned embodiments is implemented.
[0132] The embodiments of the present disclosure also provide a computer-readable storage medium on which computer instructions are stored. When the computer instructions are executed by a processor, the text summary generation method disclosed in any of the aforementioned embodiments is implemented.
[0133] Each embodiment in the present disclosure is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and equipment embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0134] The above describes specific embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0135] The embodiments of the present disclosure may be systems, methods and / or computer program products. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the embodiments of the present disclosure.
[0136] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.
[0137] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0138] The computer program instructions for performing the operation of the embodiments of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of a computer-readable program instruction, and the electronic circuit may execute a computer-readable program instruction, thereby realizing various aspects of the embodiments of the present disclosure.
[0139] Various aspects of the embodiments of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0140] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0141] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0142] The flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the systems, methods and computer program products according to multiple embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of an instruction, and a part of a module, a program segment or an instruction contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of the boxes in the block diagram and / or the flowchart can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that it is equivalent to implement it by hardware, implement it by software, and implement it by combining software and hardware.
[0143] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A translation method, characterized in that: include: Get the source text; Translating the source text using a translation model to obtain a translation result; receiving a modification of the translation result by a user, and determining a translation preamble of the source text according to the modification result; The translation model is used to predict a subsequent translation according to a translation preamble of the source text to obtain a subsequent translation prediction result, wherein the subsequent translation prediction result is determined based on a post-order decoding sequence with the highest score in at least one group of decoding sequences, the at least one group of decoding sequences is obtained based on a local search of a pre-order decoding sequence, the pre-order decoding sequence is obtained based on a word segmentation process of a translation preamble of the source text, and the post-order decoding sequence is determined according to a preset beam width, a score of the pre-order decoding sequence, and an attention weight of a decoding unit in the pre-order decoding sequence.
2. According to the method of claim 1, the translation model comprises an encoder and a decoder, and the decoder adopts a beam search decoding algorithm; The using the translation model to predict the subsequent translation of the source text according to the translation preamble of the source text includes: Initializing the translation preamble of the source text as a preamble decoding sequence of the decoder in a manner that the bundle width is 1; The decoder is used to calculate the score of the pre-order decoding sequence and the attention weights of the decoding units in the pre-order decoding sequence; and a post-order decoding sequence is determined according to a preset beam width, the score of the pre-order decoding sequence and the attention weights of the decoding units in the pre-order decoding sequence, wherein the preset beam width is a natural number greater than 1.
3. The method according to claim 1, further comprising: The subsequent translation prediction result is provided to a user, so that the user can determine the translation post-order part of the source text according to the subsequent translation prediction result.
4. The method according to claim 1, further comprising: Receive user feedback on the subsequent translation prediction result, and determine the accuracy of the prediction based on the feedback.
5. According to any one of the methods described in claims 1 to 4, the translation model is a neural network model based on an attention mechanism.
6. A translation device, characterized in that: include: An acquisition module, used to acquire source text; A translation module, used to translate the source text using a translation model to obtain a translation result; A first determination module is used to receive a modification of the translation result by a user, and determine a translation preamble of the source text according to the modification result; A prediction module is used to use the translation model to predict the subsequent translation according to the translation preamble of the source text to obtain a subsequent translation prediction result, wherein the subsequent translation prediction result is determined based on a post-order decoding sequence with the highest score in at least one group of decoding sequences, the at least one group of decoding sequences is obtained based on a local search of a pre-order decoding sequence, the pre-order decoding sequence is obtained based on a word segmentation process of the translation preamble of the source text, and the post-order decoding sequence is determined according to a preset beam width, the score of the pre-order decoding sequence, and the attention weight of the decoding unit in the pre-order decoding sequence.
7. The translation device according to claim 6, wherein the translation model comprises an encoder and a decoder, and the decoder adopts a beam search decoding algorithm; The prediction module predicts the subsequent translation of the source text according to the translation preamble of the source text using the translation model, including: Initializing the translation preamble of the source text as a preamble decoding sequence of the decoder in a manner that the bundle width is 1; The decoder is used to calculate the score of the pre-order decoding sequence and the attention weights of the decoding units in the pre-order decoding sequence; and a post-order decoding sequence is determined according to a preset beam width, the score of the pre-order decoding sequence and the attention weights of the decoding units in the pre-order decoding sequence, wherein the preset beam width is a natural number greater than 1.
8. The translation device according to claim 6, further comprising a second determination module; The second determination module is used to receive user feedback on the subsequent translation prediction result, and determine the accuracy of the prediction according to the feedback.
9. A translation device, characterized in that: The invention comprises a processor and a memory, wherein the memory stores computer instructions, and when the computer instructions are executed by the processor, the translation method according to any one of claims 1 to 5 is implemented.
10. A computer-readable storage medium having computer instructions stored thereon, wherein the computer instructions, when executed by a processor, implement the translation method according to any one of claims 1 to 5.