A data screening method based on translation ease
By introducing the translation ease index into machine translation, sentences that are beneficial to the machine translation system are filtered out, the problem of data enhancement noise is solved, the performance and training efficiency of the translation system are improved, and it is suitable for language pairs with scarce resources.
Patent Information
- Application Number
- CN202210618305.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-01
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2042-06-01
AI Technical Summary
In machine translation, data enhancement methods based on word replacement have noise problems and lack a clear measurement standard for the quality of the enhanced sentences, which affects the model training effect.
A data screening method based on the ease of translation is used to generate new sentences through word replacement. The monolingual language model and the two-way translation model are used to calculate the weight of the sentences, and the sentences that are beneficial to the translation system are screened out, and the top 70% of the sentences are retained for training.
It effectively reduces the amount of training data, improves the performance of the translation system, reduces hardware resource requirements, improves model convergence and training speed, and provides a quality measure for data enhancement.
Smart Images

Figure CN115034237B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a data screening method and belongs to the technical field of computer information screening. Background Art
[0002] For natural language processing tasks, there may be a problem of insufficient resources, which is mainly due to insufficient language resources or insufficient resources in the field considered, which will lead to low resource problems; for machine translation tasks, the introduction of the end-to-end neural encoder-decoder neural network structure in 2013 achieved a breakthrough in machine translation tasks, and was soon promoted to neural machine translation (NMT). Currently, NMT is the dominant technology used in this task.
[0003] Unlike other natural language processing (NLP) tasks, machine translation occurs between two languages. Therefore, in machine translation systems, the quality of translation of a language pair depends on the number of parallel corpora available between the languages under consideration. For some language resource-rich language pairs (such as English and French), there is no problem of relatively scarce resources because researchers have created a large number of parallel corpora over the years. However, for many of the more than 7,000 languages currently used in the world, the requirement of having a large amount of parallel data is not a realistic assumption. Even if a specific language has a large monolingual corpus and still has a small parallel corpus with another language, this language pair is also considered a low-resource language pair for NMT tasks. Therefore, translation between low-resource language pairs becomes a major challenge.
[0004] One solution is to generate data artificially, which is called data augmentation. That is, these techniques can be applied regardless of the NMT architecture used. Data augmentation is used to create additional data by modifying existing data or adding data from different sources for training machine learning models. For machine translation problems, data augmentation is used to generate synthetic parallel sentence pairs to train data-centric machine translation models. And data augmentation technology usually does not change the NMT architecture, but generates data to train these neural architectures, so it has great research potential; currently, one of the main methods of data augmentation is a word replacement-based method, in which a subset of sentences is selected from an existing parallel or monolingual corpus, and new synthetic sentences are generated by replacing words or phrases in the selected sentence set; this method is efficient and universal, but there is also a problem, that is, there is no clear standard to measure the quality of the enhanced sentences so far. If the enhanced data noise is very large, it will have a certain impact on the training of the model. If the change to the existing sentences is not large, then no additional information gain can be provided to the model. Therefore, the present invention proposes a measurement method to screen the parallel sentence pairs after data augmentation to ensure that the model obtains better training results. Summary of the invention
[0005] The present invention aims to solve the problem of poor data quality in the process of machine translation data enhancement, and further proposes a data screening method based on translation ease.
[0006] The technical solution adopted by the present invention to solve the above problems is: the specific steps of the present invention are as follows:
[0007] Step 1: amplify the original parallel data using the word replacement method;
[0008] Step 2: Use the original training corpus to obtain a monolingual language model, a forward translation model, and a reverse translation model;
[0009] Step 3: Use the monolingual language model to score the newly added sentences and obtain the first weight;
[0010] Step 4: Use the forward translation model to translate the newly expanded sentence to obtain a reconstructed sentence, use the reverse translation model to translate the newly expanded sentence to obtain another reconstructed sentence, and calculate the bleu value between the two reconstructed sentences as the second weight;
[0011] Step 5: Perform weighted summation on the weights calculated twice in step 3 and step 4, arrange them in order from small to large weights, and retain the top 70% of the training sentences in the sorting results according to the weight scores.
[0012] Furthermore, in step 3, the first weight obtained by scoring the newly expanded sentence using the monolingual language model is:
[0013]
[0014] In formula (1), s represents the newly expanded sentence, s t Indicates the word at position t in the current sentence s, s <t represents all the words before position t in sentence s, P LM (s t |s <t ) represents a language model that predicts the word at position t to be s based on all the words before position t t What is the probability of the final output P LM (s t |s <t ) is a decimal between 0 and 1, and then take the log of this value; finally, perform the same calculation for each position, from position 1 to the last position |s|, where |s| represents the length of sentence s; add up all the calculated values and finally get the length of the sentence |s|.
[0015] Furthermore, the score of the reconstructed sentence obtained by using the forward translation model and the reverse translation model in step 4 is:
[0016] s′=M t→s (M s→t (s)) (2),
[0017] x2=bleu(s,s′) (3),
[0018] In formula (2) and formula (3), M s→t represents a translation model from the source end to the target end, that is, a forward translation model, M s→t (s) means translating the sentence s at the source end into the sentence t at the target end, M t→s It represents a translation model from the target end to the source end, that is, a reverse translation model. The input is a sentence t from the target end, and the final output is a sentence s′ which also belongs to the source language. Finally, the bleu value between the two source language sentences s and s′ is calculated, and the result is used as the second weight.
[0019] Furthermore, in step 5, the final weight of a sentence s is the weighted sum of the previous two weights x1 and x2:
[0020] x(s)=α1x1+α2x2 (4),
[0021] In formula (4), α1 represents the weight ratio parameter of weight x1 when participating in the calculation of the final weight x(s), and α2 represents the weight ratio parameter of weight x2 when participating in the calculation of the final weight x(s).
[0022] The beneficial effect of the present invention is that the data screening method based on translation simplicity described in the present invention overcomes the noise problem introduced by the previous word replacement-based method in the process of data enhancement, that is, sentences that cannot bring information gain to the translation system will be screened out, and only those new sentences that are beneficial to the system will be retained, and it also provides a measurement standard for subsequent data enhancement work.
[0023] The present invention introduces the evaluation index in machine translation, namely, translation simplicity, into the data enhancement work based on word replacement for the first time, and uses it as a screening index to screen the amplified sentences; the present invention can reduce the amount of training data while ensuring that the performance of the translation system does not decrease, and has a certain degree of improvement, which can not only reduce the demand for hardware resources, but also help to improve the convergence and training speed of the model, and this screening strategy can be applied to most data screening methods and language pairs.
[0024] In addition, the present invention does not use additional corpus resources. The language model and bidirectional translation model required in the experiment are trained based on the existing bidirectional parallel corpus without introducing any external data. This is more applicable to some language pairs with scarce resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 It is a flow chart of the present invention. DETAILED DESCRIPTION
[0026] Specific implementation method 1: Combination Figure 1 The present embodiment is described. The data screening method based on the ease of translation described in the present embodiment is implemented by the following steps:
[0027] Step 1: amplify the original parallel data using the word replacement method;
[0028] Step 2: Use the original training corpus to obtain a monolingual language model, a forward translation model, and a reverse translation model;
[0029] Step 3: Use the monolingual language model to score the newly added sentences and obtain the first weight;
[0030] Step 4: Use the forward translation model to translate the newly expanded sentence to obtain a reconstructed sentence, use the reverse translation model to translate the newly expanded sentence to obtain another reconstructed sentence, and calculate the bleu value between the two reconstructed sentences as the second weight;
[0031] Step 5: Perform weighted summation on the weights calculated twice in step 3 and step 4, arrange them in order from small to large weights, and retain the top 70% of the training sentences in the sorting results according to the weight scores.
[0032] Specific implementation method 2: Combination Figure 1 To illustrate this embodiment, in step 3 of the data screening method based on translation ease described in this embodiment, the first weight obtained by scoring the newly expanded sentence using a monolingual language model is:
[0033]
[0034] In formula (1), s represents the newly expanded sentence, s t Indicates the word at position t in the current sentence s, s <t represents all the words before position t in sentence s, P LM (s t |s <t ) represents a language model that predicts the word at position t to be s based on all the words before position t t What is the probability of the final output P LM (s t |s <t ) is a decimal between 0 and 1, and then take the log of this value; finally, perform the same calculation for each position, from position 1 to the last position |s|, where |s| represents the length of sentence s; add up all the calculated values and finally get the length of the sentence |s|.
[0035] Specific implementation method three: Combination Figure 1 To illustrate this embodiment, the score of the reconstructed sentence obtained by using the forward translation model and the reverse translation model in step 4 of the data screening method based on translation ease described in this embodiment is:
[0036] s′=M t→s (M s→t (s)) (2),
[0037] x2=bleu(s,s′) (3),
[0038] In formula (2) and formula (3), M s→t represents a translation model from the source end to the target end, that is, a forward translation model, M s→t (s) means translating the sentence s at the source end into the sentence t at the target end, M t→sIt represents a translation model from the target end to the source end, that is, a reverse translation model. The input is a sentence t from the target end, and the final output is a sentence s′ which also belongs to the source language. Finally, the bleu value between the two source language sentences s and s′ is calculated, and the result is used as the second weight.
[0039] Specific implementation method four: Combination Figure 1 To illustrate this embodiment, in step 5 of the data screening method based on translation ease described in this embodiment, the final weight of a sentence s is the weighted sum of the previous two weights x1 and x2:
[0040] x(s)=α1x1+α2x2 (4),
[0041] In formula (4), α1 represents the weight ratio parameter of weight x1 when participating in the calculation of the final weight x(s), and α2 represents the weight ratio parameter of weight x2 when participating in the calculation of the final weight x(s).
[0042] How it works
[0043] All the parallel sentence pairs after amplification are taken as the objects for screening, and two strategies are adopted to calculate the ease of translation. First, a language model is obtained by training with the original data set, and the language model is used for the subsequent measurement and calculation of ease. Then, the forward and reverse translation models need to be obtained by training with the existing data. After obtaining the three models, the score of the new data after amplification is calculated as the first weight according to the language model, and then the sentence is successively sent to the forward translation model and the reverse translation model to obtain a reconstructed sentence. The bleu value between the reconstructed sentence and the original sentence is calculated as the second weight. Finally, the two weights are weighted and summed, and the sentences are sorted from small to large, and the sentence pairs with scores in the top 70% are retained.
[0044] Example
[0045] Embodiment 1:
[0046] This embodiment proposes a data screening method based on translation ease for machine translation data enhancement. The specific process of the candidate answer screening method is shown in Table 1:
[0047] Table 1: A data screening method based on translation ease for machine translation data augmentation
[0048]
[0049]
[0050] The above is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technician familiar with this profession can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present invention. However, any simple modification, equivalent replacement and improvement made to the above embodiments without departing from the content of the technical solution of the present invention, based on the technical essence of the present invention, within the spirit and principles of the present invention, still fall within the protection scope of the technical solution of the present invention.
Claims
1. A data screening method based on ease of translation, characterized in that: The data screening method based on translation ease is implemented by the following steps: Step 1: amplify the original parallel data using the word replacement method; Step 2: Use the original training corpus to obtain a monolingual language model, a forward translation model, and a reverse translation model; Step 3: Use the monolingual language model to score the newly added sentences and get the first weight. The first weight obtained by scoring the newly added sentences using the monolingual language model is: In formula (1), s represents the newly expanded sentence, s t Indicates the word at position t in the current sentence s, s <t represents all the words before position t in sentence s, P LM (s t |s <t ) represents a language model that predicts the word at position t to be s based on all the words before position t t What is the probability of the final output P LM (s t |s <t ) is a decimal between 0 and 1, and then take the log of this value; finally, perform the same calculation for each position, from position 1 to the last position |s|, where |s| represents the length of sentence s; add up all the calculated values and finally get the length of the sentence |s|; Step 4: Use the forward translation model to translate the newly expanded sentence to obtain a reconstructed sentence, and use the reverse translation model to translate the newly expanded sentence to obtain another reconstructed sentence. Calculate the bleu value between the two reconstructed sentences as the second weight; the score of the reconstructed sentence obtained by the forward translation model and the reverse translation model is: s′=M t→s (M s→t (s))(2), x2=bleu(s,s′)(3), In formula (2) and formula (3), M s→t represents a translation model from the source end to the target end, that is, a forward translation model, M s→t (s) means translating the sentence s at the source end into the sentence t at the target end, M t→s Represents a translation model from the target end to the source end, that is, a reverse translation model. The input is a sentence t from the target end, and the final output is a sentence s′ that also belongs to the source language. Finally, the bleu value between the two source language sentences s and s′ is calculated, and the result is used as the second weight; Step 5: Perform weighted summation on the weights calculated twice in step 3 and step 4, arrange them in order from small to large weights, and retain the top 70% of the training sentences in the sorting results according to the weight scores.
2. The method for screening data based on ease of translation according to claim 1, characterized in that: In step 5, the final weight of a sentence s is the weighted sum of the previous two weights x1 and x2: x(s)=α1x1+α2x2(4), In formula (4), α1 represents the weight ratio parameter of weight x1 when participating in the calculation of the final weight x(s), and α2 represents the weight ratio parameter of weight x2 when participating in the calculation of the final weight x(s).
Citation Information
Patent Citations
Chinese-Vietnamese pseudo-parallel corpus generation method fusing monolingual language model
CN111709254A
Neural machine translation method based on feature attenuation screening
CN114330377A
