A method and system for automatic pre-editing of machine translation based on controlled language

By using a controlled language-based pre-editing neural network model, combined with language rules and deep learning, the problems of high false alarm rate and poor translation quality in existing machine translation pre-editing methods are solved, achieving more efficient and accurate pre-editing results.

CN116522965BActive Publication Date: 2026-11-24NORTHWESTERN POLYTECHNICAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310594558.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-24
Publication Date
2026-11-24
Estimated Expiration
2043-05-24

AI Technical Summary

Technical Problem

Existing machine translation pre-editing methods suffer from high false alarm rates, low feasibility, and poor translation quality. In particular, rule-based rewriting methods are complex and have high false alarm rates, while pure deep learning-based methods require a large number of samples and are susceptible to adversarial examples.

Method used

We employ a controlled language-based pre-translation editing method. By using a pre-translation editing neural network model, combined with language rules and deep learning, we utilize encoder, classification network, and replication mechanism modules to identify and rewrite the source text corpus, thereby improving translation quality.

Benefits of technology

It significantly reduces ambiguity, redundancy, and logical inconsistencies in the original text, improves the accuracy and fluency of machine translation, and enhances the efficiency and accuracy of pre-editing. It is applicable to machine translation in multiple fields.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116522965B_ABST
    Figure CN116522965B_ABST
Patent Text Reader

Abstract

This invention discloses an automatic pre-translation editing method and system for machine translation based on controlled language. It improves machine translation quality by combining "language rules" with "deep learning." The invention constructs a pre-translation editing neural network model to process the source text corpus. An encoder identifies sentences in the source text corpus with translation errors, determines the error type based on the error type, and then rewrites the sentences using a decoder. Finally, a copying mechanism module corrects the errors to obtain the final pre-translation result. This method, through deep learning of controlled language rules using a neural network model, can significantly reduce ambiguity, redundancy, and logical inconsistencies in the source text, thereby improving the accuracy and fluency of the machine translation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of natural language processing and machine translation, and relates to an automatic pre-editing method and system for machine translation based on controlled language. Background Technology

[0002] In recent years, with the advancement of machine translation technology, especially since Google launched its neural network machine translation engine, the quality of machine translation has significantly improved. This progress has spurred the emergence of new language service models, with computer-aided translation (CAT) and machine translation plus post-translation editing (MTPE) gradually becoming the mainstream production modes in the translation industry. However, despite these improvements in output quality, a significant gap remains between machine translation and human translation; literal translation, rigid translation, and even mistranslation are still common. Poor readability and translatability of the source text are a major contributing factor to these machine translation errors. Therefore, pre-editing the source text before machine translation can effectively improve machine translation quality and increase the efficiency of post-translation editing.

[0003] Currently, machine translation pre-editing methods are mainly divided into two types: (1) rule-based rewriting methods; and (2) deep learning-based rewriting methods. Rule-based rewriting methods (Zhang Yujie, Yamamoto Kazuhide 2003, Ding et al. 2016) mainly formulate language rules based on the characteristics of the target language, and then rewrite the original text into a more translatable controlled language according to these rules; while deep learning-based rewriting methods (Tian, ​​W. et al. 2018; Mehta, S. et al. 2020) first transform the existing bilingual corpus into a rewriting training set through back translation, and then train the neural network model for rewriting, ultimately achieving automatic rewriting. Both of the above methods have certain drawbacks and shortcomings: on the one hand, relying solely on rule rewriting makes rule creation too complex and results in a very high false positive rate, making it impractical in engineering; on the other hand, training neural networks purely based on machine learning can effectively enable intelligent autonomous learning of various complex and atypical rules, but it requires a huge amount of samples, and the presence of adversarial examples often leads to poor final translation quality. Summary of the Invention

[0004] The purpose of this invention is to overcome the shortcomings of the prior art and provide an automatic pre-translation editing method and system for machine translation based on controlled language. Specifically, it is an automatic pre-translation editing method for artificial language with controlled vocabulary and syntax. This method and system improve the accuracy and naturalness of machine translations through deep learning of the rewriting rules of controlled language, thereby solving the problems of high false alarm rate, low feasibility and poor translation quality in existing pre-translation editing methods.

[0005] To achieve the above objectives, the present invention employs the following technical solution: An automatic pre-editing method for machine translation based on controlled language includes the following steps: Input the original text corpus that was edited before translation; The source text to be edited is processed using a pre-editing neural network model. This model includes an encoder, a classification network, n decoders, and a replication mechanism module. The encoder extracts feature vectors from sentences with translation errors in the source text. The classification network then categorizes the error types based on these feature vectors. Using the error type as a baseline, the corresponding decoder decodes and rewrites the sentences with translation errors, outputting a vector. The n decoders correspond to the n error types. The replication mechanism module processes the encoder's output vector and combines its output with the corresponding vector according to weights to obtain the pre-edited text output by the pre-editing neural network. Output the edited pre-translation text.

[0006] A further improvement of the present invention is that: Preferably, the encoder is a BERT model.

[0007] Preferably, the BERT model and classification network are trained by fine-tuning the model.

[0008] Preferably, the decoder is a Transformer model, and each decoder is a network with a masked attention layer, a multi-head attention layer and a feedforward neural network layer.

[0009] Preferably, the replication mechanism module is: (1) in, h t Let be the output vector of the i-th decoder at time t, from which the t-th target word can be obtained; H src For encoder output, softmax This is the normalization function.

[0010] Preferably, the formula for combining the output of the replication mechanism module and the output vector according to weights is as follows: (2) in, d is the word embedding dimension, |V| is the dictionary size, and W is the parameter matrix. Let L be the transpose of the parameter matrix; where sigmoid is the non-linear activation function, softmax is the normalization function, and L is the normalization function. trg Embedding vectors for target words Preferably, the process of obtaining the pre-translation editing neural network model includes the following steps: Step 1: Establish training and testing sets; each set includes original text corpus A and controlled original text A+, wherein the controlled original text A+ is the original text that has been manually confirmed and processed by pre-translation editing rules; Step 2: Establish the initial model of the pre-translation editing neural network model; Step 3: Based on the training set, train the initial model using the Adam optimizer to obtain the final pre-translation editing neural network model.

[0011] Preferably, step 1 includes the following steps: Step 1.1: Select Chinese and English texts in a specific technical field as pre-translation editing training corpus; Step 1.2: Use Chinese as the source text and English as the reference translation; Step 1.3: Obtain the machine-translated text by machine translating the original text corpus; Step 1.4: Evaluate the machine-translated text based on the reference translation. If the BLEu value is ≥0.8, the source text does not need to be edited before translation. If the BLEu value is <0.8, the source text needs to be edited before translation to obtain the source text to be edited. Step 1.5: Back-translate the reference translation, compare the back-translation result with the machine-translated text, and classify the machine-translated text corresponding to the original text to be edited as an error. Step 1.6: Develop pre-translation editing rules to address different machine-translated text errors; Step 1.7: Preprocess the machine-translated text, perform manual proofreading or translation to obtain the controlled source text A+, and combine the controlled source text A+ and the source text corpus to form the training set and the test set.

[0012] Preferably, in step 3, the process of training the initial model using the Adam optimizer is as follows: Step 3.1: Input the training set into the initial model to obtain the process corpus; Step 3.2: Calculate the error between the process corpus and the controlled original text A+, and use the Adam optimizer to iteratively optimize the initial model through backpropagation until the initial model converges to obtain the final model.

[0013] An automated pre-editing system for machine translation based on controlled language includes: The input module is used to input the original text corpus to be edited before translation; The pre-editing module processes the source text corpus to be pre-edited using a pre-editing neural network model. This model includes an encoder, a classification network, n decoders, and a replication mechanism module. The encoder extracts feature vectors from sentences in the source text containing translation errors. The classification network then categorizes these error types based on these feature vectors. Using the error type as a baseline, the corresponding decoder decodes and rewrites the sentences with translation errors, outputting a vector. The n decoders correspond to the n error types. The replication mechanism module processes the encoder's output vector and combines its output with the corresponding vector according to weights to obtain the pre-edited text output by the pre-editing neural network. The output module is used to output the edited pre-translation text.

[0014] Compared with the prior art, the present invention has the following beneficial effects: This invention discloses an automatic pre-translation editing method and system for machine translation based on controlled language. It improves machine translation quality by combining "language rules" with "deep learning." The invention constructs a pre-translation editing neural network model to process the source text corpus. An encoder identifies sentences in the source text corpus with translation errors, and based on the error type, a decoder rewrites the sentences. Simultaneously, a copying mechanism module corrects these errors, resulting in the final pre-translation result. This method, through deep learning of controlled language rules using a neural network model, can significantly reduce ambiguity, redundancy, and logical inconsistencies in the source text, thereby improving the accuracy and fluency of the machine translation. Compared to deep learning systems based on uncontrolled language, this method leverages the concise, singular, and standardized characteristics of controlled language. By training the neural network model with a large-scale controlled corpus, it improves readability and translatability, making it more consistent with the expression habits of the target language, thus enhancing the output quality of machine translation.

[0015] Compared to methods that rely solely on language rules, this approach can effectively improve the efficiency and accuracy of pre-editing. Furthermore, by using deep learning on controlled corpora that embody language rules, this method can train the network model to master these rules, improving the accuracy of pre-editing, while also avoiding conflicts arising from an excessive number of language rules, thus enhancing the efficiency of pre-editing. Attached Figure Description

[0016] Figure 1 This is a flowchart of the present invention; Figure 2 This is a flowchart illustrating the specific creation process of a dataset in one embodiment of the present invention; Figure 3This is a schematic diagram of the pre-translation editing neural network model architecture in one embodiment of the present invention. Detailed Implementation

[0017] The present invention will now be described in further detail with reference to the accompanying drawings: In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. The terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Furthermore, unless otherwise explicitly specified and limited, the terms "installed," "connected," and "linked" should be interpreted broadly. For example, they can refer to a fixed connection or a detachable connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal connection of two elements. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.

[0018] Traditional pre-editing methods that rely solely on language rules or templates are not only inefficient but also have a narrow scope. This is because language is very complex and variable, and a small number of language rules simply cannot cover all language phenomena. On the other hand, too many language rules may lead to slow system operation or even frequent errors. This method solves the above problems by using deep learning on controlled corpora that embody language rules.

[0019] First, define the relevant concepts.

[0020] Definition 1: Controlled Language. An artificial language in which vocabulary and syntax are controlled. In this invention, it is referred to as A. + A represents the controlled language, and A represents the language before it became controlled.

[0021] Definition 2: Pre-translation editing. Rewriting source text A into a controlled version A before machine translation. + .

[0022] Definition 3: Automatic pre-translation editing. This refers to the automatic pre-translation editing performed by a computer before translation, transforming A into A... + .

[0023] Definition 4: Encoder. In automatic pre-editing methods, the encoder transforms A into a vector, which is usually a neural network, such as an RNN (Recurrent Neural Network) or a feedforward neural network.

[0024] Definition 5: Decoder. In automatic pre-editing methods, the encoder's vector output is used as input and converted into corresponding text. This is typically a neural network, such as an RNN (Recurrent Neural Network) or a feedforward neural network.

[0025] One embodiment of the present invention discloses an automatic pre-translation editing method for machine translation based on controlled language. This method automatically edits the source text corpus by placing it in a pre-translation editing neural network model. The pre-translation editing neural network model includes an encoder, n decoders, and a replication mechanism module. The encoder extracts semantic features of sentences and outputs feature vectors, while simultaneously using a classification network to determine the error type of sentences in the source text corpus containing translation errors. Based on the error type, the corresponding decoder decodes and rewrites the sentences with translation errors, outputting a vector. The n decoders correspond to the n error types. The replication mechanism module processes the encoder's output vector and combines the output of the replication mechanism module with the output vector according to weights to obtain the pre-translation text output by the pre-translation editing neural network.

[0026] The automatic pre-translation editing method of the present invention can be applied to all Chinese, especially to scientific and technological literature. As one of the preferred solutions, this method is applicable to literature in a certain field. Because the pre-translation editing neural network model can be trained on the corpus of a certain technical field, the machine translation accuracy of Chinese in that field is higher.

[0027] One embodiment of the present invention discloses a method for obtaining a pre-translation editing neural network model, comprising the following steps: Step 1: Create the initial training set and initial test set for the controlled language; Step 1.1: Collect textual materials as pre-translation editing training corpus; the textual materials include corresponding Chinese and English materials; divide the pre-translation editing training corpus into three parts: language rule extraction, training set, and test set, wherein the initial training set is larger than the initial test set, which is larger than the number of language rules to be extracted.

[0028] Preferably, the pre-translation editing training corpus is typically composed of words from a specific domain, so that the final pre-translation editing neural network formed during subsequent training can also be applied to the pre-translation editing of other textual materials in that domain.

[0029] Step 1.2: Segment and align the Chinese and English sentences using segmentation software, and then manually proofread them. During the alignment process, Chinese periods are used as the unit, and the segmented English is used as the reference translation, while the Chinese is used as the original Chinese text. The segmentation software used in the segmentation process is TMXmall.

[0030] Step 1.3: Translate the Chinese text using machine translation software to obtain the machine-translated text; align the original Chinese text, the reference translation, and the machine-translated text; machine translation software includes, but is not limited to, Baidu Translate, Youdao Translate, Google Translate, etc.

[0031] Step 1.4: Evaluate the machine-translated text based on the reference translation and select the source text that needs pre-translation editing. Use the Bleu value as the selection criterion and set a Bleu value as a threshold. If the Bleu value is greater than the threshold, it means that the machine-translated text is close to the reference translation and no pre-translation editing is required. If the Bleu value is less than the threshold, it means that the machine-translated text is significantly different from the reference translation and pre-translation editing may be required. Select the source text that needs pre-translation editing based on the Bleu value, remove the source text that does not need pre-translation editing, and obtain the source text A to be edited.

[0032] Step 1.5: For the corpus to be edited, classify the original text in the corpus to be edited according to the errors in the machine translation, and obtain a total of n error types; the errors include but are not limited to logical errors, redundant information, unclear references, and missing sentence components; when a sentence has two or more errors at the same time, determine a major error type according to the severity of the translation error, and then classify and organize the original text according to the error type; Step 1.6: For each error type, formulate corresponding pre-editing rules, and collect all the pre-editing rules to obtain a pre-editing rule set.

[0033] Extract a portion of the data from the original text corpus to be edited.

[0034] Based on pre-translation editing rules, the original text A to be edited is manually edited or proofread to generate a controlled original text A+; Step 1.7: Generate a training set based on the initial training set; Step 1.8: Generate a test set based on the initial test set; The training set and the test set constitute the dataset for automatic pre-editing of machine translation. Both the training set and the test set include the controlled source text A+ rewritten based on the controlled language and the source text corpus A.

[0035] Step 2: Build and train a BERT-based pre-trained language model.

[0036] Step 2.1: Obtain a Chinese monolingual dataset; the Chinese monolingual dataset consists of original Chinese texts; preferably, the Chinese monolingual dataset consists of Chinese literature in a specific field.

[0037] Step 2.2: Construct the original BERT model with M layers; Step 2.3: Using a Chinese monolingual dataset, the BERT model is pre-trained using a random masking input sentence chunk mechanism. Pre-training the BERT model allows it to learn global semantic representations and initialize model parameters, enabling it to converge quickly and achieve better results when trained on the training set later, thus obtaining the trained BERT model.

[0038] Step 3, obtain the classification language model Step 3.1: Connect a feedforward neural network, i.e. a classification network, after the BERT model to obtain an initial classification language model; the initial classification language model can classify the n error types in step 1.5.

[0039] Step 3.2: After fine-tuning the initial classification language model using the original text corpus A from the training set in Step 1.7, a classification language model is obtained.

[0040] Step 4: Construct a pre-translation editing neural network model.

[0041] Step 4.1, Define the source sentence With the target sentence The input source sentence is used to predict the target sentence through a pre-translation editing neural network model; Step 4.2: Configure the encoder, decoder, and copy mechanism modules.

[0042] One embodiment of the present invention discloses an automatic pre-editing system for machine translation based on controlled language, comprising: The input module is used to input the original text corpus to be edited before translation, and the original text corpus belongs to a certain technical field; The pre-editing module processes the source text to be edited using a pre-editing neural network model. This model includes an encoder, n decoders, and a replication mechanism module. The encoder extracts semantic features from sentences and outputs feature vectors. Simultaneously, it combines these features with a classification network to determine the error type of sentences in the source text containing translation errors. Based on the error type, the corresponding decoder decodes and rewrites the sentences with translation errors, outputting a vector. The n decoders correspond to the n error types. The replication mechanism module processes the encoder's output vector and combines its output with the corresponding vector according to weights to obtain the pre-edited text output by the pre-editing neural network. The output module is used to output the edited pre-translation text.

[0043] The following is a further explanation with reference to specific embodiments: Example 1 like Figure 2 As shown, the specific method includes the following steps: Step 1: Create a controlled language training set and a test set; Step 1.1: Collect abstracts of academic papers in the aerospace field as training material for pre-translation editing; The total number of paper abstracts is 21,300, of which 300 are used for extracting language rules, 18,000 are used as the initial training set, and 3,000 are used as the initial test set.

[0044] The main text of the 23,100 papers in step 1.1 was extracted and segmented into sentences to form a Chinese monolingual dataset in the aerospace field.

[0045] The corpus examples consist of abstract numbers, Chinese abstracts, English abstracts, Chinese terms, and English terms.

[0046] Step 1.2: Segment the Chinese and English summaries and align the Chinese and English sentences accordingly; TMXmall software was used to segment and align Chinese and English sentences, followed by manual proofreading. The alignment of Chinese and English is based on Chinese periods, not English periods, which can result in one Chinese sentence corresponding to two or more English sentences. The Chinese abstract serves as the original text, while the English abstract serves as a reference translation. The English abstract was obtained through human translation.

[0047] Step 1.3: Perform machine translation on the Chinese paper abstract to obtain the machine-translated text; Select a Chinese paper abstract and input it sentence by sentence into Baidu Machine Translate for online translation; Align the machine-translated text with the original Chinese text and the reference translation; Step 1.4: Select source texts that require pre-translation editing based on the quality of the machine translation; The machine-translated texts are evaluated based on reference translations, and the source texts that require pre-translation editing are selected. The specific process involves using the Bleu value as a screening criterion. If the Bleu value is ≥ 0.8, it indicates that the machine-translated text is relatively close to the reference translation, and no pre-translation editing of the original text is required. If the Bleu value is < 0.8, it indicates that the machine-translated text differs significantly from the reference translation, and pre-translation editing may be necessary, i.e., pre-translation editing of the original text before machine translation.

[0048] Exclude the corpus that does not require pre-translation editing, retain the corpus that requires pre-translation editing, and obtain the original text corpus to be edited; Step 1.5: Classify the original text in the corpus to be edited based on machine translation errors; Errors in machine-translated texts are categorized, such as: Error Category 1 Logical Error Error Category 2 Redundant Information Error Category 3: Unclear Reference Error Category 4: Missing Sentence Components ……… Error Category N Other It's important to note that in many cases, a sentence may contain two or more errors simultaneously. It's necessary to determine a primary error type based on the severity of the translation errors, and then categorize and organize the source text according to these error types. Additionally, sentences with obvious translation problems, but whose modification methods are complex and cannot be fully extracted into the "Other" category (Error Category N), will be directly assigned to a category and removed from the source text before translation and editing.

[0049] Step 1.6: Develop pre-translation editing rules for different types of machine translation errors; For example, the following is a pre-editing rule for logical error classes: Logical error class: Original text A: In order to quickly and accurately retrieve the required remote sensing image resources from a massive remote sensing image database, a remote sensing image retrieval and localization method based on knowledge graph is proposed.

[0050] Baidu translation before editing: In order to quickly and accurately retrieve therequired remote sensing image resources from the massive remote sensing image database, a remote sensing image retrieval and positioning method based on knowledge atlas is proposed. The machine translation quality assessment revealed that the machine translation engine copied the word order of the original text, resulting in a translation that does not conform to the English logical thinking and expression habits of prioritizing semantic focus. This constitutes a logical error and requires word order adjustment.

[0051] Pre-translation editing rules: Word order adjustment If a sentence contains the preposition "in order to", and the clause following "in order to" contains the word "propose", then the word order needs to be adjusted. Select the clause "in order to" and move it after the clause containing "propose".

[0052] Controlled original text A+: This paper proposes a remote sensing image retrieval and localization method based on knowledge graphs to quickly and accurately retrieve the required remote sensing image resources from a massive remote sensing image database.

[0053] Baidu translation after editing: A remote sensing image retrieval and positioning method based on knowledge atlas is proposed to quickly and accurately retrieve the required remote sensing image resources from the massive remote sensing image database. Define a set of pre-editing rules { Rule1; Rule2; Rule3... Rule... n} Step 1.7: Based on the set of pre-translation editing rules, perform controlled editing on the source text corpus to form a training set; A training set of 18,000 aerospace abstract corpora was selected for corpus preprocessing. The specific preprocessing process is as follows: the online word segmentation and tagging system (CUCBst) is used to segment the corpus into sentences and tag parts of speech; the tagging of parts of speech is to mark gerunds, adjectives, etc.

[0054] Example: Given the current problems of low automation levels and product quality dependence on operator skill in welding of aerospace products, there is an urgent need to adopt robotic intelligent welding technology to achieve "replacing humans with robots".

[0055] First, there are 110,000 data points. We then extract 10,000 data points from this corpus, which is... Figure 2 The process on the right side begins with a direct translation, using BLUE values ​​to identify sentences requiring pre-translation editing. Then, a back-translation is performed using the original reference translation to obtain controlled language A+. By comparing the original text corpus A with the back-translated controlled language A+, pre-translation editing rules for each type of error are determined, resulting in a pre-translation editing set. Finally, the remaining 100,000 data points are manually edited according to these rules to form controlled language A+.

[0056] Based on the set of pre-translation editing rules, the training corpus is manually edited and proofread; a controlled dataset is created so that after processing, the controlled dataset becomes a controlled language A+; However, the set of manually defined pre-translation editing rules has low coverage and cannot cover all linguistic phenomena. Therefore, for Chinese original texts that still have problems but for which explicit editing rules cannot be extracted (i.e., Error Category N other categories), manual translation is performed to form controlled language A+.

[0057] Remove word segmentation and part-of-speech tagging from the output controlled summary corpus.

[0058] Step 1.8: Create the test set, following the same process as the training set; Step 1.9: At this point, the original abstract corpus A and the original corpus A+ rewritten based on controlled language constitute the dataset for automatic pre-editing of machine translation.

[0059] Step 2: Build and train a BERT-based pre-trained language model.

[0060] Step 2.1: Extract the main text of the 23,100 papers from Step 1.1 and segment them into sentences to form a Chinese monolingual dataset in the aerospace field.

[0061] Step 2.2: Construct a 6-layer BERT model, which is the original BERT model.

[0062] Step 2.3: Using the Chinese monolingual dataset for the aerospace field created in Step 2.1, the BERT model is pre-trained using a random masking input sentence chunk mechanism. This allows the BERT model to learn the global semantic representation first and initialize the model parameters, so that the model can converge quickly and achieve better results when trained with the training set later.

[0063] Step 3: Fine-tune the BERT pre-trained language model using a downstream classification task to obtain a language model that can perform classification.

[0064] Step 3.1: Using the BERT model from Step 2, connect a feedforward neural network after it. This network is a classification network and can perform n classification problems (n refers to the number of categories that cause machine translation errors, as summarized in Step 1.5).

[0065] Step 3.2: Using the original text corpus A in the training set created in Step 1, train and fine-tune the BERT+ neural network by fine-tuning the model, adjust the parameters in the model, and obtain a network that can classify. The specific steps for fine-tuning are as follows: Input a sentence (x1.....x m1The BERT model outputs a two-dimensional matrix (y1.....y) of semantic feature vectors for the sentence. m1 ) T Then, this feature vector is input into a feedforward neural network, which outputs a one-dimensional probability distribution matrix (z1......z n ), where n is the number of categories, z i This represents the probability that the sentence belongs to the i-th class, with a probability between 0 and 1.

[0066] Step 4: Construct a pre-editing neural network model, which includes an encoder and a decoder; Specifically, such as Figure 3 As shown, the model construction includes the following steps: Step 4.1: Define the source sentence With the target sentence The input source sentence and the target sentence predicted by the pre-translation editing neural network model; Step 4.2: Use the BERT model fine-tuned in Step 3 as the encoder for this step. The encoder output is... , d is the word embedding dimension, |V| is the dictionary size, where H src The meaning is the output of the encoder. encoder For the BERT model, L src The meaning is the input of the encoder. The encoder extracts the feature vector of the source sentence, which is then passed to the classification network in vector form to classify the error type of the source sentence.

[0067] Step 4.3: Construct n decoder modules to decode and rewrite sentences with n types of machine translation errors. The decoder is the original decoder of the Transformer model, and each decoder module is a single-layer network with a masked attention layer, a multi-head attention layer, and a feedforward neural network layer. The decoder output at time t is... h t Let y be the output vector of the i-th decoder at time t, from which the t-th target word can be obtained; 1...t-1 This represents the feature distribution of the first t-1 predicted target words, i.e., the t-th target word predicted using the i-th decoder. d represents the word embedding dimension, and |V| represents the dictionary size.

[0068] The decoder decodes the output of the encoder to obtain the initial target sentence; the input is the encoder output and the decoded target word, i.e., the word decoded before time t-1, which is shown in the following decoder formula.

[0069] Step 4.4: Construct a replication mechanism module to reduce the overcorrection problem and the out-of-vocabulary problem of the model. The replication mechanism is shown in Equation (1).

[0070] (1) Among them, h t Let H be the output vector of the i-th decoder at time t, from which the t-th target word can be obtained; src The encoder output is 'softmax', which is the normalization function. For the output of the decoder take Parameter matrix, K For encoder output take Parameter matrix. Then make Multiplying by K yields And then Normalization will yield the output of the replication module. .

[0071] q t K and V are the query, key, and value used by the multi-head attention mechanism in the decoder, which are shared in the replication module; , and These are all trainable parameters of the model.

[0072] Step 4.5: Weight the outputs of the copy mechanism module and the decoder module. Combined, the final output representation of the automatic pre-editing model is obtained, as shown in equation (2).

[0073] (2) in, d is the word embedding dimension, |V| is the dictionary size, and W is the parameter matrix. Let L be the transpose of the parameter matrix; where sigmoid is the non-linear activation function, softmax is the normalization function, and L is the normalization function. trg Let L be the target word embedding vector, and R be the target word embedding vector. dx|V| trg represents the target side. P c To copy the output of the module, P d The output of the decoder module, For A in equation (1) t The transpose of .

[0074] Step 5: Use the training set created in Step 1, and simultaneously use the Adam optimizer to iterate and optimize the model from Step 4.

[0075] Step 5.1: The forward propagation process during training consists of 5 steps, see... Figure 3 The five steps to winning the bid are as follows: First, the input sentence is classified and predicted (BERT + classification network). Then, based on the prediction results, a decoder is selected to use. Next, the input is fed into the encoder (BERT), then flows through the selected decoder, and the encoder's output flows through the replication module. Finally, the outputs of the decoder module and the replication module are integrated according to the weights to obtain the final output, which is the process corpus; (the calculated A+). Step 5.2: Compare the final output with the reference controlled corpus A + Error calculations are performed, followed by backpropagation to optimize the parameters of each module and improve the model's robustness. During backpropagation, only the parameters of the encoder, decoder, and copy modules are iteratively optimized until the model converges.

[0076] Step 6: Input the test set into the optimized automatic pre-editing neural network model to obtain the pre-editing result, and then input the pre-edited source sentence into the machine translation model to obtain the translation result based on the pre-editing.

[0077] Machine translation is performed on the original text corpus A to obtain the translated text corpus B1. The original text corpus A is input into the pre-editing neural network model, and the model outputs the controlled language A to be evaluated. - + Then A - + Machine translation yields the translation B2.

[0078] Step 7: Use BLEU as a machine translation quality assessment indicator to evaluate the pre-editing effect.

[0079] The formula for calculating BLEU is shown in equation (4) below: (4) in: BLEU is the final BLEU score. BP is the penalty factor, lc represents the length of the candidate translation, and lr is the length of the reference translation. P n Score for each n-gram, where n is an integer. [1, 4], W n The weight, i.e., W n =1 / n, where n takes the value of 4, meaning that at most 4-gram precision is used for calculation. C i Let i be the i-th translation to be evaluated, i.e., the candidate translation. E, where E represents a total of E candidate translations. R i This represents the reference translation corresponding to the i-th candidate translation. An N-gram represents a set of phrases of length n words, where K is the size of the phrase set and k is the k-th phrase. This represents the number of times the k-th phrase in the i-th candidate translation appears within itself. This indicates the number of times the k-th phrase in the i-th candidate translation appears in the reference translation; Based on the reference translation corpus B, and according to the BLEU formula described above, implement the code. Calculate the translation quality assessment value BLeu1 for the translated text corpus B1; Calculate the translation quality assessment value Bleu2 for the translated text corpus B2; If Bleu2 > Bleu1, then the pre-editing method is proven to be effective.

[0080] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for automatic pre-translation editing in machine translation based on controlled language, characterized in that, Includes the following steps: Input the original text corpus that was edited before translation; The source text to be edited is processed by a pre-editing neural network model. The pre-editing neural network model includes an encoder, a classification network, n decoders and a replication mechanism module. The encoder extracts feature vectors of sentences with translation errors in the source text, and the classification network classifies the error types based on the feature vectors. Based on the error type of the sentence, the decoder corresponding to the error type decodes and rewrites the sentence with translation errors, and outputs a vector. There are n decoders corresponding to n error types. After processing the encoder output vector, the copy mechanism module combines the output of the copy mechanism module and the output vector according to the weights to obtain the pre-translated text output by the pre-translation editing neural network. The process of obtaining the pre-translation editing neural network model includes the following steps: Step 1: Establish training and testing sets; each set includes original text corpus A and controlled original text A+, wherein the controlled original text A+ is the original text that has been manually confirmed and processed by pre-translation editing rules; Step 2: Establish the initial model of the pre-translation editing neural network model; Step 3: Based on the training set, train the initial model using the Adam optimizer to obtain the final pre-translation editing neural network model; Step 1 includes the following steps: Step 1.1: Select Chinese and English texts in a specific technical field as pre-translation editing training corpus; Step 1.2: Use Chinese as the source text and English as the reference translation; Step 1.3: Obtain the machine-translated text by machine translating the original text corpus; Step 1.4: Evaluate the machine-translated text based on the reference translation. If the BLEu value is ≥0.8, the source text does not need to be edited before translation. If the BLEu value is <0.8, the source text needs to be edited before translation to obtain the source text to be edited. Step 1.5: Back-translate the reference translation, compare the back-translation result with the machine-translated text, and classify the machine-translated text corresponding to the original text to be edited as an error. Step 1.6: Develop pre-translation editing rules to address different machine-translated text errors; Step 1.7: Preprocess the machine-translated text, perform manual proofreading or manual translation on the machine-translated text to obtain the controlled source text A+, and combine the controlled source text A+ and the source text corpus to form the training set and the test set; Output the edited pre-translation text.

2. The automatic pre-editing method for machine translation based on controlled language according to claim 1, characterized in that, The encoder is a BERT model.

3. The automatic pre-editing method for machine translation based on controlled language according to claim 1, characterized in that, The BERT model and classification network are trained by fine-tuning the model.

4. The automatic pre-editing method for machine translation based on controlled language according to claim 1, characterized in that, The decoder is a Transformer model, and each decoder is a network with a masked attention layer, a multi-head attention layer, and a feedforward neural network layer.

5. The automatic pre-editing method for machine translation based on controlled language according to claim 1, characterized in that, The replication mechanism module is: (1) in, h t Let be the output vector of the i-th decoder at time t, from which the t-th target word can be obtained; H src For encoder output, softmax q is the normalization function; t K and V are the queries used by the multi-head attention mechanism in the decoder. , and These are all trainable parameters of the model. Depend on Multiplying by K, we get For q t The transpose of P c This is for copying the module's output.

6. The automatic pre-editing method for machine translation based on controlled language according to claim 1, characterized in that, The formula for combining the output and output vector of the replication mechanism module according to their weights is as follows: (2) in, d is the word embedding dimension, V is the value matrix in the multi-head attention mechanism, and W is the parameter matrix. Let L be the transpose of the parameter matrix; where sigmoid is the non-linear activation function, softmax is the normalization function, and L is the normalization function. trg For target word embedding vectors, h t Let P be the output vector of the i-th decoder at time t. c P represents the output of the copying module, P is the final output representation of the model, and ω is the weighting coefficient between the output of the copying mechanism module and the output of the decoder module. d The output of the decoder module, For A in equation (1) t The transpose of .

7. The automatic pre-editing method for machine translation based on controlled language according to claim 1, characterized in that, In step 3, the process of training the initial model using the Adam optimizer is as follows: Step 3.1: Input the training set into the initial model to obtain the process corpus; Step 3.2: Calculate the error between the process corpus and the controlled original text A+, and use the Adam optimizer to iteratively optimize the initial model through backpropagation until the initial model converges to obtain the final model.

8. A controlled language-based automatic pre-editing system for implementing the method of claim 1, characterized in that, include: The input module is used to input the original text corpus to be edited before translation; The pre-translation editing module is used to process the source text corpus to be pre-translated using a pre-translation editing neural network model. The pre-translation editing neural network model includes an encoder, a classification network, n decoders, and a replication mechanism module. The encoder extracts feature vectors of sentences with translation errors in the source text corpus, and the classification network classifies the error types based on the feature vectors. Based on the error type of the sentence, the decoder corresponding to the error type decodes and rewrites the sentence with translation errors, and outputs a vector. There are n decoders corresponding to n error types. After processing the encoder output vector, the copy mechanism module combines the output of the copy mechanism module and the output vector according to the weights to obtain the pre-translated text output by the pre-translation editing neural network. The output module is used to output the edited pre-translation text.

Citation Information

Patent Citations

  • Encoder-decoder framework pre-training method for neural machine translation

    CN111382580A

  • Lightweight machine translation method based on convolutional neural network and translation model

    CN115081461A