A method for machine translation quality estimation based on large language model

Through a method based on a large language model, the similarity feature vector of the source language sentence and the machine translation is extracted and a pseudo-reference translation is generated, which solves the problem of machine translation quality evaluation in the absence of manual reference translation and improves the accuracy and relevance of automated evaluation. sex.

CN118410812BActive Publication Date: 2024-08-30EAST CHINA JIAOTONG UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410871902.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-01
Publication Date
2024-08-30
Estimated Expiration
2044-07-01

AI Technical Summary

Technical Problem

In the absence of manual reference translations, how to automatically and effectively evaluate the quality of machine translations is a challenge. Existing technology is difficult to accurately evaluate the quality of machine translations without the help of manual reference translations.

Method used

A method based on a large language model is used to extract the similarity feature vectors of source language sentences and machine translations, and use these feature vectors to be input into the neural network for machine translation quality estimation, and combine with the large language model to generate pseudo-reference translations for automatic evaluation. to predict machine translation quality.

Benefits of technology

It improves the correlation between machine translation quality estimation and human evaluation, enables accurate evaluation of machine translation quality without relying on manual reference translations, and enhances the automation capability of machine translation quality evaluation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118410812B
    Figure CN118410812B
Patent Text Reader

Abstract

The present invention discloses a method for estimating the quality of machine translation based on a large language model, and the method steps are: extracting similarity feature vectors from source language sentences to machine translations and similarity feature vectors from machine translations to source language sentences, extracting feature vectors for estimating the quality of machine translations, and predicting machine translation quality scores; and minimizing the sum of mean square error loss and cross entropy loss to train parameters in the model. The present invention combines the two characteristics of the large language model, introduces the representation input of the large language model to the machine translation and the source language sentence into a neural network for auxiliary classification tasks to predict the quality of machine translation; at the same time, the large language model is used to translate and generate a pseudo reference translation, and the pseudo reference translation is used to replace the manual reference translation to use the machine translation automatic evaluation method to evaluate the translation quality, and the two are combined to predict the quality of machine translation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of natural language processing, and in particular to a method for estimating the quality of machine translation based on a large language model. Background Art

[0002] Quality Estimation (QE), also known as the automatic evaluation method of machine translation without manual reference translation, is an important task in machine translation, which automatically and in real time predicts the quality of machine translation without the help of manual reference translation. It plays an important role in post-editing of machine translation and self-training of machine translation systems.

[0003] In the absence of manual reference translations, scholars usually extract features that represent the quality of machine translation from source language sentences and machine translation tuples, and use regression models to predict the quality of machine translation. Machine translation quality estimation is divided into methods based on traditional machine learning, methods based on neural translation models, and methods based on pre-trained language models, depending on feature extraction and model construction. The current mainstream method is based on pre-trained language models.

[0004] Recently, large language models have become the latest research method for pre-trained language models, such as ChatGPT and Llama. The application of large language models in natural language processing tasks mainly includes the following two aspects: on the one hand, it inherits from the pre-trained language model, uses large language models for deep representation of words, and adapts them to downstream tasks through fine-tuning; on the other hand, the large language model is a large unified model, which can directly perform tasks such as automatic question answering and machine translation with the help of prompts. Based on this, this technology provides a machine translation quality estimation method based on a large language model to improve the correlation between machine translation quality estimation and human evaluation. Summary of the invention

[0005] The present invention provides a method for estimating the quality of machine translation based on a large language model. Combining the two characteristics of the large language model, the representation input of the large language model on the machine translation and the source language sentence is introduced into the neural network of the auxiliary classification task to predict the quality of the machine translation; at the same time, the large language model is used to translate and generate a pseudo reference translation, and the pseudo reference translation is used to replace the manual reference translation to adopt the machine translation automatic evaluation method to evaluate the translation quality, and the two are combined to predict the quality of the machine translation.

[0006] The technical solution adopted by the present invention is as follows: a method for estimating the quality of machine translation based on a large language model, firstly training a machine translation quality estimation model based on the deep representation of the large language model, and the steps are as follows:

[0007] Step S1, obtaining a training set, normalizing the training set, and obtaining a normalized training set; the training set is composed of a plurality of different samples, each sample including a source language sentence, a machine translation, a human evaluation score of the machine translation, and a human evaluation category of the machine translation (0-9, 10 categories describing the quality level of the machine translation);

[0008] Step S2, extracting the similarity feature vector from the source language sentence to the machine translation; sequentially connecting the source language sentence and the machine translation in each sample in the normalized training set, inputting them into the large language model, outputting the subword-level feature vector from the source language sentence to the machine translation, and extracting the feature vector of the last subword of the subword-level feature vector from the source language sentence to the machine translation as the similarity feature vector from the source language sentence to the machine translation;

[0009] Step S3, extracting a similarity feature vector from the machine translation to the source language sentence; sequentially connecting the machine translation and the source language sentence in each sample in the normalized training set, inputting them into the large language model, outputting a subword-level feature vector from the machine translation to the source language sentence, and extracting a feature vector of the last subword from the subword-level feature vector from the machine translation to the source language sentence as a similarity feature vector from the machine translation to the source language sentence;

[0010] Step S4, extracting a machine translation quality estimation feature vector; concatenating the similarity feature vector from the source language sentence to the machine translation in step S2 and the similarity feature vector from the machine translation to the source language sentence in step S3, and inputting them into a machine translation quality estimation task adapter layer (a fully connected neural network), and outputting a machine translation quality estimation feature vector;

[0011] Step S5, predicting the machine translation quality score based on the deep representation of the large language model; inputting the machine translation quality estimation feature vector in step S4 into the main regression network layer (a fully connected neural network) to predict the machine translation quality score based on the deep representation of the large language model;

[0012] Step S6, predicting the machine translation quality category based on the deep representation of the large language model; inputting the machine translation quality estimation feature vector in step S4 into the auxiliary classification network layer (a fully connected neural network) to predict the machine translation quality category based on the deep representation of the large language model;

[0013] Step S7, training a machine translation quality estimation model based on deep representation of a large language model;

[0014] Calculate the mean square error loss on the training set according to the machine translation quality score based on the deep representation of the large language model predicted in step S5 and the human evaluation score of the machine translation in the training set after the normalization processing in step S1;

[0015] Calculate the cross entropy loss on the training set according to the quality category of the machine translation based on the deep representation of the large language model predicted in step S6 and the human evaluation category of the machine translation in the training set after the normalization processing in step S1;

[0016] The linearly weighted mean square error loss on the training set and the cross entropy loss on the training set are used as the total loss on the training set. The total loss on the training set is minimized to train the parameters of the machine translation quality estimation model based on the deep representation of the large language model, and the trained machine translation quality estimation model based on the deep representation of the large language model is obtained.

[0017] Furthermore, the training set in step S1 is composed of multiple different samples, each of which is specifically:

[0018] Step S110, given a sample d={src, hypothesis, y} in the training set, where d represents a training sample, src represents a source language sentence, hypothesis represents a machine translation, and y represents a human evaluation score of the machine translation;

[0019] The human evaluation scores of the machine translations are scaled to the range of [0,1] using the minimum-maximum normalization method to obtain the scaled human evaluation scores of the machine translations, as shown in formula (1):

[0020] (1);

[0021] Among them, y scaled represents the human evaluation score after machine translation scaling; y max ,y min They represent the maximum and minimum human evaluation scores of machine translations in the training set, respectively;

[0022] Step S111, using the average classification method to set the human evaluation category of the machine translation; the human evaluation score after scaling the machine translation is divided into quality levels according to the interval in which it is located, and the quality level is 10 consecutive natural numbers starting from 0, as shown in formula (2):

[0023] (2);

[0024] Here, z represents the human evaluation category of the machine translation.

[0025] Furthermore, in step S2, a similarity feature vector from the source language sentence to the machine translation is extracted, specifically:

[0026] Step S21, sequentially connect the source language sentence and the machine translation in each sample in the normalized training set, as shown in formula (3):

[0027] (3);

[0028] Among them, s2h represents the combined string of source language sentence to machine translation, and the symbol <s>、< / s> Indicates the start and end characters of a string;

[0029] Step S22, input the source language sentence to the machine translation combined string into the large language model Llama 2, and the large language model Llama 2 uses the subword segmentation method SentencePiece algorithm to segment the source language sentence to the machine translation combined string into subwords to obtain a subword sequence containing m subwords, as shown in formula (4):

[0030] (4);

[0031] Where m represents the number of subwords from the source language sentence to the machine translation string; s1, s2, s m It represents the first subword, the second subword, and the mth subword after the subword segmentation of the source language sentence to the machine translation joint string;

[0032] In step S23, the large language model Llama 2 generates subword-level feature vectors from the source language sentence to the machine translation word by word in a left-to-right order, as shown in formula (5):

[0033] (5);

[0034] Among them, v s2h Represents the subword-level feature vector from the source language sentence to the machine translation, Llama2() represents the output function of the large language model Llama 2, vs1, vs2, vs m Respectively represent the feature vector of the first subword, the feature vector of the second subword, and the feature vector of the mth subword from the source language sentence to the machine translation;

[0035] Step S24, the large language model Llama 2 adopts a unidirectional deep representation method. The feature vector of the last subword contains the information of the entire string. The feature vector of the last subword of the subword-level feature vector of the source language sentence to the machine translation is extracted. m As the similarity feature vector from the source language sentence to the machine translation.

[0036] Furthermore, in step S3, a similarity feature vector between the machine translation and the source language sentence is extracted, specifically:

[0037] Step S31, connect the machine translation and source language sentences in each sample in the normalized training set in sequence, as shown in formula (6):

[0038] (6);

[0039] Among them, h2s represents the joint string of machine translation to source language sentence;

[0040] Step S32: input the machine translation to the source language sentence joint string into the large language model Llama 2, and the large language model Llama 2 uses the subword segmentation method SentencePiece algorithm to segment the machine translation to the source language sentence joint string into subwords to obtain a subword sequence containing n subwords, as shown in formula (7):

[0041] (7);

[0042] Where n represents the number of subwords in the machine translation to the source language sentence and the string for subword segmentation; h1, h2, h n Indicates the first subword, the second subword, and the nth subword of the machine translation to the source language sentence after the subword segmentation of the joint string;

[0043] In step S33, the large language model Llama 2 generates a subword-level feature vector of the machine translation to the source language sentence word by word from left to right, as shown in formula (8):

[0044] (8);

[0045] Among them, v h2s Represents the subword-level feature vector of the machine translation to the source language sentence, vh1, vh2, vh n The feature vectors of the first subword, the second subword, and the nth subword of the subword-level feature vectors of the machine translation to the source language sentence are represented respectively;

[0046] Step S34, taking the feature vector vh of the last subword of the subword-level feature vector of the machine translation to the source language sentence n As the similarity feature vector between the machine translation and the source language sentence.

[0047] Furthermore, in step S4, a feature vector for estimating the quality of machine translation is extracted, specifically:

[0048] Step S41, concatenate the similarity feature vector from the source language sentence to the machine translation in step S2 and the similarity feature vector from the machine translation to the source language sentence in step S3, as shown in formula (9):

[0049] (9);

[0050] Among them, x represents the concatenated feature vector of the machine translation and the source language sentence, and the symbol “⊕” represents the vector concatenation operation;

[0051] Step S42, input the machine translation and source language sentence concatenation feature vector into the machine translation quality estimation task adapter layer, and output the machine translation quality estimation feature vector, as shown in formula (10):

[0052] (10);

[0053] Among them, QEFV represents the machine translation quality estimation feature vector, tanh() represents the activation function tanh of the neural network, parameters w1 and b1 are the learnable parameters of the neural network, and T represents the transpose operation of the matrix.

[0054] Furthermore, in step S5, the quality score of the machine translation based on the deep representation of the large language model is predicted, specifically:

[0055] The machine translation quality estimation feature vector in step S4 is input into the main regression network layer to predict the machine translation quality score based on the deep representation of the large language model, as shown in formula (11):

[0056] (11);

[0057] Among them, Pvalues ​​is the predicted machine translation quality score based on the deep representation of the large language model, and the parameters w2 and b2 are the learnable parameters of the neural network.

[0058] Furthermore, in step S6, the machine translation quality category based on the deep representation of the large language model is predicted, specifically:

[0059] The machine translation quality estimation feature vector in step S4 is input into the auxiliary classification network layer to predict the machine translation quality category based on the deep representation of the large language model, as shown in formula (12) and formula (13):

[0060] (12);

[0061] (13);

[0062] Among them, Probs is the predicted probability of machine translation quality category based on deep representation of large language model, Pclass is the predicted machine translation quality category based on deep representation of large language model, argmax() is the index function that returns the maximum value of the vector, softmax() represents the activation function softmax of the neural network, and parameters w3 and b3 are the learnable parameters of the neural network.

[0063] Furthermore, in step S7, a machine translation quality estimation model based on deep representation of a large language model is trained, specifically:

[0064] Step S71, according to the machine translation quality score based on the deep representation of the large language model predicted in step S5 and the human evaluation score of the machine translation in the training set after the normalization processing in step S1, calculate the mean square error loss on the training set, as shown in formula (14):

[0065] (14);

[0066] Among them, MSE represents the mean square error loss on the training set, N represents the number of samples in the training set, i represents the i-th sample in the training set, and y (i) Pvalues ​​represents the human evaluation score of the machine translation of the i-th sample in the training set. (i) represents the machine translation quality score predicted by the i-th sample based on the deep representation of the large language model;

[0067] Step S72, according to the machine translation quality category based on the deep representation of the large language model predicted in step S6 and the human evaluation category of the machine translation in the training set after the normalization processing in step S1, calculate the cross entropy loss on the training set, as shown in formula (15):

[0068] (15);

[0069] Among them, CrossEntropy represents the cross entropy loss on the training set, z (i) represents the human evaluation category of the i-th sample machine translation in the training set, represents the probability of machine translation quality category predicted by the i-th sample in the training set based on the deep representation of the large language model at the z-th (i) Probability values ​​on categories;

[0070] In step S73, the linearly weighted mean square error loss on the training set and the cross entropy loss on the training set are used as the total loss on the training set, as shown in formula (16):

[0071] (16);

[0072] Among them, SumLoss represents the total loss on the training set, and 0.2 is the linear interpolation weight, which is obtained through experimental experience;

[0073] Step S74, minimizing the total loss on the training set to train the parameters of the machine translation quality estimation model based on the deep representation of the large language model, and obtaining the trained machine translation quality estimation model based on the deep representation of the large language model, as shown in formula (17) and formula (18):

[0074] (17);

[0075] (18);

[0076] in, represents a set of optimal parameters that minimize the total loss on the training set; argmin is the function of the optimal parameters when taking the minimum value; θ represents the parameters of the machine translation quality estimation model based on the deep representation of the large language model, including the parameters in the large language model Llama 2, which are the learnable parameters w1, w2, w3 and b1, b2, b3 of the neural network; Preds is the predicted machine translation quality score; g represents a set of optimal parameters of the machine translation quality estimation model based on the deep representation of the large language model, when given the source language sentence src, the machine translation hypothesis and the total loss , outputs the predicted machine translation quality score.

[0077] Furthermore, another technical solution adopted by the present invention: a method for estimating the quality of machine translation based on a large language model, further comprising the following steps:

[0078] Step S8, normalizing the source language sentences and machine translations and inputting them into the machine translation quality estimation model based on deep representation of a large language model trained in step S7, and predicting the machine translation quality score based on deep representation of a large language model;

[0079] Step S9, using the prompt to use the large language model to perform machine translation to generate a pseudo reference translation of the source language sentence; compiling the prompt and connecting it with the source language sentence to form a translation instruction, inputting the translation instruction into the large language model in the dialogue mode to output the translation result of the source language sentence, and using the translation result of the source language sentence as the pseudo reference translation;

[0080] Step S10, inputting the source language sentence, the machine translation and the pseudo reference translation into the automatic machine translation evaluation method to calculate the machine translation quality score based on the large language model prompt; inputting the source language sentence, the machine translation and the pseudo reference translation into the automatic machine translation evaluation method to output the machine translation quality score, and selecting the highest score as the machine translation quality score based on the large language model prompt;

[0081] Step S11, calculate the machine translation quality score based on the large language model; linearly weight the machine translation quality score based on the deep representation of the large language model predicted in step S8 and the machine translation quality score based on the large language model prompt in step S10 to obtain the machine translation quality score based on the large language model.

[0082] Furthermore, in step S9, the prompt is used to perform machine translation using a large language model to generate a pseudo reference translation of the source language sentence, specifically:

[0083] The compilation prompt is connected with the source language sentence to form a translation instruction, as shown in formula (19) and formula (20):

[0084] TransPrompt1 ← Translate from [ srclang ] to [ trglang ] : src (19);

[0085] (20);

[0086] Wherein, TransPrompt1 and TransPrompt2 are the first and second translation instructions respectively, translate from[]to[] and translate[]to[] represent the translation prompts in the translation instructions; srclang is the source language name, and trglang is the target language name;

[0087] In the dialogue mode, the translation instruction is input into the large language model to output the translation result of the source language sentence, as shown in formula (21) and formula (22):

[0088] (twenty one);

[0089] (twenty two);

[0090] Among them, PseudoRef1 and PseudoRef2 are the translation results of the source language sentences respectively, and Llama2Chat() is the output function of the large language model Llama 2 in the conversation mode;

[0091] The translation results PseudoRef1 and PseudoRef2 of the source language sentences are used as pseudo reference translations.

[0092] Furthermore, in step S10, the source language sentence, the machine translation and the pseudo reference translation are input into the machine translation automatic evaluation method to calculate the machine translation quality score based on the large language model prompt, specifically:

[0093] The source language sentence, machine translation and pseudo-reference translation are input into the machine translation automatic evaluation method to output the machine translation quality score, and the highest score is selected as the machine translation quality score based on the large language model prompt, as shown in formula (23), formula (24) and formula (25):

[0094] (twenty three);

[0095] (twenty four);

[0096] (25);

[0097] Among them, MetricsScore1 and MetricsScore2 represent two machine translation quality scores, MetricsScore represents the machine translation quality score based on the large language model prompt, Metrics() represents the output function of the machine translation automatic evaluation method, and Max() represents the maximum value function.

[0098] Furthermore, in step S11, the machine translation quality score based on the large language model is calculated, specifically:

[0099] The machine translation quality score based on the deep representation of the large language model predicted in step S8 and the machine translation quality score based on the prompt of the large language model in step S10 are linearly weighted to obtain the machine translation quality score based on the large language model:

[0100] (26);

[0101] in, Represents the machine translation quality score based on the large language model; Preds represents the machine translation quality score based on the deep representation of the large language model predicted in step S8; 0.8 is the linear interpolation weight, which is obtained based on experimental experience.

[0102] The beneficial effect of the present invention is that the present invention decomposes the machine translation quality estimation method based on the large language model into a machine translation quality estimation model based on the deep representation of the large language model and a machine translation quality estimation model based on the prompt of the large language model. The machine translation quality estimation model based on the deep representation of the large language model uses the large language model to extract the similarity feature vector from the source language sentence to the machine translation and the similarity feature vector from the machine translation to the source language sentence, uses the machine translation quality estimation task adapter layer to extract the machine translation quality estimation feature vector, and uses the main regression network layer to predict the machine translation quality score based on the deep representation of the large language model; the parameters in the machine translation quality estimation model based on the deep representation of the large language model are trained by minimizing the sum of the mean square error loss and the cross entropy loss. The machine translation quality estimation model based on the prompt of the large language model uses the prompt to use the large language model to perform machine translation to generate a pseudo reference translation of the source language sentence, and the source language sentence, the machine translation and the pseudo reference translation are input into the machine translation automatic evaluation method to calculate the machine translation quality score based on the prompt of the large language model. The machine translation quality score based on the large language model is the linear weighted sum of the machine translation quality score based on the deep representation of the large language model and the machine translation quality score based on the prompt of the large language model. BRIEF DESCRIPTION OF THE DRAWINGS

[0103] Figure 1 It is a flow chart of a method for estimating machine translation quality based on a large language model of the present invention;

[0104] Figure 2 It is a flowchart diagram of the supplementary steps of the method for estimating the quality of machine translation based on a large language model of the present invention;

[0105] Figure 3 It is a schematic diagram of the structure of the machine translation quality estimation model based on a large language model of the present invention. DETAILED DESCRIPTION

[0106] The present invention is described in detail below with reference to the accompanying drawings and implementation modes.

[0107] like Figure 1 As shown, this embodiment works as follows: a method for estimating the quality of machine translation based on a large language model, firstly training a machine translation quality estimation model based on the deep representation of the large language model, and the steps are as follows:

[0108] Step S1, obtaining a training set, and normalizing the obtained training set to obtain a normalized training set; the training set is composed of a plurality of different samples, each sample including a source language sentence, a machine translation, a human evaluation score of the machine translation, and a human evaluation category of the machine translation (0-9, 10 categories describing the quality level of the machine translation);

[0109] Step S2, extracting the similarity feature vector from the source language sentence to the machine translation; sequentially connecting the source language sentence and the machine translation in each sample in the normalized training set, inputting them into the large language model, outputting the subword-level feature vector from the source language sentence to the machine translation, and extracting the feature vector of the last subword of the subword-level feature vector from the source language sentence to the machine translation as the similarity feature vector from the source language sentence to the machine translation;

[0110] Step S3, extracting a similarity feature vector from the machine translation to the source language sentence; sequentially connecting the machine translation and the source language sentence in each sample in the normalized training set, inputting them into the large language model, outputting a subword-level feature vector from the machine translation to the source language sentence, and extracting a feature vector of the last subword from the subword-level feature vector from the machine translation to the source language sentence as a similarity feature vector from the machine translation to the source language sentence;

[0111] Step S4, extracting a machine translation quality estimation feature vector; concatenating the similarity feature vector from the source language sentence to the machine translation in step S2 and the similarity feature vector from the machine translation to the source language sentence in step S3, and inputting the concatenated vectors into the machine translation quality estimation task adapter layer, and outputting the machine translation quality estimation feature vector;

[0112] Step S5, predicting the machine translation quality score based on the deep representation of the large language model; inputting the machine translation quality estimation feature vector in step S4 into the main regression network layer to predict the machine translation quality score based on the deep representation of the large language model;

[0113] Step S6, predicting the machine translation quality category based on the deep representation of the large language model; inputting the machine translation quality estimation feature vector in step S4 into the auxiliary classification network layer to predict the machine translation quality category based on the deep representation of the large language model;

[0114] Step S7, training a machine translation quality estimation model based on deep representation of a large language model;

[0115] Calculate the mean square error loss on the training set according to the machine translation quality score based on the deep representation of the large language model predicted in step S5 and the human evaluation score of the machine translation in the training set after the normalization processing in step S1;

[0116] Calculate the cross entropy loss on the training set according to the quality category of the machine translation based on the deep representation of the large language model predicted in step S6 and the human evaluation category of the machine translation in the training set after the normalization processing in step S1;

[0117] The linearly weighted mean square error loss on the training set and the cross entropy loss on the training set are used as the total loss on the training set. The total loss on the training set is minimized to train the parameters of the machine translation quality estimation model based on the deep representation of the large language model, and the trained machine translation quality estimation model based on the deep representation of the large language model is obtained.

[0118] like Figure 2 As shown, a method for estimating the quality of machine translation based on a large language model includes:

[0119] Step S8, normalizing the source language sentences and machine translations and inputting them into the machine translation quality estimation model based on deep representation of a large language model trained in step S7, and predicting the machine translation quality score based on deep representation of a large language model;

[0120] Step S9, using the prompt to use the large language model to perform machine translation to generate a pseudo reference translation of the source language sentence; compiling the prompt and connecting it with the source language sentence to form a translation instruction, inputting the translation instruction into the large language model in the dialogue mode to output the translation result of the source language sentence, and using the translation result of the source language sentence as the pseudo reference translation;

[0121] Step S10, inputting the source language sentence, the machine translation and the pseudo reference translation into the automatic machine translation evaluation method to calculate the machine translation quality score based on the large language model prompt; inputting the source language sentence, the machine translation and the pseudo reference translation into the automatic machine translation evaluation method to output the machine translation quality score, and selecting the highest score as the machine translation quality score based on the large language model prompt;

[0122] Step S11, calculate the machine translation quality score based on the large language model; linearly weight the machine translation quality score based on the deep representation of the large language model predicted in step S8 and the machine translation quality score based on the large language model prompt in step S10 to obtain the machine translation quality score based on the large language model.

[0123] Figure 3 is a schematic diagram of the structure of a machine translation quality estimation model based on a large language model of the present invention; wherein Figure 3 The left frame in the figure is a machine translation quality estimation model based on deep representation of a large language model. Figure 3 The right frame diagram in the figure is a machine translation quality estimation model based on large language model prompts, src is the source language sentence, and hypothesis is the machine translation.

[0124] Furthermore, the training set in step S1 is composed of multiple different samples, each of which is specifically:

[0125] Step S110, given a sample d={src, hypothesis, y} in the training set, where d represents a training sample, src represents a source language sentence, hypothesis represents a machine translation, and y represents a human evaluation score of the machine translation;

[0126] The human evaluation scores of the machine translations are scaled to the range of [0,1] using the minimum-maximum normalization method to obtain the scaled human evaluation scores of the machine translations, as shown in formula (1):

[0127] (1);

[0128] Among them, y scaled represents the human evaluation score after machine translation scaling; y max ,y min They represent the maximum and minimum human evaluation scores of machine translations in the training set, respectively;

[0129] Step S111, using the average classification method to set the human evaluation category of the machine translation; the human evaluation score after scaling the machine translation is divided into quality levels according to the interval in which it is located, and the quality level is 10 consecutive natural numbers starting from 0, as shown in formula (2):

[0130] (2);

[0131] Here, z represents the human evaluation category of the machine translation.

[0132] Appendix 1: An example of a training sample in the training set

[0133]

[0134] Furthermore, in step S2, a similarity feature vector from the source language sentence to the machine translation is extracted, specifically:

[0135] Step S21, sequentially connect the source language sentence and the machine translation in each sample in the normalized training set, as shown in formula (3):

[0136] (3);

[0137] Among them, s2h represents the combined string of source language sentence to machine translation, and the symbol <s>、< / s> Indicates the start and end characters of a string;

[0138] The combined string of source language sentences and machine translations of the training sample examples in Appendix 1 is: This document is proposed by the Ministry of Industry and Information Technology.

[0139] Step S22, input the source language sentence to the machine translation combined string into the large language model Llama 2, and the large language model Llama 2 uses the subword segmentation method SentencePiece algorithm to segment the source language sentence to the machine translation combined string into subwords to obtain a subword sequence containing m subwords, as shown in formula (4):

[0140] (4);

[0141] Where m represents the number of subwords from the source language sentence to the machine translation string; s1, s2, s m It represents the first subword, the second subword, and the mth subword after the subword segmentation of the source language sentence to the machine translation joint string;

[0142] In step S23, the large language model Llama 2 generates subword-level feature vectors from the source language sentence to the machine translation word by word in a left-to-right order, as shown in formula (5):

[0143] (5);

[0144] Among them, v s2h Represents the subword-level feature vector from the source language sentence to the machine translation, Llama2() represents the output function of the large language model Llama 2, vs1, vs2, vs m Respectively represent the feature vector of the first subword, the feature vector of the second subword, and the feature vector of the mth subword from the source language sentence to the machine translation;

[0145] Optionally, the large language model Llama 2 uses the 6.7 billion parameter model "Llama-2-7b", which has 32 Transformer encoder hidden layers and 32 self-attention heads, and outputs a 4096-dimensional vector for each subword;

[0146] Step S24, the large language model Llama 2 uses a unidirectional deep representation method to extract the feature vector of the last subword of the subword-level feature vector from the source language sentence to the machine translation vs m As the similarity feature vector from the source language sentence to the machine translation.

[0147] Step S31, connect the machine translation and source language sentences in each sample in the normalized training set in sequence, as shown in formula (6):

[0148] (6);

[0149] Among them, h2s represents the joint string of machine translation to source language sentence;

[0150] The machine translation of the training sample example in Appendix 1 to the source language sentence joint string is: This document is proposed by the Ministry of Industry and Information Technology. This document is proposed and managed by the Ministry of Industry and Information Technology. ;

[0151] Step S32: input the machine translation to the source language sentence joint string into the large language model Llama 2, and the large language model Llama 2 uses the subword segmentation method SentencePiece algorithm to segment the machine translation to the source language sentence joint string into subwords to obtain a subword sequence containing n subwords, as shown in formula (7):

[0152] (7);

[0153] Where n represents the number of subwords in the machine translation to the source language sentence and the string for subword segmentation; h1, h2, h n Indicates the first subword, the second subword, and the nth subword of the machine translation to the source language sentence after the subword segmentation of the joint string;

[0154] In step S33, the large language model Llama 2 generates a subword-level feature vector of the machine translation to the source language sentence word by word from left to right, as shown in formula (8):

[0155] (8);

[0156] Among them, v h2s Represents the subword-level feature vector of the machine translation to the source language sentence, vh1, vh2, vh n The feature vectors of the first subword, the second subword, and the nth subword of the subword-level feature vectors of the machine translation to the source language sentence are represented respectively;

[0157] Step S34, taking the feature vector vh of the last subword of the subword-level feature vector of the machine translation to the source language sentence n As the similarity feature vector between the machine translation and the source language sentence.

[0158] Furthermore, in step S4, a feature vector for estimating the quality of machine translation is extracted, specifically:

[0159] Step S41, concatenate the similarity feature vector from the source language sentence to the machine translation in step S2 and the similarity feature vector from the machine translation to the source language sentence in step S3, as shown in formula (9):

[0160] (9);

[0161] Among them, x represents the concatenated feature vector of the machine translation and the source language sentence, and the symbol “⊕” represents the vector concatenation operation;

[0162] Step S42, input the machine translation and source language sentence concatenation feature vector into the machine translation quality estimation task adapter layer, and output the machine translation quality estimation feature vector, as shown in formula (10):

[0163] (10);

[0164] Among them, QEFV represents the machine translation quality estimation feature vector, tanh() represents the activation function tanh of the neural network, parameters w1 and b1 are the learnable parameters of the neural network, and T represents the transpose operation of the matrix.

[0165] Furthermore, in step S5, the quality score of the machine translation based on the deep representation of the large language model is predicted, specifically:

[0166] The machine translation quality estimation feature vector in step S4 is input into the main regression network layer to predict the machine translation quality score based on the deep representation of the large language model, as shown in formula (11):

[0167] (11);

[0168] Among them, Pvalues ​​is the predicted machine translation quality score based on the deep representation of the large language model, and the parameters w2 and b2 are the learnable parameters of the neural network.

[0169] Furthermore, in step S6, the machine translation quality category based on the deep representation of the large language model is predicted, specifically:

[0170] The machine translation quality estimation feature vector in step S4 is input into the auxiliary classification network layer to predict the machine translation quality category based on the deep representation of the large language model, as shown in formula (12) and formula (13):

[0171] (12);

[0172] (13);

[0173] Among them, Probs is the predicted probability of machine translation quality category based on deep representation of large language model, Pclass is the predicted machine translation quality category based on deep representation of large language model, argmax() is the index function that returns the maximum value of the vector, softmax() represents the activation function softmax of the neural network, and parameters w3 and b3 are the learnable parameters of the neural network.

[0174] Furthermore, in step S7, a machine translation quality estimation model based on deep representation of a large language model is trained, specifically:

[0175] Step S71, according to the machine translation quality score based on the deep representation of the large language model predicted in step S5 and the human evaluation score of the machine translation in the training set after the normalization processing in step S1, calculate the mean square error loss on the training set, as shown in formula (14):

[0176] (14);

[0177] Among them, MSE represents the mean square error loss on the training set, N represents the number of samples in the training set, i represents the i-th sample in the training set, and y (i) Pvalues ​​represents the human evaluation score of the machine translation of the i-th sample in the training set. (i) represents the machine translation quality score predicted by the i-th sample based on the deep representation of the large language model;

[0178] Step S72, according to the machine translation quality category based on the deep representation of the large language model predicted in step S6 and the human evaluation category of the machine translation in the training set after the normalization processing in step S1, calculate the cross entropy loss on the training set, as shown in formula (15):

[0179] (15);

[0180] Among them, CrossEntropy represents the cross entropy loss on the training set, z (i) represents the human evaluation category of the i-th sample machine translation in the training set, represents the probability of machine translation quality category predicted by the i-th sample in the training set based on the deep representation of the large language model at the z-th (i) Probability values ​​on categories;

[0181] In step S73, the linearly weighted mean square error loss on the training set and the cross entropy loss on the training set are used as the total loss on the training set, as shown in formula (16):

[0182] (16);

[0183] Among them, SumLoss represents the total loss on the training set, and 0.2 is the linear interpolation weight, which is obtained through experimental experience;

[0184] Step S74, minimizing the total loss on the training set to train the parameters of the machine translation quality estimation model based on the deep representation of the large language model, and obtaining the trained machine translation quality estimation model based on the deep representation of the large language model, as shown in formula (17) and formula (18):

[0185] (17);

[0186] (18);

[0187] in, represents a set of optimal parameters that minimize the total loss on the training set; argmin is the function of the optimal parameters when taking the minimum value; θ represents the parameters of the machine translation quality estimation model based on the deep representation of the large language model, including the parameters in the large language model Llama 2, which are the learnable parameters w1, w2, w3 and b1, b2, b3 of the neural network; Preds is the predicted machine translation quality score; g represents a set of optimal parameters of the machine translation quality estimation model based on the deep representation of the large language model, when given the source language sentence src, the machine translation hypothesis and the total loss , outputs the predicted machine translation quality score.

[0188] Furthermore, in step S9, the prompt is used to perform machine translation using a large language model to generate a pseudo reference translation of the source language sentence, specifically:

[0189] The compilation prompt is connected with the source language sentence to form a translation instruction, as shown in formula (19) and formula (20):

[0190] TransPrompt1 ← Translate from [ srclang ] to [ trglang ] : src (19);

[0191] TransPrompt 2 ← Translate src to [ trglang ] : (20);

[0192] Wherein, TransPrompt1 and TransPrompt2 are the first and second translation instructions respectively, translate from[]to[] and translate[]to[] represent the translation prompts in the translation instructions; srclang is the source language name, and trglang is the target language name;

[0193] In the dialogue mode, the translation instruction is input into the large language model to output the translation result of the source language sentence, as shown in formula (21) and formula (22):

[0194] (twenty one);

[0195] (twenty two);

[0196] Among them, PseudoRef1 and PseudoRef2 are the translation results of the source language sentences respectively, and Llama2Chat() is the output function of the large language model Llama 2 in the conversation mode;

[0197] Optionally, the large language model Llama 2 in conversation mode uses the 6.7 billion parameter model "Llama-2-7b-chat", which has 32 Transformer encoder hidden layers and 32 self-attention heads;

[0198] The translation results PseudoRef1 and PseudoRef2 of the source language sentences are used as pseudo reference translations.

[0199] Furthermore, in step S10, the source language sentence, the machine translation and the pseudo reference translation are input into the machine translation automatic evaluation method to calculate the machine translation quality score based on the large language model prompt, specifically:

[0200] The source language sentence, machine translation and pseudo-reference translation are input into the machine translation automatic evaluation method to output the machine translation quality score, and the highest score is selected as the machine translation quality score based on the large language model prompt, as shown in formula (23), formula (24) and formula (25):

[0201] (twenty three);

[0202] (twenty four);

[0203] (25);

[0204] Among them, MetricsScore1 and MetricsScore2 represent two machine translation quality scores, MetricsScore represents the machine translation quality score based on the large language model prompt, Metrics() represents the output function of the machine translation automatic evaluation method, and Max() represents the maximum value function.

[0205] Optionally, the automatic evaluation method for machine translation uses the currently advanced automatic evaluation method for machine translation based on neural network, UniTE_UP. Special note: Unlike the quality estimation of machine translation without the help of manual reference translation, the automatic evaluation of machine translation requires manual reference translation to score the quality of machine translation. Therefore, the present invention uses a large language model to perform machine translation in dialogue mode to generate a pseudo reference translation, replaces the manual reference translation with the pseudo reference translation, and uses the automatic evaluation method for machine translation to quantitatively evaluate the quality of the translation.

[0206] Furthermore, in step S11, the machine translation quality score based on the large language model is calculated, specifically:

[0207] The machine translation quality score based on the deep representation of the large language model predicted in step S8 and the machine translation quality score based on the prompt of the large language model in step S10 are linearly weighted to obtain the machine translation quality score based on the large language model:

[0208] (26);

[0209] in, Represents the machine translation quality score based on the large language model; Preds represents the machine translation quality score based on the deep representation of the large language model predicted in step S8; 0.8 is the linear interpolation weight, which is obtained based on experimental experience.

[0210] Since the method disclosed in the present invention is not proposed for the characteristic large language model Llama 2, the method disclosed in the present invention can be applied to other large language models, such as large language models ChatGPT, ChatGLM, Gemini, Zephyr, etc.

[0211] Since the method of the present disclosure is not proposed for two specific languages, the method of the present disclosure has universal applicability.

[0212] The protection content of the present invention is not limited to the above embodiments. Without departing from the spirit and scope of the inventive concept, changes and advantages that can be thought of by those skilled in the art are included in the present invention and are protected by the attached claims.

Claims

1. A method for estimating machine translation quality based on a large language model, characterized by: Here are the steps: Step S1, obtaining a training set, normalizing the training set, and obtaining a normalized training set; the training set is composed of a plurality of different samples, each sample including a source language sentence, a machine translation, a human evaluation score of the machine translation, and a human evaluation category of the machine translation; Step S2, extracting the similarity feature vector from the source language sentence to the machine translation; sequentially connecting the source language sentence and the machine translation in each sample in the normalized training set, inputting them into the large language model, outputting the subword-level feature vector from the source language sentence to the machine translation, and extracting the feature vector of the last subword of the subword-level feature vector from the source language sentence to the machine translation as the similarity feature vector from the source language sentence to the machine translation; Step S3, extracting a similarity feature vector from the machine translation to the source language sentence; sequentially connecting the machine translation and the source language sentence in each sample in the normalized training set, inputting them into the large language model, outputting a subword-level feature vector from the machine translation to the source language sentence, and extracting a feature vector of the last subword from the subword-level feature vector from the machine translation to the source language sentence as a similarity feature vector from the machine translation to the source language sentence; Step S4, extracting a machine translation quality estimation feature vector; concatenating the similarity feature vector from the source language sentence to the machine translation in step S2 and the similarity feature vector from the machine translation to the source language sentence in step S3, and inputting the concatenated vectors into the machine translation quality estimation task adapter layer, and outputting the machine translation quality estimation feature vector; Step S5, predicting a machine translation quality score based on the deep representation of the large language model; Input the machine translation quality estimation feature vector in step S4 into the main regression network layer to predict the machine translation quality score based on the deep representation of the large language model; Step S6, predicting the quality category of the machine translation based on the deep representation of the large language model; Input the machine translation quality estimation feature vector in step S4 into the auxiliary classification network layer to predict the machine translation quality category based on the deep representation of the large language model; Step S7, training a machine translation quality estimation model based on deep representation of a large language model; Calculate the mean square error loss on the training set according to the machine translation quality score based on the deep representation of the large language model predicted in step S5 and the human evaluation score of the machine translation in the training set after the normalization processing in step S1; Calculate the cross entropy loss on the training set according to the quality category of the machine translation based on the deep representation of the large language model predicted in step S6 and the human evaluation category of the machine translation in the training set after the normalization processing in step S1; The linearly weighted mean square error loss and the cross entropy loss on the training set are used as the total loss on the training set, and the total loss on the training set is minimized to train the parameters of the machine translation quality estimation model based on the deep representation of the large language model, thereby obtaining the trained machine translation quality estimation model based on the deep representation of the large language model; Step S8, normalizing the source language sentences and machine translations and inputting them into the machine translation quality estimation model based on deep representation of a large language model trained in step S7, and predicting the machine translation quality score based on deep representation of a large language model; Step S9, using the prompt to use the large language model to perform machine translation to generate a pseudo reference translation of the source language sentence; The compilation prompt is connected with the source language sentence to form a translation instruction, and the translation instruction is input into the large language model in the dialogue mode to output the translation result of the source language sentence, and the translation result of the source language sentence is used as a pseudo reference translation; Step S10, inputting the source language sentence, the machine translation and the pseudo reference translation into the machine translation automatic evaluation method to calculate the machine translation quality score based on the large language model prompt; Inputting the source language sentence, the machine translation and the pseudo reference translation into the machine translation automatic evaluation method to output the machine translation quality score, and selecting the highest score as the machine translation quality score based on the large language model prompt; Step S11, calculating the machine translation quality score based on the large language model; Linearly weighting the machine translation quality score based on the deep representation of the large language model predicted in step S8 and the machine translation quality score based on the prompt of the large language model in step S10 to obtain the machine translation quality score based on the large language model; The training set in step S1 consists of multiple different samples, each of which is: Step S110, given a sample d={src, hypothesis, y} in the training set, where d represents a training sample, src represents a source language sentence, hypothesis represents a machine translation, and y represents a human evaluation score of the machine translation; The human evaluation scores of the machine translations are scaled to the range of [0,1] using the minimum-maximum normalization method to obtain the scaled human evaluation scores of the machine translations, as shown in formula (1): (1); Among them, y scaled represents the human evaluation score after machine translation scaling; y max ,y min They represent the maximum and minimum human evaluation scores of machine translations in the training set, respectively; Step S111, using the average classification method to set the human evaluation category of the machine translation; the human evaluation score after scaling the machine translation is divided into quality levels according to the interval in which it is located, and the quality level is 10 consecutive natural numbers starting from 0, as shown in formula (2): (2); Where z represents the human evaluation category of the machine translation; In step S2, the similarity feature vector between the source language sentence and the machine translation is extracted, specifically: Step S21, sequentially connect the source language sentence and the machine translation in each sample in the normalized training set, as shown in formula (3): (3); Among them, s2h represents the combined string of source language sentence to machine translation, and the symbol <s>、< / s> Indicates the start and end characters of a string; Step S22, input the source language sentence to the machine translation combined string into the large language model Llama 2, and the large language model Llama 2 uses the subword segmentation method SentencePiece algorithm to segment the source language sentence to the machine translation combined string into subwords to obtain a subword sequence containing m subwords, as shown in formula (4): (4); Where m represents the number of subwords from the source language sentence to the machine translation string; s1, s2, s m It represents the first subword, the second subword, and the mth subword after the subword segmentation of the source language sentence to the machine translation joint string; In step S23, the large language model Llama 2 generates subword-level feature vectors from the source language sentence to the machine translation word by word in a left-to-right order, as shown in formula (5): (5); Among them, v s2h Represents the subword-level feature vector from the source language sentence to the machine translation, Llama2() represents the output function of the large language model Llama 2, vs1, vs2, vs m Respectively represent the feature vector of the first subword, the feature vector of the second subword, and the feature vector of the mth subword from the source language sentence to the machine translation; Step S24, the large language model Llama 2 uses a unidirectional deep representation method to extract the feature vector of the last subword of the subword-level feature vector from the source language sentence to the machine translation vs m As a similarity feature vector from the source language sentence to the machine translation; In step S3, the similarity feature vector between the machine translation and the source language sentence is extracted, specifically: Step S31, connect the machine translation and source language sentences in each sample in the normalized training set in sequence, as shown in formula (6): (6); Among them, h2s represents the joint string of machine translation to source language sentence; Step S32: input the machine translation to the source language sentence joint string into the large language model Llama 2, and the large language model Llama 2 uses the subword segmentation method SentencePiece algorithm to segment the machine translation to the source language sentence joint string into subwords to obtain a subword sequence containing n subwords, as shown in formula (7): (7); Where n represents the number of subwords in the machine translation to the source language sentence and the string for subword segmentation; h1, h2, h n Indicates the first subword, the second subword, and the nth subword of the machine translation to the source language sentence after the subword segmentation of the joint string; In step S33, the large language model Llama 2 generates a subword-level feature vector of the machine translation to the source language sentence word by word from left to right, as shown in formula (8): (8); Among them, v h2s Represents the subword-level feature vector of the machine translation to the source language sentence, vh1, vh2, vh n The feature vectors of the first subword, the second subword, and the nth subword of the subword-level feature vectors of the machine translation to the source language sentence are represented respectively; Step S34, taking the feature vector vh of the last subword of the subword-level feature vector of the machine translation to the source language sentence n As a similarity feature vector between the machine translation and the source language sentence; In step S4, the feature vector for machine translation quality estimation is extracted, which is specifically: Step S41, concatenate the similarity feature vector from the source language sentence to the machine translation in step S2 and the similarity feature vector from the machine translation to the source language sentence in step S3, as shown in formula (9): (9); Among them, x represents the concatenated feature vector of the machine translation and the source language sentence, and the symbol "⊕" represents the vector concatenation operation; Step S42, input the machine translation and source language sentence concatenation feature vector into the machine translation quality estimation task adapter layer, and output the machine translation quality estimation feature vector, as shown in formula (10): (10); Where QEFV represents the machine translation quality estimation feature vector, tanh() represents the activation function tanh of the neural network, parameters w1 and b1 are the learnable parameters of the neural network, and T represents the transpose operation of the matrix; In step S5, the quality score of the machine translation based on the deep representation of the large language model is predicted, specifically: The machine translation quality estimation feature vector in step S4 is input into the main regression network layer to predict the machine translation quality score based on the deep representation of the large language model, as shown in formula (11): (11); Among them, Pvalues ​​is the predicted machine translation quality score based on the deep representation of the large language model, and the parameters w2 and b2 are the learnable parameters of the neural network; In step S6, the machine translation quality category based on the deep representation of the large language model is predicted, specifically: The machine translation quality estimation feature vector in step S4 is input into the auxiliary classification network layer to predict the machine translation quality category based on the deep representation of the large language model, as shown in formula (12) and formula (13): (12); (13); Among them, Probs is the predicted probability of machine translation quality category based on deep representation of large language model, Pclass is the predicted machine translation quality category based on deep representation of large language model, argmax() is the index function that returns the maximum value of the vector, softmax() represents the activation function softmax of the neural network, and parameters w3 and b3 are the learnable parameters of the neural network.

2. The method for estimating machine translation quality based on a large language model according to claim 1, characterized in that: In step S7, a machine translation quality estimation model based on deep representation of a large language model is trained, specifically: Step S71, according to the machine translation quality score based on the deep representation of the large language model predicted in step S5 and the human evaluation score of the machine translation in the training set after the normalization processing in step S1, calculate the mean square error loss on the training set, as shown in formula (14): (14); Among them, MSE represents the mean square error loss on the training set, N represents the number of samples in the training set, i represents the i-th sample in the training set, and y (i) Pvalues ​​represents the human evaluation score of the machine translation of the i-th sample in the training set. (i) represents the machine translation quality score predicted by the i-th sample based on the deep representation of the large language model; Step S72, according to the machine translation quality category based on the deep representation of the large language model predicted in step S6 and the human evaluation category of the machine translation in the training set after the normalization processing in step S1, calculate the cross entropy loss on the training set, as shown in formula (15): (15); Among them, CrossEntropy represents the cross entropy loss on the training set, z (i) represents the human evaluation category of the i-th sample machine translation in the training set, represents the probability of machine translation quality category predicted by the i-th sample in the training set based on the deep representation of the large language model at the z-th (i) Probability values ​​on categories; In step S73, the linearly weighted mean square error loss on the training set and the cross entropy loss on the training set are used as the total loss on the training set, as shown in formula (16): (16); Among them, SumLoss represents the total loss on the training set, and 0.2 is the linear interpolation weight, which is obtained through experimental experience; Step S74, minimizing the total loss on the training set to train the parameters of the machine translation quality estimation model based on the deep representation of the large language model, and obtaining the trained machine translation quality estimation model based on the deep representation of the large language model, as shown in formula (17) and formula (18): (17); (18); in, represents a set of optimal parameters that minimize the total loss on the training set; argmin is the function of the optimal parameters when taking the minimum value; θ represents the parameters of the machine translation quality estimation model based on the deep representation of the large language model, including the parameters in the large language model Llama 2, which are the learnable parameters w1, w2, w3 and b1, b2, b3 of the neural network; Preds is the predicted machine translation quality score; g represents a set of optimal parameters of the machine translation quality estimation model based on the deep representation of the large language model, when given the source language sentence src, the machine translation hypothesis and the total loss , outputs the predicted machine translation quality score.

3. The method for estimating machine translation quality based on a large language model according to claim 2, characterized in that: The following steps are also included: In step S9, the prompt is used to use the large language model to perform machine translation to generate a pseudo reference translation of the source language sentence, specifically: The compilation prompt is connected with the source language sentence to form a translation instruction, as shown in formula (19) and formula (20): (19); (20); Wherein, TransPrompt1 and TransPrompt2 are the first and second translation instructions respectively, translate from[]to[] and translate[]to[] represent the translation prompts in the translation instructions; srclang is the source language name, and trglang is the target language name; In the dialogue mode, the translation instruction is input into the large language model to output the translation result of the source language sentence, as shown in formula (21) and formula (22): (21); (22); Among them, PseudoRef1 and PseudoRef2 are the translation results of the source language sentences respectively, and Llama2Chat() is the output function of the large language model Llama 2 in the conversation mode; The translation results PseudoRef1 and PseudoRef2 of the source language sentences are used as pseudo reference translations; In step S10, the source language sentence, the machine translation and the pseudo reference translation are input into the machine translation automatic evaluation method to calculate the machine translation quality score based on the large language model prompt, specifically: The source language sentence, machine translation and pseudo-reference translation are input into the machine translation automatic evaluation method to output the machine translation quality score, and the highest score is selected as the machine translation quality score based on the large language model prompt, as shown in formula (23), formula (24) and formula (25): (23); (24); (25); Among them, MetricsScore1 and MetricsScore2 represent two machine translation quality scores, MetricsScore represents the machine translation quality score based on the large language model prompt, Metrics() represents the output function of the machine translation automatic evaluation method, and Max() represents the maximum value function.

4. The method for estimating machine translation quality based on a large language model according to claim 3, characterized in that: In step S11, the quality score of the machine translation based on the large language model is calculated, specifically: The machine translation quality score based on the deep representation of the large language model predicted in step S8 and the machine translation quality score based on the prompt of the large language model in step S10 are linearly weighted to obtain the machine translation quality score based on the large language model: (26); in, Represents the machine translation quality score based on the large language model; Preds represents the machine translation quality score based on the deep representation of the large language model predicted in step S8; 0.8 is the linear interpolation weight, which is obtained based on experimental experience.

Citation Information

Patent Citations

  • Sub-word unit splitting method and device, and computer readable storage medium

    CN111062206A

  • Translation quality evaluation score fusion method and device based on large language model

    CN117610584A