Machine translation text accuracy calculation method and system
By using a multilingual pre-trained model for sentence vector embedding and error transfer function construction, the problem of subjective bias in machine translation quality assessment is solved, achieving more accurate translation quality assessment, which is applicable to the field of language translation technology.
Patent Information
- Application Number
- CN202211249116.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-12
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2042-10-12
AI Technical Summary
Existing machine translation quality assessment methods, such as BLEU scores, suffer from subjective bias and one-sidedness, making it difficult to accurately judge the quality of machine-translated texts compared to reference translations.
A multilingual pre-trained model is used for sentence vector embedding, an error propagation function is constructed, and the model accuracy is divided by different translation quality levels and character lengths. A machine translation accuracy calculation model is trained and evaluated in combination with the original text and reference translations.
It achieves a more objective and accurate assessment of machine-translated text quality, enabling the evaluation of translation accuracy from multiple perspectives and providing more precise multi-dimensional calculation results.
Smart Images

Figure CN115600612B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of language translation, and in particular to a machine translation accuracy calculation method and system. BACKGROUND
[0002] When a machine performs translation, it is usually necessary to judge and calculate the quality of machine translation.
[0003] Currently, the Bilingual Evaluation Understudy (BLEU) value method is commonly used, which calculates the n-gram similarity between the machine translation and the reference translation. However, the BLEU value also has some potential problems that can lead to non-objective evaluation, such as: for a given original text, the reference translation is not unique, if the machine translation itself is of good quality but does not match the reference translation, the BLEU value calculation result will be low; although multiple reference translations can be input during BLEU value calculation, it is costly to obtain multiple reference translations, and such data is usually scarce and difficult to implement. SUMMARY
[0004] The present application provides a machine translation accuracy calculation method and system to solve the problem of non-objective and inaccurate results when simultaneously judging the quality of machine translation and reference translation in the prior art.
[0005] In a first aspect, the present application provides a machine translation accuracy calculation method, comprising:
[0006] obtaining a set of to-be-calculated corpus;
[0007] inputting the set of to-be-calculated corpus into a pre-trained machine translation accuracy calculation model to obtain a machine translation accuracy calculation result; wherein the machine translation accuracy calculation model is trained based on a multi-language pre-training model for sentence vector embedding of an original corpus set, uses different translation quality levels to construct an error propagation function, and divides different model precisions according to multiple character lengths.
[0008] According to the machine translation accuracy calculation method provided by the present application, the machine translation accuracy calculation model is obtained by the following steps:
[0009] obtaining the original corpus set;
[0010] constructing a first corpus triple and a second corpus triple based on the original corpus set;
[0011] inputting the first corpus triple and the second corpus triple into the multi-language pre-training model to obtain a plurality of embedding vectors;
[0012] constructing the error transfer function from the plurality of embedding vectors and a preset embedding vector deviation value;
[0013] determining the different model precisions according to the plurality of character lengths, minimizing the error transfer function based on the different model precisions to obtain a plurality of calculation sub-models of different precisions;
[0014] constructing the machine translation accuracy calculation model from the plurality of calculation sub-models of different precisions.
[0015] According to the machine translation accuracy calculation method provided by the application, the original corpus set is obtained, which comprises:
[0016] The original text, the machine translation, the translator's post-editing translation and the proofreading post-editing translation are obtained.
[0017] According to the machine translation accuracy calculation method provided by the application, the first corpus triple and the second corpus triple are constructed based on the original corpus set, which comprises:
[0018] The first corpus triple is constructed from the original text, the machine translation and the proofreading post-editing translation;
[0019] The second corpus triple is constructed from the original text, the translator's post-editing translation and the proofreading post-editing translation.
[0020] According to the machine translation accuracy calculation method provided by the application, the error transfer function is constructed from the plurality of embedding vectors and a preset embedding vector deviation value, which comprises:
[0021] A first loss function is constructed based on the original text embedding vector, the machine translation embedding vector and the translator's post-editing translation embedding vector, the first loss function is determined by the maximum value between the difference between the first Euler distance and the second Euler distance and the sum of the preset embedding vector deviation value and 0;
[0022] A second loss function is constructed based on the proofreading post-editing translation embedding vector, the machine translation embedding vector and the translator's post-editing translation embedding vector, the second loss function is determined by the maximum value between the difference between the third Euler distance and the fourth Euler distance and the sum of the preset embedding vector deviation value and 0;
[0023] The first loss function and the second loss function are summed to obtain the error transfer function;
[0024] The first Euler distance is determined by the original text embedding vector and the translator post-editing translation embedding vector, the second Euler distance is determined by the original text embedding vector and the machine translation text embedding vector, the third Euler distance is determined by the proofreading post-editing translation embedding vector and the translator post-editing translation embedding vector, and the fourth Euler distance is determined by the proofreading post-editing translation embedding vector and the machine translation text embedding vector.
[0025] The preset embedding vector deviation value is obtained by obtaining the deviation between the machine translation text embedding vector and the translator post-editing translation embedding vector through the original text embedding vector and the proofreading post-editing translation embedding vector.
[0026] According to the machine translation text accuracy calculation method provided by the application, the different model precisions are determined according to the character lengths, the error transfer function is minimized based on the different model precisions, and a plurality of calculation sub-models with different precisions are obtained, including:
[0027] A plurality of character length intervals are determined according to the character lengths, and the different model precisions are determined according to the plurality of character length intervals.
[0028] Based on the different model precisions, it is determined in the error transfer function that the translator post-editing translation embedding vector is greater than the machine translation text embedding vector as a different preset embedding vector deviation value.
[0029] Based on the different preset embedding vector deviation values, the plurality of calculation sub-models with different precisions are obtained.
[0030] According to the machine translation text accuracy calculation method provided by the application, the machine translation text accuracy calculation result is obtained by inputting the to-be-calculated corpus set into a pre-trained machine translation text accuracy calculation model, including:
[0031] The original text, machine translation text and proofreading post-editing translation text in the to-be-calculated corpus set are input into the machine translation text accuracy calculation model to obtain an original text embedding vector, a machine translation text embedding vector and a proofreading post-editing translation embedding vector.
[0032] The second Euler distance of the original text embedding vector and the machine translation text embedding vector, and the fourth Euler distance of the proofreading post-editing translation embedding vector and the machine translation text embedding vector are obtained, and the machine translation text accuracy calculation result is obtained based on the second Euler distance and the fourth Euler distance.
[0033] inputting the original text, the post-editor translation and the post-editor proofreading translation in the corpus set to be calculated into the machine translation text accuracy calculation model to obtain an original text embedding vector, a post-editor translation embedding vector and a post-editor proofreading translation embedding vector;
[0034] obtaining a first Euler distance of the original text embedding vector and the post-editor translation embedding vector and a third Euler distance of the post-editor proofreading translation embedding vector and the post-editor translation embedding vector, and obtaining a post-editor translation accuracy calculation result based on the first Euler distance and the third Euler distance.
[0035] In a second aspect, the present application further provides a machine translation text accuracy calculation system, comprising:
[0036] an acquisition module configured to acquire a corpus set to be calculated;
[0037] a calculation module configured to input the corpus set to be calculated into a pre-trained machine translation text accuracy calculation model to obtain a machine translation text accuracy calculation result; wherein the machine translation text accuracy calculation model is trained based on a multi-language pre-training model for sentence vector embedding of an original corpus set, an error transfer function is constructed using different translation quality levels, and different model precisions are divided according to a plurality of character lengths.
[0038] In a third aspect, the present application further provides an electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the machine translation text accuracy calculation method according to any one of the above aspects when executing the program.
[0039] In a fourth aspect, the present application further provides a non-transitory computer readable storage medium having a computer program stored thereon, wherein the computer program is executable by a processor to implement the machine translation text accuracy calculation method according to any one of the above aspects.
[0040] In a fifth aspect, the present application further provides a computer program product comprising a computer program, wherein the computer program is executable by a processor to implement the machine translation text accuracy calculation method according to any one of the above aspects.
[0041] The machine translation text accuracy calculation method and system provided by the present application can obtain more accurate multi-dimensional machine translation text accuracy calculation values by simultaneously considering the original text and the reference translation, constructing a machine translation text accuracy calculation model, using a multi-language pre-training model for sentence vector embedding, constructing an error transfer function using different quality levels, and fine-tuning the model. BRIEF DESCRIPTION OF DRAWINGS
[0042] In order to more clearly illustrate the technical solutions of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings described below are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0043] Figure 1 is a flowchart of the machine translation text accuracy calculation method provided by the present application.
[0044] Figure 2 is a model training schematic diagram provided by the present application.
[0045] Figure 3 is a structural schematic diagram of the machine translation text accuracy calculation system provided by the present application.
[0046] Figure 4 is a structural schematic diagram of the electronic device provided by the present application. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme of the present application will be described clearly and completely below in combination with the drawings in the present application. Obviously, the described embodiments are some embodiments of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor belong to the scope of protection of the present application.
[0048] The machine translation text accuracy calculation method and system of the present application will be described below in combination with Figures 1-4
[0049] Figure 1 is a flowchart of the machine translation text accuracy calculation method provided by the present application, as Figure 1 shown, comprising:
[0050] Step 100: obtaining a to-be-calculated corpus set;
[0051] Step 200: inputting the to-be-calculated corpus set into a pre-trained machine translation text accuracy calculation model to obtain a machine translation text accuracy calculation result; wherein the machine translation text accuracy calculation model is trained based on a multi-language pre-training model for sentence vector embedding of an original corpus set, an error propagation function is constructed using different translation quality levels, and different model precisions are divided according to a plurality of character lengths.
[0052] It should be noted that, since the existing BLEU value method for judging machine translation text and reference translation text has subjective bias and one-sidedness, the pre-training language model is introduced in the present application, and with the wide use of the pre-training language model, especially the use of multi-language pre-training model, the sentences of different languages are embedded in the semantic space for comparison, so that when evaluating the machine translation text, not only the consistency of the machine translation text and the reference translation text is compared, but also the consistency of the machine translation text and the original text is compared, thereby providing a more objective means for calculating and judging the quality of the machine translation text from multiple angles.
[0053] The present application obtains a large amount of original corpus composed of translation data generated by each link in the translation project, including the original text src, the machine translation text mt, the translator post-editing translation text pe and the proofreading post-editing translation text ref.
[0054] Then, a multi-language pre-training model for performing initial sentence embedding is selected, a training loss function is designed for model convergence, and model precision is formulated according to the length of the translation text for model training, so as to obtain a final machine translation text accuracy calculation model.
[0055] The trained machine translation text accuracy calculation model is input with the to-be-calculated corpus set, so as to obtain accurate machine translation text accuracy calculation results.
[0056] The present application constructs a machine translation text accuracy calculation model by simultaneously considering the original text and the reference translation text, uses a multi-language pre-training model for sentence vector embedding, constructs an error transfer function with different quality levels, and finely trains the model, so as to obtain more accurate multi-dimensional machine translation text accuracy calculation values.
[0057] Based on the above embodiment, the machine translation text accuracy calculation model is obtained by the following steps:
[0058] The original corpus set is obtained;
[0059] The first corpus triple and the second corpus triple are constructed based on the original corpus set;
[0060] The first corpus triple and the second corpus triple are input into the multi-language pre-training model to obtain a plurality of embedding vectors;
[0061] The error transfer function is constructed from the plurality of embedding vectors and a preset embedding vector deviation value;
[0062] The different model precisions are determined according to the plurality of character lengths, the error transfer function is minimized based on the different model precisions, and a plurality of calculation sub-models with different precisions are obtained;
[0063] The machine translation text accuracy calculation model is composed of the plurality of calculation sub-models with different precisions.
[0064] The obtaining of the original corpus set comprises:
[0065] The original text, the machine translation text, the translator post-editing translation text and the proofreading post-editing translation text are obtained.
[0066] According to the machine translation text accuracy calculation method provided by the application, the first corpus triple and the second corpus triple are constructed based on the original corpus set, which comprises:
[0067] The first corpus triple is constructed by the original text, the machine translation text and the proofreading post-editing translation text;
[0068] The second corpus triple is constructed by the original text, the translator post-editing translation text and the proofreading post-editing translation text.
[0069] The error propagation function is constructed by the plurality of embedding vectors and the preset embedding vector deviation value, which comprises:
[0070] The first loss function is constructed based on the original text embedding vector, the machine translation text embedding vector and the translator post-editing translation text embedding vector, and the first loss function is determined by the maximum value between the difference between the first Euler distance and the second Euler distance and the sum of the preset embedding vector deviation value and 0;
[0071] The second loss function is constructed based on the proofreading post-editing translation text embedding vector, the machine translation text embedding vector and the translator post-editing translation text embedding vector, and the second loss function is determined by the maximum value between the difference between the third Euler distance and the fourth Euler distance and the sum of the preset embedding vector deviation value and 0;
[0072] The first loss function and the second loss function are summed to obtain the error propagation function;
[0073] The first Euler distance is determined by the original text embedding vector and the translator post-editing translation text embedding vector, the second Euler distance is determined by the original text embedding vector and the machine translation text embedding vector, the third Euler distance is determined by the proofreading post-editing translation text embedding vector and the translator post-editing translation text embedding vector, and the fourth Euler distance is determined by the proofreading post-editing translation text embedding vector and the machine translation text embedding vector;
[0074] The preset embedding vector deviation value is obtained by the original text embedding vector and the proofreading post-editing translation text embedding vector, and the deviation amount between the machine translation text embedding vector and the translator post-editing translation text embedding vector is obtained.
[0075] The different model precisions are determined according to the plurality of character lengths, the error transfer function is minimized based on the different model precisions, and a plurality of calculation sub-models with different precisions are obtained, including:
[0076] A plurality of character length intervals are determined according to the plurality of character lengths, and the different model precisions are determined according to the plurality of character length intervals;
[0077] Based on the different model precisions, a preset embedding vector deviation value is determined in the error transfer function when the interpreter post-edit translation embedding vector is greater than the machine translation embedding vector.
[0078] Based on the different preset embedding vector deviation values, the plurality of calculation sub-models with different precisions are obtained.
[0079] The plurality of character length intervals are determined according to the plurality of character lengths, and the different model precisions are determined according to the plurality of character length intervals;
[0080] The original text, machine translation and post-editing translation in the to-be-calculated corpus set are input into the machine translation accuracy calculation model to obtain an original text embedding vector, a machine translation embedding vector and a post-editing translation embedding vector;
[0081] A second Euler distance of the original text embedding vector and the machine translation embedding vector and a fourth Euler distance of the post-editing translation embedding vector and the machine translation embedding vector are obtained, and a machine translation accuracy calculation result is obtained based on the second Euler distance and the fourth Euler distance;
[0082] The original text, interpreter post-editing translation and post-editing translation in the to-be-calculated corpus set are input into the machine translation accuracy calculation model to obtain an original text embedding vector, an interpreter post-editing translation embedding vector and a post-editing translation embedding vector;
[0083] A first Euler distance of the original text embedding vector and the interpreter post-editing translation embedding vector and a third Euler distance of the post-editing translation embedding vector and the interpreter post-editing translation embedding vector are obtained, and an interpreter post-editing translation accuracy calculation result is obtained based on the first Euler distance and the third Euler distance.
[0084] Specifically, the present application is aimed at model training of a machine translation accuracy calculation model, as shown in the accompanying drawings, Figure 2 A multi-language pre-training model is used for sentence vector embedding, an error transfer function is constructed based on machine translations with different quality levels, and model fine-tuning training is performed by fully utilizing process data of translation projects.
[0085] Firstly, record the translation data generated in each link of the translation project, including the original text src, machine translation text mt, translator post-editing text pe, and proofreading post-editing text ref. The translator post-editing text pe is the correction of the machine translation text mt, and the proofreading post-editing text ref is the re-examination and correction of the translator post-editing text pe, which can be regarded as the final translation text or the standard reference translation text. It can be understood that, relative to the original text src, the translation quality of mt, pe and ref presents a relationship of successive improvement.
[0086] Secondly, when examining the quality of any translation, the consistency between the translation and the original text and the reference translation needs to be measured. Therefore, the present application divides each piece of data (src, mt, pe, ref) generated in the translation process into two triplets: the first corpus triplet (src, mt, ref) and the second corpus triplet (src, pe, ref), wherein the first corpus triplet is composed of the original text src, the machine translation text mt and the proofreading post-editing text ref, and the second corpus triplet is composed of the original text src, the translator post-editing text pe and the proofreading post-editing text ref.
[0087] It can be seen that the difference between the first corpus triplet (src, mt, ref) and the second corpus triplet (src, pe, ref) is the intermediate data, one of which is the machine translation text mt, and the other of which is the translator post-editing text pe, which are the translations that need to be calculated and evaluated. According to the ranking of translation quality, it is usually expected that the result calculated by the model is that the translation quality of (src, pe, ref) is higher than that of (src, mt, ref).
[0088] Further, when calculating and judging the quality of the corpus triplet (src, mt, ref) or (src, pe, ref), the original text and the translation text of two languages are involved, which need to be converted and mapped to a unified, language-independent semantic space, and the multilingual pre-training model provides the above function, which can map sentences of different languages to the same semantic space to generate embedding vectors corresponding to various translations, and the embedding vectors of sentences with the same semantics are also closer. Typically, the multilingual pre-training model XML-Roberta can be selected for initial sentence vector embedding.
[0089] Here, XML-Roberta was released by the Facebook AI team in November 2019 as an update to its original XLM-100 model. Both are transformer-based language models that rely on the masked language model objective and are both capable of processing text in 100 different languages. The biggest update to XLM-Roberta over the original version is the significant increase in the amount of training data. The cleaned training corpus of commonly scraped data takes up as much as 2.5tb of storage, which is orders of magnitude larger than the Wiki-100 corpus used to train its predecessor, and the expansion is especially pronounced in less-resourced languages. “RoBERTa” in some ways, its training procedure is identical to the monolingual RoBERTa model, specifically the only training objective is the masked language model. XLM-Roberta uses a large shared sentencepiece model to tokenize strings, rather than having a large number of language-specific tokenizers as XLM-100, and perplexity is no longer used as a stopping criterion during training.
[0090] Then, for a piece of raw data (src, mt, pe, ref), after the sentence embedding of the multilingual pre-training model is recorded as X = (src emb , mt emb , pe emb , ref emb ), where src emb is the original text embedding vector, mt emb is the machine translation text embedding vector, pe emb is the translator post-edit translation text embedding vector, and ref emb is the post-editing text embedding vector.
[0091] The training loss function is designed as follows:
[0092] Loss(X) = L(src emb , mt emb , pe emb ) + L(ref emb , mt emb , pe emb )
[0093] Where:
[0094] L(src emb , mt emb , pe emb ) = max{0, d(src emb , pe emb ) - d(src emb , mt emb)+ Δ
[0095] L(ref emb , mt emb , pe emb ) = max{0, d(ref emb , pe emb ) - d(ref emb , mt emb ) + Δ}
[0096] The above d(u, v) represents the Euclidean distance between vectors u and v, L(src emb , mt emb , pe emb ) is the first loss function, L(ref emb , mt emb , pe emb ) is the second loss function, d(src emb , pe emb ) is the first Euclidean distance, d(src emb , mt emb ) is the second Euclidean distance, d(ref emb , pe emb ) is the third Euclidean distance, d(ref emb , mt emb ) is the fourth Euclidean distance; Δ is a bias value, which can be understood as the bias value between src emb and ref emb , mt emb and pe emb .
[0097] Finally, the model needs to be fine-tuned. When fine-tuning the multi-lingual pre-trained model, by minimizing the loss function Loss(X), pe is always better than mt by at least Δ offset relative to src and ref. The above loss function design always considers that the quality of pe should be better than mt by at least Δ units without considering the sentence length, but in fact the length of the sentence to be translated src varies in a large range, from a few characters to hundreds of characters, so using a uniform Δ value for training sentences of different lengths makes it difficult for the model to converge to an accurate state space. Here, in order to make the model training and prediction more fine and targeted, the training corpus is divided into several parts according to the number of characters contained in src, such as less than 10 characters, 10-50 characters, 50-100 characters, more than 100 characters, etc. Different Δ values are set for each part for training, so as to obtain multiple translation quality evaluation models related to the length of src.
[0098] The application adopts a multi-language pre-training model for sentence vector embedding, constructs an error transmission function based on machine translation texts of different quality levels, and fully utilizes process data of translation projects for model fine-tuning training to obtain a machine translation text accuracy calculation model that can simultaneously consider original texts and reference translation texts.
[0099] Based on the above embodiment, the machine translation text accuracy calculation result is obtained by inputting the to-be-calculated corpus set into the pre-trained machine translation text accuracy calculation model.
[0100] The original text, machine translation text and edited translation text in the to-be-calculated corpus set are input into the machine translation text accuracy calculation model to obtain original text embedding vectors, machine translation text embedding vectors and edited translation text embedding vectors.
[0101] The second Euler distance of the original text embedding vectors and the machine translation text embedding vectors and the fourth Euler distance of the edited translation text embedding vectors and the machine translation text embedding vectors are obtained, and the machine translation text accuracy calculation result is obtained based on the second Euler distance and the fourth Euler distance.
[0102] The original text, translator edited translation text and edited translation text in the to-be-calculated corpus set are input into the machine translation text accuracy calculation model to obtain original text embedding vectors, translator edited translation text embedding vectors and edited translation text embedding vectors.
[0103] The first Euler distance of the original text embedding vectors and the translator edited translation text embedding vectors and the third Euler distance of the edited translation text embedding vectors and the translator edited translation text embedding vectors are obtained, and the translator edited translation text accuracy calculation result is obtained based on the first Euler distance and the third Euler distance.
[0104] Specifically, after obtaining the machine translation text accuracy calculation model, given the original text src and the edited translation text ref, the machine translation text mt or the translator edited translation text pe is calculated by the model prediction calculation of the machine translation text accuracy calculation model.
[0105] When predicting the machine translation text mt, the vector embedding of src, ref and mt is obtained to obtain src emb , ref emb , mt emb , and the translation quality of mt is calculated by the following formula:
[0106] E(src, mt, ref) = 2 * d(src emb , mt emb ) * d(ref emb , mt emb ) / [d(srcemb , mt emb )+d(ref emb , mt emb )]
[0107] In order to unify the evaluation value to the interval [0, 1], the following normalization calculation formula is further adopted:
[0108] E std (src, mt, ref) = 1 / [1 + E(src, mt, ref)]
[0109] Similarly, when predicting the post-editing translation pe of the translator, the calculation formula can also be obtained:
[0110] E std (src, pe, ref) = 1 / [1 + E(src, pe, ref)]
[0111] It should be noted that if the translation quality evaluation model is related to the length of the original text src, the corresponding quality evaluation model can be selected based on the current src length, and other calculation methods remain unchanged.
[0112] The present application can calculate the accuracy evaluation result of the machine translation text by using the trained machine translation text accuracy calculation model, and can also calculate the accuracy evaluation result of the post-editing translation of the translator, thereby realizing an efficient calculation method for evaluating the accuracy of the translation from multiple angles.
[0113] The machine translation text accuracy calculation system provided by the present application will be described below. The machine translation text accuracy calculation system described below can be referred to in conjunction with the machine translation text accuracy calculation method described above.
[0114] Figure 3 is a structural schematic diagram of the machine translation text accuracy calculation system provided by the present application, as shown in Figure 3 includes an acquisition module 31 and a calculation module 32, wherein:
[0115] The acquisition module 31 is used to acquire a to-be-calculated corpus set; the calculation module 32 is used to input the to-be-calculated corpus set into a pre-trained machine translation text accuracy calculation model to obtain a machine translation text accuracy calculation result; wherein the machine translation text accuracy calculation model is trained based on a multi-language pre-training model for sentence vector embedding of an original corpus set, an error propagation function is constructed using different translation quality levels, and different model precisions are divided according to a plurality of character lengths.
[0116] The application can obtain more accurate multi-dimensional machine translation accuracy calculation values by simultaneously considering the original text and the reference translation, constructing a machine translation accuracy calculation model, using a multi-language pre-training model for sentence vector embedding, constructing an error transfer function with different quality levels, and fine-tuning the model.
[0117] Figure 4 An example of an entity structure diagram of an electronic device is shown in Figure 4 As shown, the electronic device can include a processor 410, a communications interface 420, a memory 430, and a communications bus 440, wherein the processor 410, the communications interface 420, and the memory 430 communicate with each other through the communications bus 440. The processor 410 can call the logic instructions in the memory 430 to execute a machine translation accuracy calculation method, which includes: obtaining a to-be-calculated corpus set; inputting the to-be-calculated corpus set into a pre-trained machine translation accuracy calculation model to obtain a machine translation accuracy calculation result; wherein the machine translation accuracy calculation model is trained based on a multi-language pre-training model for sentence vector embedding of an original corpus set, an error transfer function constructed with different translation quality levels, and different model precisions divided according to a plurality of character lengths.
[0118] In addition, the logic instructions in the memory 430 described above can be implemented in the form of a software function unit and sold or used as an independent product, which can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the part of the technical solutions that essentially contribute to the prior art can be embodied in the form of a software product, which is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various program code storage media.
[0119] In another aspect, the present application also provides a computer program product comprising a computer program, which can be stored on a non-transitory computer-readable storage medium, and the computer program, when executed by a processor, enables a computer to perform the machine translation accuracy calculation method provided by the above-mentioned methods, which comprises: obtaining a to-be-calculated corpus set; inputting the to-be-calculated corpus set into a pre-trained machine translation accuracy calculation model to obtain a machine translation accuracy calculation result; wherein the machine translation accuracy calculation model is trained based on a multi-language pre-training model for sentence vector embedding on an original corpus set, an error propagation function is constructed using different translation quality levels, and different model precisions are divided according to a plurality of character lengths.
[0120] In another aspect, the present application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and the computer program, when executed by a processor, enables a computer to perform the machine translation accuracy calculation method provided by the above-mentioned methods, which comprises: obtaining a to-be-calculated corpus set; inputting the to-be-calculated corpus set into a pre-trained machine translation accuracy calculation model to obtain a machine translation accuracy calculation result; wherein the machine translation accuracy calculation model is trained based on a multi-language pre-training model for sentence vector embedding on an original corpus set, an error propagation function is constructed using different translation quality levels, and different model precisions are divided according to a plurality of character lengths.
[0121] The device embodiments described above are merely illustrative, wherein the units illustrated as separate components can or can not be physically separated, and the components illustrated as units can or can not be physical units, i.e., they can be located in one place, or distributed on multiple network units. Part or all of the modules can be selected to achieve the purpose of the embodiment scheme according to actual needs. Those skilled in the art can understand and implement it without creative labor.
[0122] From the above description of the embodiments, those skilled in the art can clearly understand that the embodiments can be implemented by means of software plus necessary general hardware platforms, and of course can also be implemented by hardware. Based on such understanding, the above technical solutions, essentially or in other words, the part that contributes to the prior art, can be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in each embodiment or some parts of the embodiments.
[0123] It should be pointed out finally that the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit the same; and although the present application has been described in detail with reference to the foregoing embodiments, it should be appreciated by those skilled in the art that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features thereof can be replaced equivalently; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for calculating the accuracy of machine-translated text, characterized in that, include: Obtain the set of corpora to be calculated; The dataset to be calculated is input into a pre-trained machine-translated text accuracy calculation model to obtain the machine-translated text accuracy calculation result. The machine-translated text accuracy calculation model is trained by embedding sentence vectors into the original dataset using a multilingual pre-trained model, constructing error transfer functions with different translation quality levels, and dividing the model into different accuracy levels according to multiple character lengths. The specific steps are as follows: Obtaining the original corpus set includes: The process involves obtaining the original text, the machine-translated text, the translator-edited text, and the proofread and edited text. Based on the original corpus set, construct the first corpus triplet and the second corpus triplet, including: The first corpus triples are constructed from the original text, the machine-translated text, and the edited translation after review. The second corpus triple is constructed from the original text, the translator's post-edited translation, and the proofreader's post-edited translation; The first corpus triplet and the second corpus triplet are input into the multilingual pre-training model to obtain multiple embedding vectors; The error propagation function is constructed from the plurality of embedding vectors and the preset embedding vector deviation value; The different model accuracies are determined by the length of the multiple characters, and the error transfer function is minimized based on the different model accuracies to obtain multiple computational sub-models with different accuracies; The machine-translated text accuracy calculation model is composed of multiple calculation sub-models with different levels of precision.
2. The method for calculating the accuracy of machine-translated text according to claim 1, characterized in that, The step of constructing the error propagation function from the plurality of embedding vectors and the preset embedding vector deviation value includes: A first loss function is constructed based on the original text embedding vector, the machine-translated text embedding vector, and the translator's post-edited text embedding vector. The first loss function is determined by the maximum value between the difference between the first Eulerian distance and the second Eulerian distance, the sum of the difference with the preset embedding vector deviation value, and 0. A second loss function is constructed based on the edited translation embedding vector after review, the machine-translated translation embedding vector, and the translator-edited translation embedding vector. The second loss function is determined by the maximum value between the difference between the third Eulerian distance and the fourth Eulerian distance, the sum of the difference with the preset embedding vector deviation value, and 0. The error propagation function is obtained by summing the first loss function and the second loss function. Wherein, the first Eulerian distance is determined by the source text embedding vector and the translator's post-edited translation embedding vector, the second Eulerian distance is determined by the source text embedding vector and the machine-generated translation embedding vector, the third Eulerian distance is determined by the proofreading post-edited translation embedding vector and the translator's post-edited translation embedding vector, and the fourth Eulerian distance is determined by the proofreading post-edited translation embedding vector and the machine-generated translation embedding vector; The preset embedding vector deviation value is obtained by using the original text embedding vector and the proofread and edited translation embedding vector to obtain the deviation between the machine-translated text embedding vector and the translator-edited translation embedding vector.
3. The method for calculating the accuracy of machine-translated text according to claim 1, characterized in that, The step involves determining the different model accuracies based on the multiple character lengths, minimizing the error transfer function based on the different model accuracies, and obtaining multiple computational sub-models with different accuracies, including: Multiple character length intervals are determined based on the multiple character lengths, and the different model accuracies are determined by the multiple character length intervals; Based on the different model accuracies, the preset embedding vector deviation values are determined in the error transfer function to make the translator's edited translation embedding vector greater than the machine-translated translation embedding vector. Based on the different preset embedding vector deviation values, the multiple computational sub-models with different precisions are obtained.
4. The method for calculating the accuracy of machine-translated text according to claim 1, characterized in that, The step of inputting the set of text to be calculated into a pre-trained machine translation accuracy calculation model to obtain the machine translation accuracy calculation result includes: The original text, machine-translated text, and edited translation after review are input into the machine-translated text accuracy calculation model from the corpus set to be calculated, and the original text embedding vector, the machine-translated text embedding vector, and the edited translation after review are obtained. Obtain the second Eulerian distance between the original text embedding vector and the machine-translated text embedding vector, and the fourth Eulerian distance between the edited text embedding vector after review and the machine-translated text embedding vector; and obtain the machine-translated text accuracy calculation result based on the second Eulerian distance and the fourth Eulerian distance. The original text, the translator-edited translation, and the proofreader-edited translation in the corpus to be calculated are input into the machine-translated text accuracy calculation model to obtain the original text embedding vector, the translator-edited translation embedding vector, and the proofreader-edited translation embedding vector; Obtain the first Eulerian distance between the original text embedding vector and the translator-edited translation embedding vector, and the third Eulerian distance between the proofreading-edited translation embedding vector and the translator-edited translation embedding vector. Based on the first Eulerian distance and the third Eulerian distance, obtain the translator-edited translation accuracy calculation result.
5. A machine-translated text accuracy calculation system, characterized in that, include: The acquisition module is used to acquire the set of corpora to be calculated; The calculation module is used to input the corpus set to be calculated into a pre-trained machine-translated text accuracy calculation model to obtain the machine-translated text accuracy calculation result. The machine-translated text accuracy calculation model is trained by embedding sentence vectors into the original corpus set using a multilingual pre-trained model, constructing error transfer functions with different translation quality levels, and dividing the model accuracy according to multiple character lengths. The specific steps are as follows: Obtaining the original corpus set includes: The process involves obtaining the original text, the machine-translated text, the translator-edited text, and the proofread and edited text. Based on the original corpus set, construct the first corpus triplet and the second corpus triplet, including: The first corpus triples are constructed from the original text, the machine-translated text, and the edited translation after review. The second corpus triple is constructed from the original text, the translator's post-edited translation, and the proofreader's post-edited translation; The first corpus triplet and the second corpus triplet are input into the multilingual pre-training model to obtain multiple embedding vectors; The error propagation function is constructed from the plurality of embedding vectors and the preset embedding vector deviation value; The different model accuracies are determined by the length of the multiple characters, and the error transfer function is minimized based on the different model accuracies to obtain multiple computational sub-models with different accuracies; The machine-translated text accuracy calculation model is composed of multiple calculation sub-models with different levels of precision.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the machine translation accuracy calculation method as described in any one of claims 1 to 4.
7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the machine translation accuracy calculation method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Machine translation quality estimation method integrating and utilizing multiple pre-training models
CN114091480A
System and method for training multilingual machine translation evaluation models
US20220067307A1