An unsupervised word-level translation quality evaluation method and system based on a pre-training model attention mechanism
By adopting an unsupervised method based on the attention mechanism of pre-trained models, we can directly use the self-attention matrices of XLM-RoBERTa and XLM-Align to evaluate the lexical translation quality, which solves the problem of strong dependence on labeled data and achieves efficient automatic evaluation in multiple languages and domains, and is suitable for scenarios where labeled data is scarce.
Patent Information
- Application Number
- CN202311229851.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-22
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2043-09-22
AI Technical Summary
Existing technologies rely heavily on labeled data for lexical-level translation quality assessment, making it difficult to apply effectively to new language pairs and domains. Existing methods also experience performance degradation when there are significant differences in language and domain distribution, and the quality of automatically generated pseudo-data affects model performance.
We employ a pre-trained model attention mechanism, deploying multilingual pre-trained models XLM-RoBERTa and XLM-Align to obtain the self-attention matrix of the Transformer layer. We then analyze the attention weights between the word to be evaluated and the other words, using this as a score for lexical-level translation quality assessment. This avoids the pre-training process and directly utilizes the model's latent translation quality assessment knowledge.
It achieves lexical-level translation quality assessment without the need for labeled data, improving the automation and broad applicability of the assessment. It is applicable to language pairs and domains with scarce labeled data, and approaches the performance of supervised systems.
Smart Images

Figure CN117350306B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of lexical-level translation quality assessment, and more particularly to an unsupervised lexical-level translation quality assessment method based on the attention mechanism of a pre-trained model. Background Technology
[0002] Lexical-level vocabulary evaluation (QE) refers to the automatic assessment of the output of a machine translation system without relying on a reference translation, identifying translation errors and inaccuracies to guide the improvement and optimization of the translation system. This provides an effective feedback mechanism for machine translation system developers, contributing to improved translation quality. However, due to the scarcity of training data, the application of supervised lexical-level QE is limited, hindering its widespread use in machine translation research and applications. Previous lexical-level QE methods typically used recurrent neural networks or pre-trained models as a foundation, requiring training on thousands or tens of thousands of annotated corpora. However, the subjectivity of translation and the diversity of domains make QE data annotation difficult, hindering its application to new language pairs and domains.
[0003] To address the dependence of lexical-level QE on labeled data, previous studies have explored methods based on transfer learning and data augmentation. These methods aim to utilize off-domain labeled data or large-scale unlabeled data and automatically generated labels to train models, thereby reducing the need for labeled data and improving the model's generalization ability on lexical-level QE tasks. A 2021 paper published by Ranasinghe et al., "An exploratory analysis of multilingual word-level quality estimation with cross-lingual Transformers" (Ranasinghe T, Orasan C, Mitkov R. An exploratory analysis of multilingual word-level quality estimation with cross-lingual Transformers[J]. arXiv preprint arXiv:2106.00143,2021.), attempted to generalize a lexical-level QE model trained on independent corpus pairs to other language pairs for lexical-level QE in scenarios without labeled data. However, the performance of this method drops sharply when the distribution of the languages and domains being evaluated differs significantly. The existing technology, published in 2021, is the paper "Quality estimation without human-labeled data" (Tuan YL, El-Kishky A, Renduchintala A, et al. Quality estimation without human-labeled data[J]. arXiv preprint arXiv:2102.04020,2021.8). Tuan et al. used automatically generated pseudo-data and labels for training on the QE task, completing the QE task solely based on unlabeled corpora. However, their method still requires automatically constructing supervised data, and the model performance is affected by the quality of the pseudo-data. In particular, if the language pair to be evaluated does not have a large-scale unlabeled data, the method cannot be trained. Summary of the Invention
[0004] This invention addresses the problem of existing technologies' strong dependence on labeled data for sink-level QE, and proposes an unsupervised lexical-level translation quality assessment method based on the attention mechanism of a pre-trained model. The scheme is as follows:
[0005] An unsupervised lexical-level translation quality assessment method based on the attention mechanism of a pre-trained model, the method comprising:
[0006] S1: Deploy two multilingual pre-trained models, XLM-RoBERTa and XLM-Align;
[0007] S2: Obtain the self-attention matrices of the Transformer layers of the two pre-trained models;
[0008] S3: Based on the self-attention matrix of the Transformer layer of the pre-trained model, perform successive analysis of the attention weights of the word to be evaluated and the other words, and use the attention weights as the score for the quality assessment of the word-level translation.
[0009] Furthermore, a preferred embodiment is also provided, wherein step S2 includes:
[0010] Get a single header of a single Transformer layer;
[0011] Based on the single head attention of the single Transformer layer, for each word mt in the translation. i Calculate attention scores;
[0012] Construct an attention matrix for a single head based on the attention scores;
[0013] The self-attention matrices of the Transformer layers of the two pre-trained models are obtained by merging the attention matrices of each individual head.
[0014] Furthermore, a preferred embodiment is also provided, wherein step S3 includes:
[0015]
[0016] Among them, Head l A represents the set of all attention matrices that the input sequence passes through the l-th layer Transformer, and A represents the attention matrix of a certain head of the l-th layer Transformer.
[0017] Furthermore, a preferred embodiment is provided in which the XLM-Align-base model has 12 Transformer layers, and each Transformer layer has 12 attention heads.
[0018] Furthermore, a preferred approach is also provided, wherein the method further includes treating the quality assessment of the lexical-level translation as a binary classification task, using the F1 score as the evaluation metric.
[0019] Furthermore, a preferred embodiment is provided, wherein the formula for calculating the F1 score is:
[0020]
[0021] Where Precision represents the model's precision in the vocabulary-level QE task, Recall represents the recall rate, and F1_Score represents the F1 score.
[0022] Based on the same inventive concept, this invention also provides an unsupervised lexical-level translation quality assessment system based on a pre-trained model attention mechanism, the system comprising:
[0023] The deployment unit is used to deploy two multilingual pre-trained models, XLM-RoBERTa and XLM-Align.
[0024] The self-attention matrix acquisition unit is used to acquire the self-attention matrices of the Transformer layers of two pre-trained models;
[0025] The scoring unit is used to perform successive analysis of the attention weights of the word to be evaluated and the other words based on the self-attention matrix of the Transformer layer of the pre-trained model, and to use the attention weights as the score for the quality assessment of the word-level translation.
[0026] Based on the same inventive concept, the present invention also provides a computer-readable storage medium for storing a computer program that executes an unsupervised lexical-level translation quality assessment method based on a pre-trained model attention mechanism as described in any of the preceding claims.
[0027] Based on the same inventive concept, the present invention also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor runs the computer program stored in the memory, the processor executes an unsupervised lexical-level translation quality assessment method based on a pre-trained model attention mechanism according to any one of the above.
[0028] The advantages of this invention are:
[0029] This invention solves the problem of the strong dependence of existing technologies on labeled data for sink-level QE.
[0030] This invention presents an unsupervised lexical-level translation quality assessment method based on the attention mechanism of a pre-trained model. It proposes a technical solution different from existing technologies, overcoming the bias that existing technologies require pre-training of two multilingual pre-trained models, XLM-RoBERTa and XLM-Align. By starting directly from the multilingual pre-trained model, it avoids the pre-training process and mines the potential translation quality assessment knowledge within the model's attention matrix. When the sentence to be evaluated is input into the pre-trained model, the self-attention matrix of the Transformer layer of the pre-trained model is extracted, and the attention weights between the word to be evaluated and the other words are analyzed sequentially. These attention weights are used as scores for lexical-level QE. The attention mechanism-based method provides a more targeted evaluation of bilingual alignment.
[0031] The method described in this invention was tested on the MLQE dataset, which includes high, medium, and low-resource language pairs such as English-German, English-Chinese, Russian-English, Estonian-English, Romanian-English, Nepali-English, and Sinhala-English. Experimental results show that the method described in this invention, without relying on any labeled or unlabeled training data, outperforms supervised systems based on recurrent neural networks and approaches supervised systems based on multilingual pre-trained models, proving the effectiveness of the method. This invention was also compared with unsupervised lexical-level QE based on large models, further demonstrating the utility of the method described in this invention.
[0032] This invention is applied to the field of artificial intelligence. Attached Figure Description
[0033] Figure 1 This is a schematic diagram of an unsupervised lexical-level translation quality assessment method based on a pre-trained model attention mechanism, as described in Implementation Method 1.
[0034] Figure 2 The heat map showing the effect of different heads of Sinhala-English material based on XLM-Align as described in Implementation Method 5;
[0035] Figure 3 This is the vocabulary-level QE prompt template for the large model described in Implementation Method Eleven. Detailed Implementation
[0036] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.
[0037] Implementation Method 1: This implementation method describes an unsupervised lexical-level translation quality assessment method based on a pre-trained model attention mechanism. The method includes:
[0038] S1: Deploy two multilingual pre-trained models, XLM-RoBERTa and XLM-Align;
[0039] S2: Obtain the self-attention matrices of the Transformer layers of the two pre-trained models;
[0040] S3: Based on the self-attention matrix of the Transformer layer of the pre-trained model, perform successive analysis of the attention weights of the word to be evaluated and the other words, and use the attention weights as the score for the quality assessment of the word-level translation.
[0041] This implementation adopts an unsupervised approach, solving the problem of large amounts of labeled training data. Traditional supervised lexical-level QE methods require a large amount of labeled data, while this implementation utilizes the self-attention mechanism of a pre-trained model to perform lexical-level translation quality assessment without labeled data. Furthermore, this implementation utilizes the self-attention matrix of the Transformer layer in the pre-trained models (XLM-RoBERTa and XLM-Align). The self-attention mechanism allows the model to automatically capture key information when analyzing the relationship between the word to be evaluated and other words, without requiring labeled data for training.
[0042] This implementation overcomes the bias of existing technologies that require pre-training of two multilingual pre-trained models, XLM-RoBERTa and XLM-Align. It directly deploys these two models, directly inputting the source and translation texts of the corpus pair to be evaluated into each model, without requiring additional training. The self-attention matrix of the Transformer layer is obtained from these pre-trained models. The self-attention matrix is the matrix of attention weights assigned to each word in the input sequence. By progressively analyzing the attention weights of the word to be evaluated with other words, a word-level translation quality score can be generated. This score reflects the relationship between the word to be evaluated and its context, thus assessing the translation quality. The greatest advantage of this implementation is its unsupervised nature; it does not require a large amount of labeled data, making it suitable for language pairs and domains with scarce labeled data. It leverages the powerful language understanding capabilities of the pre-trained models, which have already captured a wealth of semantic information, enabling a better understanding of textual relationships. The method described in this implementation automatically analyzes attention weights to evaluate translation quality, reducing the need for manual intervention and improving efficiency. Furthermore, because it is based on an attention mechanism, this method can be used for different language pairs and domains, and has broad applicability.
[0043] The unsupervised lexical-level translation quality assessment method based on the attention mechanism of a pre-trained model described in this embodiment proposes a technical solution that differs from existing technologies. It uses an unsupervised approach to replace labeled data and leverages the self-attention mechanism of a pre-trained model to achieve translation quality assessment, offering advantages such as unsupervisedness, automation, and wide applicability.
[0044] Implementation Method Two: This implementation method further defines the unsupervised lexical-level translation quality assessment method based on the attention mechanism of a pre-trained model described in Implementation Method One, including:
[0045] This implementation primarily uses a multilingual pre-trained model as the backbone network. By pre-training on large-scale multilingual data, the multilingual pre-trained model learns rich linguistic representations and semantic relationships, making it suitable for handling multilingual tasks. Specifically, this implementation uses two multilingual pre-trained models: XLM-RoBERTa and XLM-Align. XLM-RoBERTa is based on a multi-layered stacked Transformer architecture, undergoes self-supervised pre-training on large-scale multilingual data, and performs scheduled sampling for low-resource languages to enhance its representation capabilities. XLM-Align adds a word alignment pre-training task to XLM-RoBERTa, transforming the word alignment task into an optimal transmission problem. It also proposes a self-labeled word alignment method using a pointer network, learning word alignment knowledge from a large bilingual corpus, further improving its ability to model bilingual semantics.
[0046] Implementation Method 3: This implementation method further defines the unsupervised lexical-level translation quality assessment method based on the attention mechanism of a pre-trained model described in Implementation Method 1. Step S2 includes:
[0047] Get a single header of a single Transformer layer;
[0048] Based on the single head attention of the single Transformer layer, for each word mt in the translation. i Calculate attention scores;
[0049] Construct an attention matrix for a single head based on the attention scores;
[0050] The self-attention matrices of the Transformer layers of the two pre-trained models are obtained by merging the attention matrices of each individual head.
[0051] This implementation method will be explained in conjunction with Implementation Method 2. Since current pre-trained models are typically based on a Transformer architecture, in this architecture, the representation of the input at each position in each layer is compared with other representations in the same layer to calculate an attention score. This score reflects the correlation between the input at different positions and the current position. Specifically, for multilingual models like XLM-RoBERTa, when the input sequence is a bilingual sentence pair, the attention mechanism can reflect the lexical correspondence between the source and target languages, implying semantic alignment information between the bilingual inputs.
[0052] Taking a single header of a Transformer layer as an example. For each word mt in the translation layer... i Its hidden layer representation has an attention score for each word in the hidden layer representation of both the source and translation ends. Let the length of the source text be n and the length of the translation be m. The attention matrix for a single head is described as follows:
[0053]
[0054] Where Q is a matrix containing n queries, Q∈R n×d K and V are matrices K, V ∈ R containing m keys and values. m×d .
[0055] Since each word is divided into k subwords using the sentence-piece segmentation method, when calculating the attention score of a word, it is necessary to consider all the subwords into which that word is segmented. In a given attention matrix, for a single subword, the average attention score of that subword with respect to all other subwords is taken as the word-level QE score of that subword.
[0056]
[0057] in h represents the i-th subword. i,j Let represent the i-th row and j-th column of a single attention matrix, and avg is the averaging function.
[0058] The score for each word is the sum of the scores of all its subwords.
[0059]
[0060] in This represents the vocabulary when the attention matrix is head. The score, s represents the score of the first subword of the word in the input sequence. The position in the middle.
[0061] Finally, the final score of a word is obtained by summing all the scores of all heads in the Transformer layer for that word and taking the average.
[0062] In practical applications, each pre-trained model's Transformer layer typically contains multiple heads (multi-head attention). This sub-step aims to select one of these heads for further analysis. Selecting a single head simplifies computation and reduces computational complexity, while also reducing data dimensionality in subsequent steps. The selected head is used to calculate the model's attention score on each word (mti) in the target text. These attention scores represent the relevance of that word to other words. This step aims to capture the model's attention distribution in the translation task for subsequent evaluation of word-level translation quality. The resulting attention scores are combined into an attention matrix, where each row represents a word (mti) in the target text and each column represents a word in the source text. This matrix reflects the model's level of attention between each target word (mti) and the source text words, providing a foundation for subsequent analysis. Self-attention matrices are obtained from the single-head attention matrices of the two pre-trained models to comprehensively reflect the model's attention to the entire translation task. By merging the self-attention matrices of the two models, more comprehensive and robust information is obtained for subsequent word-level translation quality evaluation.
[0063] This implementation reduces computational complexity and improves computational efficiency by selecting a single head; by calculating attention scores and constructing attention matrices, the attention distribution of the model in the translation task can be captured; by merging the self-attention matrices of the two models, more comprehensive information can be obtained, improving the accuracy of the evaluation.
[0064] Implementation Method Four: This implementation method further defines the unsupervised lexical-level translation quality assessment method based on the attention mechanism of a pre-trained model described in Implementation Method One. Step S3 includes:
[0065]
[0066] Among them, Head l A represents the set of all attention matrices that the input sequence passes through the l-th layer Transformer, and A represents the attention matrix of a certain head of the l-th layer Transformer.
[0067] This implementation method will be described in conjunction with Implementation Method 3. The pre-trained models described in this implementation method all consist of stacked Transformer layers, and each Transformer layer has a multi-head attention mechanism. Different Transformer layers and different attention heads extract different aspects of syntactic and semantic features. To comprehensively evaluate these multiple features, for different language pairs, the average score obtained using each head of different Transformer layers is used as the final score of the Attention method.
[0068] Implementation Method 5, see below Figure 2 This embodiment describes a further limitation on the unsupervised lexical-level translation quality assessment method based on a pre-trained model attention mechanism described in Embodiment 1. The XLM-Align-base model has 12 Transformer layers, and each Transformer layer has 12 attention heads.
[0069] The XLM-Align-base model used in this implementation has 12 Transformer layers, and each Transformer layer has 12 attention heads. To explore the effectiveness of attention-based methods in different Transformer layers, this patent uses the Sinhala-English corpus pair as an example, and uses the XLM-Align model as the base to perform a visual analysis of different heads in different Transformer layers, as shown below. Figure 2 As shown in the figure, F1_Multi is still used as the evaluation metric. The darker the color, the better the effect of unsupervised lexical-level QE in the Sinhala-English corpus.
[0070] The information in the figure shows that the mid-to-high-level representations perform better overall. This is because the Transformer's multilingual representations are concentrated in the mid-to-high levels. The attention mechanisms in the mid-to-high levels of the Transformer primarily reveal the semantic information of the sentence, while the lower levels contain more lexical and syntactic information. For lexical-level QE, the semantic information in the mid-to-high levels can better reflect the word alignment information between the source and target texts during lexical-level QE, making it more suitable for evaluating translation quality.
[0071] Observing the heatmap also reveals that the fusion effect of each Transformer layer is weaker than using the optimal attention head alone, but the difference is not significant. In general, under the conditions of a large amount of multilingual corpus and different pre-trained models in the real world, using only a single attention head for lexical-level QE is accidental and lacks generalization ability. Therefore, this implementation also uses all attention heads of each layer for fusion evaluation.
[0072] Implementation Method Six: This implementation method further defines the unsupervised lexical-level translation quality assessment method based on the attention mechanism of a pre-trained model described in Implementation Method One. The method further includes treating the lexical-level translation quality assessment as a binary classification task and using the F1 score as the evaluation index.
[0073] This implementation uses XLM-R-base and XLM-Align-base as multilingual models for experiments, and MLQE as the evaluation dataset. MLQE is a public dataset for QE, which is the evaluation data of the QE project of the Workshop on Machine Translation (WMT) in 2020 and 2021. The dataset contains high, medium and low resource language pairs such as English-German, English-Chinese, English-Russian, English-Estonian, English-Romanian, English-Nepalese, and English-Sinhala. The data mainly comes from forums and Wikipedia. For each language pair, there are 7,000 training sentences, 1,000 validation sentences, and two 1,000-sentence test sets (test20 and test21). Each language pair also has corresponding Automatic Post-Editing (APE) translation data.
[0074] This implementation treats vocabulary-level machine translation quality assessment as a binary classification task, using the F1 score as the evaluation metric. The F1 score is a commonly used performance evaluation metric used to measure the balance between accuracy and recall in a classification model. The F1 score is the harmonic mean of accuracy and recall, and is typically used to evaluate the predictive performance of positive examples in binary classification problems.
[0075] Implementation Method Seven: This implementation method further defines the unsupervised lexical-level translation quality assessment method based on the attention mechanism of a pre-trained model described in Implementation Method Six. The formula for calculating the F1 score is as follows:
[0076]
[0077] Where Precision represents the model's precision in the vocabulary-level QE task, Recall represents the recall rate, and F1_Score represents the F1 score.
[0078] This implementation method is described in conjunction with Implementation Method Six. This patent uses F1_Multi as a standard to evaluate the quality of vocabulary-level QE for each model. F1_Multi comprehensively considers the quality of both positive and negative example predictions, aiming to distinguish models that perform well in both positive and negative example predictions. The formula for calculating the F1 score is as follows:
[0079]
[0080] F1_Multi = F1_OK * F1_BAD
[0081] Where Precision represents the model's precision in the vocabulary-level QE task, and Recall represents the recall rate.
[0082] Implementation Method Eight: An unsupervised lexical-level translation quality assessment system based on a pre-trained model attention mechanism, as described in this implementation method, includes:
[0083] The deployment unit is used to deploy two multilingual pre-trained models, XLM-RoBERTa and XLM-Align.
[0084] The self-attention matrix acquisition unit is used to acquire the self-attention matrices of the Transformer layers of two pre-trained models;
[0085] The scoring unit is used to perform successive analysis of the attention weights of the word to be evaluated and the other words based on the self-attention matrix of the Transformer layer of the pre-trained model, and to use the attention weights as the score for the quality assessment of the word-level translation.
[0086] Implementation Method Nine: A computer-readable storage medium according to this implementation method, the computer-readable storage medium being used to store a computer program, the computer program executing any one of Implementation Methods One to Seven, an unsupervised lexical-level translation quality assessment method based on a pre-trained model attention mechanism.
[0087] Implementation Method 10: A computer device according to this implementation method includes a memory and a processor. The memory stores a computer program. When the processor runs the computer program stored in the memory, the processor executes an unsupervised lexical-level translation quality assessment method based on a pre-trained model attention mechanism according to any one of Implementation Methods 1 to 7.
[0088] Implementation Method 11, see below Figure 3 This embodiment describes a specific example of the unsupervised lexical-level translation quality assessment method based on a pre-trained model attention mechanism described in Embodiment 1. It also serves to explain Embodiments 2 through 7. Specifically:
[0089] To compare the results of this experiment, the following different baseline models were selected in this implementation method:
[0090] AwesomeQE is a supervised vocabulary-level QE model based on a pre-trained model. This method adds a linear layer after XLM-R and uses the final softmax function to classify words as OK and BAD. This patent uses XLM-RoBERTa and XLM-Align as bases and uses labeled data from the training set for training.
[0091] TransQuest is a supervised vocabulary-level QE model based on a pre-trained model, trained using labeled data from the training set with XLM-RoBERTa as the basis.
[0092] The NuQE model based on recurrent neural networks requires word alignment first, then concatenating the aligned original text and translation, and inputting them into two consecutive feedforward layers and a bidirectional GRU layer. Finally, the softmax function is used to classify words as OK and BAD.
[0093] The Predictor-Estimator QE model based on bidirectional LSTM uses a bidirectional LSTM structure in the Predictor part to predict words at specified positions using context. This method leverages a large amount of parallel data for pre-training of the feature extractor. In the Estimator part, the hidden layer states of the Predictor are used as input, and a bidirectional LSTM structure is used to predict the OK and BAD labels of words.
[0094] The BERT-based self-supervised vocabulary-level QE model uses full word masking to predict the scores of the words to be evaluated and uses a validation set to determine the optimal score threshold.
[0095] This implementation also attempts to perform unsupervised vocabulary-level QE using a large model. The GPT-3.5-turbo model is used as the basis, and for each corpus pair, templates are used to provide hints to the large model.
[0096] Evaluation process and template as follows Figure 3 As shown, where <lang>Some sections specify the language of the labeling for different languages. (Original text and translation) <sentence>The part consists of the specific sentences of each language pair to be evaluated in the corpus, and the output... <output>Some of these are based on the translation. <err> and< / err> Identifiers are used to mark the sentences at both ends of words with low translation quality. For each corpus pair, we select 5 source-translation sentence pairs from the validation set to construct evaluation templates. The example sentences for each corpus pair need to combine long and short sentences, and also need to have a significant number of BADs in the vocabulary-level QE labels. Selecting sentences according to this standard can enhance the template recognition ability of the large model and better control the output format of the model during evaluation. Using 5 sentence pairs as cue templates can more effectively utilize the contextual understanding ability of the large model, allowing the large model to more effectively understand the task demonstrated by the template, and enhance the model's ability to identify words with poor translation quality in the translation.
[0097] When evaluating a sentence correctly, append the single-sentence template to the end of the evaluation template, and... <lang>Original text and translation <sentence>Partial completion, but not complete output. <output>Partially. This single-sentence template with no output is concatenated after the evaluation templates of the five selected sentence pairs in this corpus, and then input together into the large model. The large model will then predict the output of the single-sentence template to be evaluated based on the output of the preceding evaluation templates. We will use the output... <err> and< / err> The identified words are marked as BAD, and the rest are marked as OK.
[0098] When implementing the attention-based method, the best-performing Transformer layer was selected as the final result for each language pair. The final experimental results are shown in Table 1.
[0099] As shown in the table, the proposed method based on XLM-RoBERTa and XLM-Align, under unsupervised conditions, achieves an average F1_Mulit score that surpasses that of large language models based on GPT3.5. While its overall performance is weaker than current mainstream supervised QE methods based on pre-trained models, it outperforms supervised NuQE models based on recurrent neural networks on the Ni-English and English-English corpora. Furthermore, on the Ni-English corpus, its performance approaches that of the NuQE model. The method of this invention also shows relatively consistent performance across language pairs, while other supervised methods are more dependent on the quality of training data and struggle on low-resource or even zero-resource corpora. Since there are currently no systematic unsupervised lexical-level QE methods for comparison, the solution provided in this invention uses self-supervised lexical-level QE models based on pre-trained models, which require significant computational resources but do not require high-quality labeled data, as one of the baselines for comparison. As can be seen, the self-supervised model, even with significant computational resources required, is on average significantly weaker than current QE methods based on pre-trained models, only surpassing the NuQE model based on recurrent neural networks. Furthermore, the performance drops considerably on Russian-English corpora compared to other corpora, indicating that even with self-supervised training, the model is still affected by the language-specific capabilities of the pre-trained model. The method provided in this invention does not rely on any training data or computational resources, making it more lightweight and scalable. The above results demonstrate the effectiveness of the unsupervised lexical-level QE method based on the attention matrix of a pre-trained model provided in this invention, further illustrating that bilingual alignment can reflect the translation quality of the target vocabulary.
[0100] In the proposed method of this invention, the results based on XLM-Align are superior to those based on XLM-RoBERTa. The self-labeled word alignment pre-training method proposed by XLM-Align improves the model's transferability across various multilingual datasets and enhances its word alignment capabilities. Better transferability improves the model's performance in various multilingual tasks. Combined with the experimental results under unsupervised conditions presented in this patent, it is shown that XLM-Align extracts bilingual alignment information better than XLM-RoBERTa in lexical-level QE tasks and exhibits better classification capabilities.
[0101] The table shows that current large-scale models perform poorly on unsupervised lexical-level QE tasks, significantly outperforming unsupervised methods based on XLM-Align. This indicates that current large-scale models still have shortcomings in lexical-level tasks. Although these models accumulate rich linguistic knowledge through large-scale text training, they struggle to accurately model the semantics of specific words and bilingual alignment in bilingual lexical-level tasks.
[0102] In particular, existing large-scale model training methods primarily focus on sentence-level tasks, lacking specific optimization and training strategies for vocabulary-level tasks. Furthermore, the word segmentation strategies used in existing QE datasets differ significantly from those of large-scale models. This makes it difficult to match words in the source and translation texts at the QE segmentation granularity during evaluation, resulting in low accuracy of vocabulary-level QE results from large-scale models. This also demonstrates the continued value of the unsupervised method proposed in this invention in the era of large-scale models.
[0103] Table 1 Experimental Results
[0104]
[0105] Results of Supervised Models
[0106]
[0107] Results of the Self-Supervised Model
[0108]
[0109] Results of Our Unsupervised Method on GPT3.5
[0110]
[0111] Results of Our Unsupervised Method on XLM-R & XLM-Align
[0112]
[0113] Although preferred embodiments of this disclosure have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this disclosure.
[0114] Obviously, those skilled in the art can make various modifications and variations to this disclosure without departing from its spirit and scope. Therefore, if such modifications and variations fall within the scope of the claims of this disclosure and their equivalents, this disclosure is also intended to include such modifications and variations.
[0115] Those skilled in the art will understand that embodiments of this disclosure can be provided as methods, systems, or computer program products. Therefore, this disclosure can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this disclosure can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0116] This disclosure is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 The computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0117] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0118] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this disclosure and not to limit its protection scope. Although this disclosure has been described in detail with reference to the above embodiments, those skilled in the art should understand that after reading this disclosure, they can still make various changes, modifications or equivalent substitutions to the specific implementation of the invention, but these changes, modifications or equivalent substitutions are all within the protection scope of the published pending claims.< / output> < / sentence> < / lang> < / output> < / sentence> < / lang>
Claims
1. An unsupervised lexical-level translation quality assessment method based on the attention mechanism of a pre-trained model, characterized in that, The method includes: S1: Deploy two multilingual pre-trained models, XLM-RoBERTa and XLM-Align; S2: Obtain the self-attention matrices of the Transformer layers of the two pre-trained models; S3: Based on the self-attention matrix of the Transformer layer of the pre-trained model, perform successive analysis of the attention weights of the word to be evaluated and the other words, and use the attention weights as the score for the quality assessment of the word-level translation.
2. The unsupervised lexical-level translation quality assessment method based on a pre-trained model attention mechanism according to claim 1, characterized in that, Step S2 includes: Get a single header of a single Transformer layer; Based on the single head attention of the single Transformer layer for each word in the translation. mt i Calculate attention scores; Construct an attention matrix for a single head based on the attention scores; The self-attention matrices of the Transformer layers of the two pre-trained models are obtained by merging the attention matrices of each individual head.
3. The unsupervised lexical-level translation quality assessment method based on a pre-trained model attention mechanism according to claim 1, characterized in that, Step S3 includes: in, This represents the input sequence after the first... l The set of all attention matrices for each Transformer layer. A Representing the l Attention matrix of a specific head of a Transformer layer.
4. The unsupervised lexical-level translation quality assessment method based on a pre-trained model attention mechanism according to claim 1, characterized in that, The XLM-Align model has 12 Transformer layers, and each Transformer layer has 12 attention heads.
5. The unsupervised lexical-level translation quality assessment method based on a pre-trained model attention mechanism according to claim 1, characterized in that, The method also includes treating the quality assessment of the lexical-level translation as a binary classification task, using the F1 score as the evaluation metric.
6. The unsupervised lexical-level translation quality assessment method based on a pre-trained model attention mechanism according to claim 5, characterized in that, The formula for calculating the F1 score is: , Where Precision represents the model's precision in the vocabulary-level QE task, and Recall represents the recall rate. This represents the F1 score.
7. An unsupervised lexical-level translation quality assessment system based on a pre-trained model attention mechanism, characterized in that, The system includes: The deployment unit is used to deploy two multilingual pre-trained models, XLM-RoBERTa and XLM-Align. The self-attention matrix acquisition unit is used to acquire the self-attention matrices of the Transformer layers of two pre-trained models; The scoring unit is used to perform successive analysis of the attention weights of the word to be evaluated and the other words based on the self-attention matrix of the Transformer layer of the pre-trained model, and to use the attention weights as the score for the quality assessment of the word-level translation.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program that executes an unsupervised lexical-level translation quality assessment method based on a pre-trained model attention mechanism as described in any one of claims 1-6.
9. A computer device, characterized in that, The system includes a memory and a processor, wherein the memory stores a computer program, and when the processor runs the computer program stored in the memory, the processor executes an unsupervised lexical-level translation quality assessment method based on a pre-trained model attention mechanism according to any one of claims 1-6.
Citation Information
Patent Citations
XML document translation and evaluation method based on attention mechanism
CN112257461A
Machine translation quality estimation method integrating and utilizing multiple pre-training models
CN114091480A
