A Chinese-Vietnamese neural machine translation method based on sample loss weighted denoising
By introducing a weighted loss function of confidence and comprehensive evaluation score, the problem of noise interference in low-resource language translation of Hanyue is solved, and the translation performance and robustness of the model are improved. Especially when there is a lot of noise data, more efficient Hanyue neural machine translation is achieved.
Patent Information
- Application Number
- CN202310564947.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-18
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2043-05-18
AI Technical Summary
In the translation of Hanyue low resource language, there is noise and error information in synthetic data, which affects the training performance of the model. The existing methods will reduce the data scale when data is filtered, resulting in poor model training.
By introducing a confidence metric quantization model's confidence in the translation training sample, combining the comprehensive evaluation scores of cross-language sentence similarity, sentence alignment and sentence fluency, it is used to constrain the training loss of the translation model and reduce noise interference. The Bayesian neural network is used to quantify the confidence of the translation model, and dynamically adjust the training process through the weighted loss function.
It effectively improves the translation performance of Hanyue neural machine, reduces noise interference, improves the generalization ability and translation quality of the model, especially when the proportion of noise data is high, it shows good robustness and robustness.
Smart Images

Figure CN116595997B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a Chinese-Vietnamese neural machine translation method based on sample loss weighted denoising, and belongs to the technical field of natural language processing. Background Art
[0002] Back-translation and pivoting methods are widely used to address the low-resource Chinese-Vietnamese language translation problem. However, the synthetic data generated by these methods contains noise and error information, which can affect the performance of subsequent steps and negatively impact model training. Furthermore, neural network models are highly sensitive to noisy data, which can degrade model performance. Therefore, effective methods are needed to reduce noise interference and improve translation performance. To address this issue, several researchers have proposed novel approaches. For example, Xu et al. proposed a method that uses semantic similarity scores calculated from bilingual word embeddings to filter out noise. By selecting sentence pairs based on these scores, better synthetic parallel data is obtained. Dou et al. proposed a novel method for iterative back-translation selection and weighting based on sentence quality. This method uses a combination of different scores, such as round-trip BLEU and language model scores, to select the best sentences. The method then uses the similarity of encoder representations and the consistency between the forward and backward models to weight the back-translation data for the remaining sentences. However, the types of noise in datasets from different sources often vary significantly, requiring targeted analysis and different evaluation strategies to obtain optimal synthetic parallel data. Furthermore, for the Chinese-Vietnamese low-resource language pair, using data filtering methods can reduce the data size and lead to poor model training. Therefore, a Chinese-Vietnamese neural machine translation method based on sample loss weighted denoising is proposed. Confidence is introduced to quantify whether the current model is confident in the translation training samples, and the model confidence is used to determine the learning focus. Summary of the Invention
[0003] The present invention provides a Chinese-Vietnamese neural machine translation method based on sample loss weighted denoising, which is used to solve the problems of insufficient Chinese-Vietnamese parallel corpus and the presence of noise and erroneous information in synthetic data, and effectively improves the performance of Chinese-Vietnamese neural machine translation.
[0004] The technical solution of the present invention is: a Chinese-Vietnamese neural machine translation method based on sample loss weighted denoising, and the specific steps of the method are as follows:
[0005] Step 1: First, obtain Chinese-Vietnamese bilingual data and build a bilingual corpus;
[0006] Step 2. Then calculate the cross-language sentence similarity, sentence alignment, and sentence fluency of each training sample to obtain a comprehensive evaluation score, and use it as a factor to measure the loss of its corresponding example;
[0007] Step 3: Then evaluate the training data and calculate the confidence score of each training example to measure the translation model's confidence in the example, which is used as a weight to constrain the translation model training loss;
[0008] Step 4: Then, the loss is weighted according to the normalized confidence score and the comprehensive evaluation score, so that the model pays more attention to high-confidence training samples and reduces noise interference;
[0009] Step 5: Finally, iteratively train the translation model until the translation model converges.
[0010] As a further solution of the present invention, the specific steps of Step 1 are:
[0011] Step 1.1. Use crawler technology to crawl Chinese and Vietnamese parallel data on the website and remove sentences that are too long, too short, or garbled;
[0012] Step 1.2: Use Vietnamese-English parallel data to generate more Chinese-Vietnamese pseudo-parallel data by using the English-Chinese translation model;
[0013] Step 1.3. Use the jieba word segmentation tool to segment the Chinese corpus and build a Chinese-Vietnamese bilingual corpus.
[0014] As a further solution of the present invention, the specific steps of Step 2 are:
[0015] Step 2.1. Use the LaBSE sentence embedding model to calculate the similarity between Chinese and Vietnamese sentences, the sentence alignment tool fast_align to calculate the normalized sentence alignment quality of Chinese and Vietnamese sentences based on the alignment rate, and the MacBERT Chinese pre-trained language model to calculate the fluency of the generated Chinese.
[0016] Step 2.2. Calculate the quality score of each sentence pair based on the obtained Chinese and Vietnamese sentence similarity, the normalized sentence alignment quality of the Chinese and Vietnamese sentence pairs based on the alignment rate, and the fluency of Chinese, and use the quality score of each sentence pair as the comprehensive evaluation score.
[0017] As a further solution of the present invention, Step 2 includes:
[0018] Use the LaBSE sentence embedding model to calculate the similarity S between Chinese and Vietnamese sentences similarity , the sentence alignment tool fast_align calculates the normalized sentence alignment quality S of Chinese and Vietnamese sentences based on the alignment rate align And the MacBERT Chinese pre-trained language model calculates the fluency S of generated Chinese fluency , for the Chinese-Vietnamese sentence pair {(x1,y1),...,(xN ,y N )}, where the quality score of each sentence pair is as shown in formula (1)
[0019]
[0020] Where m, β, and γ are weight ratios, and their sum is 1.
[0021] As a further solution of the present invention, Step 3 includes:
[0022] A Bayesian neural network is used to quantify the confidence of the translation model in translating training samples, and the confidence of the translation model in the training examples is measured by the variance of the translation probability to obtain a confidence score.
[0023] As a further solution of the present invention, the specific steps of Step 3 are:
[0024] Step 3.1, for the current NMT model parameterized by θ and N sentence pairs {(x1,y1),...,(x N ,y N )}, for each sample, randomly disable some neurons of the NMT model and recalculate the translation probability while keeping the Chinese sentence x n Vietnamese sentence y n Fixed, this random feed-forward is repeated K times to generate K samples for sentence-level translation probabilities;
[0025] Step 3.2, calculate the variance of translation probability: For each sample, calculate the expected translation probability at the sentence level, as shown in formula (2):
[0026]
[0027] The variance of sentence-level translation probability is shown in formula (3):
[0028]
[0029] Step 3.3, calculate the nth Chinese-Vietnamese sentence pair (x n ,y n ) is shown in formula (4):
[0030]
[0031] Among them, α is a hyperparameter used to measure the difference between the scores of confident and unconfident examples. The larger the absolute value of α, the higher the discrimination method, and vice versa. (x n ,y n ) is the nth Chinese-Vietnamese sentence pair, NMT model parameters for randomly disabling some neurons of the NMT model, The NMT model parameters of some neurons are randomly disabled for the kth pass; in order to ensure the stability of the training process and maintain the same loss scale as the conventional model, softtmax is used to normalize the confidence score, as shown in formula (5):
[0032]
[0033] As a further solution of the present invention, the specific steps of Step 4 are:
[0034] Step 4.1. Take the quality score and normalized confidence score of each sentence pair as factors of weight loss, multiply the weight value by the loss function to obtain a weighted loss function, and dynamically adjust the weight of the loss function as the training step increases.
[0035] As a further solution of the present invention, Step 4 includes: calculating the quality score w of each sentence pair n and the normalized confidence score a n As a factor of weight loss, the weight value is multiplied by the loss function to obtain a weighted loss function. As the training step length increases, the weight of the loss function is dynamically adjusted, which is defined as shown in formula (6) (7):
[0036]
[0037]
[0038] Here, u is a hyperparameter, e is the number of training epochs, and μ is a decay function with a function that depends on the number of training epochs e.
[0039] The specific steps of Step 5 are:
[0040] Step 5.1. Use the gradient descent-based Adam optimization algorithm to iteratively train the translation model until the translation model converges. During the training process, use the early stopping method to avoid overfitting. That is, stop training when the BLEU value of the validation set does not improve for 10 consecutive times, thereby improving the generalization ability of the translation model.
[0041] To further illustrate the present invention, in Step 1, Step 2, Step 3, Step 4, and Step 5:
[0042] 1) Cross-language sentence similarity mentioned:
[0043] LaBSE (Language-agnostic BERT Sentence Embedding) is a language-agnostic sentence embedding model that can map sentences in different languages into the same vector space for cross-language text similarity calculation and classification tasks. LaBSE is trained on the basis of the BERT model and uses a large number of multilingual corpora for pre-training. In the sentence similarity calculation, given two sentences S1 and S2, the LaBSE sentence embedding model is used to obtain their corresponding embedding vectors E1 and E2. Then, LaBSE calculates the cosine similarity between them as their similarity score. The present invention uses the LaBSE sentence embedding tool to obtain the sentence similarity S1 between Chinese and Vietnamese. similarity .
[0044] 2) The degree of sentence alignment mentioned:
[0045] fast_align is a sentence alignment tool based on the Hidden Markov Model (HMM) that can be used for tasks such as translation and text matching in natural language processing. Its core concept is to infer correspondences between sentences by aligning their words, thereby achieving sentence alignment. Specifically, fast_align treats two sentences S1 and S2 as sequences consisting of words w1, w2, ..., wn, where wi represents the i-th word in the sentence. Then, fast_align matches each word wi in the two sentences with all the words in the other sentence, calculating the similarity between them and obtaining a similarity matrix S. Next, fast_align uses the HMM model to model this similarity matrix and infer correspondences between the sentences, namely, the corresponding positions of each word in the other sentence. In the specific sentence alignment calculation process, given two sentences S1 and S2, fast_align represents each as a word sequence and then uses the aforementioned HMM model to infer correspondences between them. For each word in each sentence, fast_align will find its corresponding position in the other sentence, thus obtaining the correspondence between the two sentences, that is, the i-th word in one sentence corresponds to the j-th word in the other sentence. The present invention calculates the normalized sentence alignment quality S of the Chinese-Vietnamese pseudo-parallel sentence pair based on the alignment rate by using the sentence word alignment tool fast_align align .
[0046] 3) Sentence fluency mentioned:
[0047] Pre-trained sentence fluency refers to a method of evaluating whether a sentence is fluent. Prediction is performed using a language model, that is, given a sentence, predict whether the sentence conforms to language rules and language habits. Specifically, pre-trained language models usually adopt a structure similar to pre-training models such as BERT and GPT, and are trained using a large-scale corpus. During the training process, the language model will try to learn various language rules and language habits so that it can predict the fluency of a sentence. When using a pre-trained language model for sentence fluency evaluation, the log-likelihood loss function (Log-Likelihood Loss) is generally used. Given a sentence, the language model calculates the probability distribution of the sentence, that is, the probability of each word appearing in the sentence, and then calculates the log-likelihood value of the sentence. The larger the log-likelihood value, the higher the fluency of the sentence, and vice versa. This chapter uses the Chinese pre-trained language model MacBERT to calculate the fluency S of the generated Chinese sentences. fluency .
[0048] The beneficial effects of the present invention are:
[0049] 1. The Chinese-Vietnamese neural machine translation method based on sample loss weighted denoising of the present invention is designed to improve the problem that Chinese-Vietnamese parallel corpora are scarce and that there is a lot of noise and erroneous information in the corpora generated by data augmentation methods such as back-translation and pivoting. Confidence is introduced to quantify whether the current model has confidence in the translation training samples. At the same time, a comprehensive evaluation score is obtained by combining cross-language sentence similarity, sentence alignment, and sentence fluency, and the model confidence is used to determine the learning focus, thereby reducing noise interference and effectively improving the performance of Chinese-Vietnamese neural machine translation. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 Diagram of the sample loss weighted training process. DETAILED DESCRIPTION
[0051] Example 1: Figure 1 As shown, a Chinese-Vietnamese neural machine translation method based on sample loss weighted denoising is described, and the specific steps of the method are as follows;
[0052] Step 1: First, obtain Chinese-Vietnamese bilingual data and build a bilingual corpus;
[0053] Step 2. Then calculate the cross-language sentence similarity, sentence alignment, and sentence fluency of each training sample to obtain a comprehensive evaluation score, and use it as a factor to measure the loss of its corresponding example;
[0054] Step 3: Then evaluate the training data and calculate the confidence score of each training example to measure the translation model's confidence in the example, which is used as a weight to constrain the translation model training loss;
[0055] Step 4: Then, the loss is weighted according to the normalized confidence score and the comprehensive evaluation score, so that the model pays more attention to high-confidence training samples and reduces noise interference;
[0056] Step 5: Finally, iteratively train the translation model until the translation model converges.
[0057] As a further solution of the present invention, the specific steps of Step 1 are:
[0058] Step 1.1. Use crawler technology to crawl Chinese and Vietnamese parallel data on the website and remove sentences that are too long, too short, or garbled;
[0059] Step 1.2: Use Vietnamese-English parallel data to generate more Chinese-Vietnamese pseudo-parallel data by using the English-Chinese translation model;
[0060] Step 1.3. Use the jieba word segmentation tool to segment the Chinese corpus and build a Chinese-Vietnamese bilingual corpus.
[0061] As a further solution of the present invention, the specific steps of Step 2 are:
[0062] Use the LaBSE sentence embedding model to calculate the similarity S between Chinese and Vietnamese sentences similarity , the sentence alignment tool fast_align calculates the normalized sentence alignment quality S of Chinese and Vietnamese sentences based on the alignment rate align And the MacBERT Chinese pre-trained language model calculates the fluency S of generated Chinese fluency , for the Chinese-Vietnamese sentence pair {(x1,y1),...,(x N ,y N )}, where the quality score of each sentence pair is as shown in formula (1)
[0063]
[0064] Where m, β, and γ are weight ratios, and their sum is 1.
[0065] As a further solution of the present invention, the specific steps of Step 3 are:
[0066] Step 3.1, for the current NMT model parameterized by θ and N sentence pairs {(x1,y1),...,(x N ,y N)}, for each sample, randomly disable some neurons of the NMT model and recalculate the translation probability while keeping the Chinese sentence x n Vietnamese sentence y n Fixed, this random feed-forward is repeated K times to generate K samples for sentence-level translation probabilities;
[0067] Step 3.2, calculate the variance of translation probability: For each sample, calculate the expected translation probability at the sentence level, as shown in formula (2):
[0068]
[0069] The variance of sentence-level translation probability is shown in formula (3):
[0070]
[0071] Step 3.3, calculate the nth Chinese-Vietnamese sentence pair (x n ,y n ) is shown in formula (4):
[0072]
[0073] Among them, α is a hyperparameter used to measure the difference between the scores of confident and unconfident examples. The larger the absolute value of α, the higher the discrimination method, and vice versa. (x n ,y n ) is the nth Chinese-Vietnamese sentence pair, NMT model parameters for randomly disabling some neurons of the NMT model, The NMT model parameters of some neurons are randomly disabled for the kth pass; in order to ensure the stability of the training process and maintain the same loss scale as the conventional model, softtmax is used to normalize the confidence score, as shown in formula (5):
[0074]
[0075] As a further solution of the present invention, the specific steps of Step 4 are:
[0076] Step 4.1. Score the quality of each sentence pair w n and the normalized confidence score a n As a factor of weight loss, the weight value is multiplied by the loss function to obtain a weighted loss function. As the training step length increases, the weight of the loss function is dynamically adjusted, which is defined as shown in formula (6) (7):
[0077]
[0078]
[0079] Here, u is a hyperparameter, e is the number of training epochs, and μ is a decay function with a function that depends on the number of training epochs e.
[0080] The specific steps of Step 5 are:
[0081] Step 5.1. Use the gradient descent-based Adam optimization algorithm to iteratively train the translation model until the translation model converges. During the training process, use the early stopping method to avoid overfitting. That is, stop training when the BLEU value of the validation set does not improve for 10 consecutive times, thereby improving the generalization ability of the translation model.
[0082] In order to illustrate the effect of the present invention, the following experiment was performed:
[0083] This paper uses the BLEU (Bilingual Evaluation Understudy) score as an indicator for evaluating the quality of Chinese-Vietnamese neural machine translation. The BLEU score measures the degree of match between a candidate translation (i.e., the sentence generated by the model to be evaluated) and a reference translation (i.e., the human translation used as the standard answer). A higher BLEU score indicates better translation quality.
[0084] Before the experiment, we removed sentence pairs longer than 200 from the parallel sentence pairs to filter the dataset in a simple way. We used 100K Chinese-Vietnamese parallel corpora and 800K Chinese-Vietnamese pseudo-parallel corpora collected by ourselves for the experiment. The final dataset is shown in Table 1:
[0085] Table 1 Dataset
[0086]
[0087] The experimental parameters are set as follows: Torch 1.8 is used as the neural network model framework, written in Python 3.8, CUDA version 11.1, and running on a single RTX A5000. Transformer is selected as the base model, with 6 layers of codec and 512 hidden layer vector dimensions, 1024 feedforward neural network, and 4096 tokens of batch size. Adam optimizer is used, with parameters β1 = 0.9 and β2 = 0.98. A warm-up strategy is used, with warm_steps set to 4000 to adjust the learning rate, and the initial learning rate is set to 0.0015
[0088] The Transformer model, the models proposed by Jiao et al., and Lu et al. are selected as the baseline models for the comparative experiments. The following is an introduction to the three models:
[0089] 1) Transformer: The original Transformer model, with parameter settings consistent with the present invention.
[0090] 2) Jiao et al.: The complex patterns and potential noise in large-scale data make training NMT models difficult. A recognition model is trained on the original training data and used to distinguish between inactive and active examples based on sentence-level output probabilities. An update model is then trained on active examples to relabel inactive examples using forward translation. The training parameters remain the same as those used in the present invention.
[0091] 3) Lu et al.: A norm-based noisy corpus filtering and updating method based on the standard Transformer. Noisy samples are separated from clean samples using the norm of the source / target context vectors. Training parameters remain the same as those in the present invention.
[0092] To verify the effectiveness of the method, we conducted experiments using the above datasets. To facilitate intuitive observation and comparison and ensure the reliability of the experimental results, the BLEU values of each set of experimental results were calculated using the same test set.
[0093] Table 2. Comparison experimental results of baseline models
[0094]
[0095]
[0096] From the experimental results in Table 2, it can be seen that the method of the present invention outperforms the Transformer baseline model at all data scales, and is slightly higher than the methods proposed by Jiao et al. and Lu and Zhang, indicating that the proposed method can effectively utilize noise data to improve the performance of the translation model in the Chinese-Vietnamese translation task. In addition, the method of the present invention also achieves good performance when the amount of pseudo-parallel data is small, which shows that the proposed method can still effectively utilize pseudo-parallel data for training when the amount of data is small. As the amount of pseudo-parallel data increases, the performance of the model is further improved, indicating that the method proposed by the present invention can effectively utilize noise data to improve the performance of the translation model. Therefore, the method proposed by the present invention can effectively weaken the noise data and improve the performance of Chinese-Vietnamese neural machine translation.
[0097] In order to verify the noise resistance of the method model proposed in this invention and for fair comparison, all experiments were conducted on a 10K data scale, using a combination of 10K clean data and 10K noisy data. The meaning of 10% is: 90% of the clean data and 10% of the noisy data.
[0098] Table 3 Experimental results of different noise ratios
[0099]
[0100] From the experimental results in Table 3, it can be seen that the method of the present invention (Our) performs better on average than the baseline model Transformer at different noise ratios. When the noise ratio is low, the performance gap between the two models is not large. However, as the noise ratio increases, the performance of the method of the present invention (Our) gradually surpasses the baseline model Transformer. Specifically, at a noise ratio of 10%, the performance of the method of the present invention and the Transformer baseline model is very close; at a noise ratio of 20%, the method of the present invention is slightly better than the Transformer baseline model; at noise ratios of 30% and 50%, the method of the present invention is significantly better than the Transformer baseline model. Therefore, the method of the present invention shows better robustness and robustness when dealing with noisy data, and has better noise resistance.
[0101] In order to verify the influence of the model confidence score and evaluation score as the weight of the model loss function on the model performance, a single score was used as the weight of the loss function to conduct experiments. The results are shown in Table 4. n To calculate only the model confidence score, w n Only sentence similarity, word alignment, and sentence fluency scores are calculated.
[0102] Table 4 Ablation experiment results
[0103]
[0104] According to the experimental data in Table 4, it can be seen that using the model confidence score and the evaluation score as the weights of the model loss function can improve the performance of the model to a certain extent. When the data scale is small, the evaluation score can bring greater benefits to the model, but as the data scale increases, the model confidence score can bring greater benefits.
[0105] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Various changes can be made within the knowledge of ordinary technicians in this field without departing from the purpose of the present invention.
Claims
1. A Chinese-Vietnamese neural machine translation method based on sample loss weighted denoising, characterized by: The specific steps of the method are as follows: Step 1: First, obtain Chinese-Vietnamese bilingual data and build a bilingual corpus; Step 2: Calculate the cross-language sentence similarity, sentence alignment, and sentence fluency of each training sample to obtain a comprehensive evaluation score. Step 3: Then evaluate the training data and calculate the confidence score of each training example, which is used as a weight to constrain the translation model training loss; Step 4: Then, the loss is weighted according to the normalized confidence score and the comprehensive evaluation score, so that the model pays more attention to high-confidence training samples and reduces noise interference; Step 5: Finally, iteratively train the translation model until the translation model converges; Step 3 includes: A Bayesian neural network is used to quantify the confidence of the translation model in translating training samples, and the confidence of the translation model in the training examples is measured by the variance of the translation probability to obtain a confidence score; Step 4 includes: calculating the quality score w of each sentence pair n and the normalized confidence score a n As a factor of weight loss, the weight value is multiplied by the loss function to obtain a weighted loss function. As the training step length increases, the weight of the loss function is dynamically adjusted, which is defined as shown in formula (1) (2): Here, u is a hyperparameter, e is the number of training epochs, and μ is a decay function with a function that depends on the number of training epochs e.
2. The Chinese-Vietnamese neural machine translation method based on sample loss weighted denoising according to claim 1 is characterized by: The specific steps of Step 1 are: Step 1.
1. Use crawler technology to crawl Chinese and Vietnamese parallel data on the website and remove sentences that are too long, too short, or garbled; Step 1.2: Use Vietnamese-English parallel data to generate more Chinese-Vietnamese pseudo-parallel data by using the English-Chinese translation model; Step 1.
3. Use the jieba word segmentation tool to segment the Chinese corpus and build a Chinese-Vietnamese bilingual corpus.
3. The Chinese-Vietnamese neural machine translation method based on sample loss weighted denoising according to claim 1, characterized in that: The specific steps of Step 2 are: Step 2.
1. Use the LaBSE sentence embedding model to calculate the sentence similarity between Chinese and Vietnamese. Use the sentence alignment tool fast_align to calculate the normalized sentence alignment quality of Chinese and Vietnamese sentences based on the alignment rate. Use the MacBERT Chinese pre-trained language model to calculate the fluency of generated Chinese. Step 2.
2. Calculate the quality score of each sentence pair based on the obtained Chinese and Vietnamese sentence similarity, the normalized sentence alignment quality of the Chinese and Vietnamese sentence pairs based on the alignment rate, and the fluency of Chinese, and use the quality score of each sentence pair as the comprehensive evaluation score.
4. The Chinese-Vietnamese neural machine translation method based on sample loss weighted denoising according to claim 3 is characterized by: Step 2 includes: Use the LaBSE sentence embedding model to calculate the similarity S between Chinese and Vietnamese sentences similarity , the sentence alignment tool fast_align calculates the normalized sentence alignment quality S of Chinese and Vietnamese sentences based on the alignment rate align And the MacBERT Chinese pre-trained language model calculates the fluency S of generated Chinese fluency , for the Chinese-Vietnamese sentence pair {(x1,y1),...,(x N ,y N )}, where the quality score of each sentence pair is as shown in formula (3): Where m, β, and γ are weight ratios, and their sum is 1.
5. The Chinese-Vietnamese neural machine translation method based on sample loss weighted denoising according to claim 1, characterized in that: The specific steps of Step 3 are: Step 3.1, for the current NMT model parameterized by θ and N sentence pairs {(x1,y1),...,(x N ,y N )}, for each sample, randomly disable some neurons of the NMT model and recalculate the translation probability while keeping the Chinese sentence x n Vietnamese sentence y n Fixed, this random feed-forward is repeated K times to generate K samples for sentence-level translation probabilities; Step 3.2, calculate the variance of translation probability: For each sample, calculate the expected translation probability at the sentence level, as shown in formula (4): Then the variance of sentence-level translation probability is as shown in formula (5): Step 3.3, calculate the nth Chinese-Vietnamese sentence pair (x n ,y n ) is shown in formula (6): Among them, α is a hyperparameter used to measure the difference between the scores of confident and unconfident examples. The larger the absolute value of α, the higher the discrimination method, and vice versa. (x n ,y n ) is the nth Chinese-Vietnamese sentence pair, NMT model parameters for randomly disabling some neurons of the NMT model, The NMT model parameters of some neurons are randomly disabled for the kth pass; in order to ensure the stability of the training process and maintain the same loss scale as the conventional model, softtmax is used to normalize the confidence score, as shown in formula (7):
6. The Chinese-Vietnamese neural machine translation method based on sample loss weighted denoising according to claim 1, characterized in that: The specific steps of Step 4 are: Step 4.
1. Take the quality score and normalized confidence score of each sentence pair as factors of weight loss, multiply the weight value by the loss function to obtain a weighted loss function, and dynamically adjust the weight of the loss function as the training step increases.
7. The Chinese-Vietnamese neural machine translation method based on sample loss weighted denoising according to claim 1, characterized in that: The specific steps of Step 5 are: Step 5.
1. Use the gradient descent-based Adam optimization algorithm to iteratively train the translation model until the translation model converges. During the training process, use the early stopping method to avoid overfitting and improve the generalization ability of the translation model.
Citation Information
Patent Citations
Multidirectional recurrent neural network machine translation model training method and device
CN113051940A
Low-resource neural machine translation method for fusing BERT knowledge into Seq2Seq model based on consistency Mixup
CN114970565A