Corpus evaluation model training method, device, storage medium and computer equipment
By automatically comparing machine translation text and reference translation text, we construct corpus evaluation model training data, which solves the problem of low training efficiency in traditional methods and achieves efficient corpus evaluation model training.
Patent Information
- Application Number
- CN201910176030.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-03-08
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2039-03-08
AI Technical Summary
In traditional machine translation model training, the noise problem of parallel corpus results in low training efficiency, which requires a large amount of manual construction and labeling of data, resulting in long model training time.
By obtaining parallel corpus, using the machine translation model to translate the source text, the generated machine translation text is compared with the reference translation text, the training labels are automatically determined, and the corpus evaluation model training data is constructed to reduce the dependence on manual annotation and improve training efficiency.
There is no need to manually add noise, the training data is automatically constructed, the coverage is wider, and it is close to the real scene, avoiding model overfitting, and improving the training efficiency and performance of the corpus evaluation model.
Smart Images

Figure CN110263349B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of machine learning, and in particular to a corpus evaluation model training method, apparatus, storage medium and computer equipment. Background Art
[0002] With the development of machine learning technology, machine translation technology has emerged. In the field of machine translation, there may be a lot of noise in the parallel corpus used to train the machine translation model, which will affect the quality of the machine translation model. Therefore, how to screen out low-noise parallel corpus from a large amount of parallel corpus for training the machine translation model has become an urgent problem to be solved.
[0003] The traditional way of screening parallel corpora is to manually design features for multiple corpus evaluations, use noise-free parallel corpora as positive examples, and apply artificial noise corresponding to the manually designed features to the reference translations of the corpora to construct negative examples, thereby constructing training data for the data screening model and then training the model.
[0004] However, the traditional model training method requires a large amount of manually constructed corpus and manually annotated data for training. It takes a lot of time to obtain training data and use the training data to train the model, resulting in relatively low efficiency in machine learning model training. Summary of the invention
[0005] Based on this, it is necessary to provide a corpus evaluation model training method, apparatus, computer-readable storage medium and computer equipment to address the technical problem of low training efficiency of traditional data screening models.
[0006] A corpus evaluation model training method, comprising:
[0007] Acquire parallel corpus; the parallel corpus includes a source text and a corresponding reference translation text;
[0008] Translating the source text through a machine translation model to obtain a corresponding machine translated text;
[0009] Using the source text and the machine translated text together as training samples for a corpus evaluation model;
[0010] Comparing the machine translated text with the reference translated text to obtain a training label corresponding to the training sample;
[0011] The corpus evaluation model is trained using the training samples and corresponding training labels.
[0012] A corpus evaluation model training device, the device comprising:
[0013] An acquisition module, used for acquiring parallel corpora; the parallel corpora include source texts and corresponding reference translation texts;
[0014] A translation module, used to translate the source text through a machine translation model to obtain a corresponding machine translated text;
[0015] A determination module, configured to use the source text and the machine translated text as training samples for a corpus evaluation model;
[0016] A comparison module, used for comparing the machine translated text with the reference translated text to obtain a training label corresponding to the training sample;
[0017] The training module is used to train the corpus evaluation model through the training samples and corresponding training labels.
[0018] A computer-readable storage medium stores a computer program, which, when executed by a processor, causes the processor to perform the following steps:
[0019] Acquire parallel corpus; the parallel corpus includes a source text and a corresponding reference translation text;
[0020] Translating the source text through a machine translation model to obtain a corresponding machine translated text;
[0021] Using the source text and the machine translated text together as training samples for a corpus evaluation model;
[0022] Comparing the machine translated text with the reference translated text to obtain a training label corresponding to the training sample;
[0023] The corpus evaluation model is trained using the training samples and corresponding training labels.
[0024] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the following steps:
[0025] Acquire parallel corpus; the parallel corpus includes a source text and a corresponding reference translation text;
[0026] Translating the source text through a machine translation model to obtain a corresponding machine translated text;
[0027] Using the source text and the machine translated text together as training samples for a corpus evaluation model;
[0028] Comparing the machine translated text with the reference translated text to obtain a training label corresponding to the training sample;
[0029] The corpus evaluation model is trained using the training samples and corresponding training labels.
[0030] The above-mentioned corpus evaluation model training method, device, computer-readable storage medium and computer equipment obtain parallel corpus including source text and corresponding reference translation text, and translate the source text through a machine translation model to obtain a corresponding machine translation text. The source text and the corresponding machine translation text are used as training samples of the corpus evaluation model. The machine translation text and the corresponding reference translation text are compared to obtain a training label corresponding to the training sample. Since there are various noises in the machine translation text, it is no longer necessary to rely on artificially added noise to construct a counterexample. The training label is determined by comparing the machine translation text with the reference translation text, and a large amount of training data can be constructed without relying on artificially annotated corpus, which greatly improves the preparation efficiency of the training data, thereby greatly improving the training efficiency of the model. In addition, since the machine translation text output by the machine translation model includes various noises, it has a wider coverage than artificial noise and is closer to the real scene, and can well avoid the problem of model overfitting caused by the limitations of the training data, and can efficiently train a high-performance corpus evaluation model. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 A diagram of an application environment of a corpus evaluation model training method in one embodiment;
[0032] Figure 2 A schematic diagram of a flow chart of a corpus evaluation model training method in one embodiment;
[0033] Figure 3 A flowchart of the steps of training a corpus evaluation model using training samples and corresponding training labels in one embodiment;
[0034] Figure 4 A schematic diagram of a model structure of a corpus evaluation model in one embodiment;
[0035] Figure 5 A schematic diagram of a process of processing parallel corpora by a corpus evaluation model in one embodiment;
[0036] Figure 6 A schematic diagram of a flow chart of the steps of selecting a target parallel corpus in one embodiment;
[0037] Figure 7 It is a flowchart of the steps of reordering the alternate translation texts in one embodiment;
[0038] Figure 8 It is a flowchart of a corpus evaluation model training method in a specific embodiment;
[0039] Fig. 9 It is a structural block diagram of a corpus evaluation model training device in one embodiment;
[0040] Fig.10 It is a structural block diagram of a corpus evaluation model training device in another embodiment;
[0041] Fig.11 FIG. 4 is a structural block diagram of a computer device in one embodiment. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0043] Figure 1 FIG. 1 is an application environment diagram of a corpus evaluation model training method in an embodiment. Figure 1 , the corpus evaluation model training method is applied to the model training system. The model training system includes a terminal 110 and a server 120. The terminal 110 and the server 120 are connected via a network. The terminal 110 can specifically be a desktop terminal or a mobile terminal, and the mobile terminal can specifically be at least one of a mobile phone, a tablet computer, a laptop computer, etc. The server 120 can be implemented with an independent server or a server cluster composed of multiple servers. Both the terminal 110 and the server 120 can be used alone to execute the corpus evaluation model training method provided in the embodiment of the present application. The terminal 110 and the server 120 can also be used in collaboration to execute the corpus evaluation model training method provided in the embodiment of the present application.
[0044] It should be noted that two machine learning models are involved in the embodiments of the present application. A machine learning model is a model that has certain capabilities after learning through samples. One machine learning model in the embodiments of the present application is a machine translation model that has translation capabilities through sample learning. Translation refers to the conversion of a language of one language type into a language of another language type. For example, translating Chinese into English, or translating Japanese into Korean, etc. Of course, the language here can also be a local language, such as Minnan dialect or Cantonese, etc. Another machine learning model in the embodiments of the present application is a corpus evaluation model that has corpus evaluation capabilities through sample learning. Corpus evaluation is the process of scoring the degree of match or difference between the source text and the corresponding translated text in a parallel corpus.
[0045] Among them, the machine learning model can adopt a neural network model, such as a CNN (Convolutional Neural Networks, convolutional neural network) model, an RNN (Recurrent Neural Networks, recurrent neural network) model or a transformer model, etc. Of course, the machine learning model can also adopt other types of models, which are not limited in the embodiments of the present application.
[0046] It can be understood that when a corpus evaluation model needs to be trained and only low-noise parallel corpora are available, the scheme provided in the embodiments of the present application can be used to obtain machine-translated texts including various noises using a machine translation model. The source text and the machine-translated text are used as training samples, and the comparison results of the machine-translated text and the reference translation text are used as training labels to train the corpus evaluation model. It is no longer necessary to rely on artificially adding various noises to construct counterexamples, and training data can be constructed conveniently and quickly, thereby greatly improving the training efficiency of the model.
[0047] Among them, the machine translation model used in this application can be a machine translation model obtained by pre-training with acquired parallel corpora. It can also be a machine translation model obtained by pre-training with other parallel corpora. There are various noises in the translation text obtained by the machine translation model. Among them, noise refers to factors that affect the accuracy of the translation text, such as wrong translations, reversed translation order, missing translations, or illogical translations. The noise in the translation text responds to the translation quality of the translation text. The higher the noise, the worse the translation quality of the translation text; the lower the noise, the higher the translation quality of the translation text. The pre-training process of the machine translation model can refer to the detailed description in the subsequent embodiments.
[0048] In the embodiment of the present application, the corpus evaluation model trained by the above training data can be used for various scenarios that require data screening. For example, in the field of machine translation, there may be a large amount of noise in the parallel corpus used to train the model, thereby affecting the quality of the machine translation model. At this time, the parallel corpus can be evaluated by the trained corpus evaluation model to obtain a corresponding corpus evaluation score. Then select the parallel corpus with a higher corpus evaluation score as the training data of the machine translation model, so as to train a machine translation model with high translation accuracy.
[0049] like Figure 2 As shown, in one embodiment, a corpus evaluation model training method is provided. This embodiment mainly uses the method applied to a computer device as an example, and the computer device can specifically be the terminal 110 or the server 120 in the above figure. Figure 2 , the corpus evaluation model training method specifically includes the following steps:
[0050] S202, obtaining parallel corpus; the parallel corpus includes a source text and a corresponding reference translation text.
[0051] Among them, parallel corpora are bilingual (or multilingual) text pairs consisting of source text and its parallel translation text, and the alignment level can be word level, sentence level, paragraph level or article level. The source text and the translation text correspond to different languages. For example, assuming that the source text is Chinese text, the corresponding translation text can specifically include English text, or French text and other non-Chinese languages. For example, parallel corpora are represented as<X,Y> , where X is the source text and Y is the reference translation text that corresponds to the source text.<X,Y> For example, <Thank you>, or <Today>, etc.
[0052] The reference translation text is a standard translation of the source text, which is a low-noise or noise-free translation text. The reference translation text can be a translation text obtained by manually translating the source text, or it can be a translation text obtained by manually correcting the machine translation text. It can be understood that the standard translation text at least meets the conditions of smooth sentences and the meaning expressed is the same or similar to the meaning expressed in the source text. The source text can be a word, sentence, paragraph or chapter, etc. Correspondingly, the reference translation text can also be a word, sentence, paragraph or chapter corresponding to the source text. The source text can be a text in any language, and the reference translation text is a text in a language other than the language to which the source text belongs.
[0053] Specifically, the computer device may crawl corresponding texts in different languages from the Internet as parallel corpora, or may receive corresponding texts in different languages sent by other computer devices as parallel corpora, etc. Among the corresponding texts in different languages, which text in different languages is used as the source text and which text in different languages is used as the reference translation text depends on the language translation direction of the machine translation model.
[0054] It is understandable that the number of bilingual sentence pairs of the source text and the reference translation text included in the parallel corpus acquired by the computer in step S202 is more than one. Thus, more than one set of training data can be constructed. Generally, the more sets of training data there are, the wider the scope of text content covered, and the more beneficial it is to the training of the model.
[0055] S204: Translate the source text using a machine translation model to obtain a corresponding machine translated text.
[0056] Among them, the machine translation text is the translation obtained by translating the text through the machine translation model in actual use. Since the machine translation text is the text obtained by translating the machine translation model, the quality of the translation depends on the model performance of the machine learning model, so the machine translation text may include various noises, such as incorrect word order of the translation text, missing translation words, invalid translation words, or grammatical confusion. It can be understood that the source text can be a text in any language, the machine translation text is a text in a language other than the language of the source text, and the machine translation text and the reference translation text are texts in the same language.
[0057] For example, when the source text is "Can I buy a TV when I move in?", the reference translation text is "Can I get a TV when I move in?", and the machine translation text obtained by the machine translation model is "I move in to buy a TV?". Obviously, the machine translation text obtained by translating the source text through the machine translation model is not very accurate and has semantic and grammatical omissions.
[0058] The machine translation model is a pre-trained machine learning model. During pre-training, the machine translation model learns to translate the text of the language type to which the source text belongs in S202 into the text of the language type to which the reference translation text belongs. Therefore, after pre-training, the machine translation model can perform various processing on the source text in the acquired parallel corpus and output a machine translation text corresponding to the source text.
[0059] Specifically, the computer device may obtain a machine translation text obtained by translating the source text through the machine translation model. The computer device may directly translate the source text through the machine translation model to obtain the machine translation text. The computer device may also obtain a machine translation text obtained by translating the source text in advance through the machine translation model from other computer devices or networks.
[0060] In one embodiment, after obtaining the source text, the computer device may perform word segmentation on the source text to obtain a word sequence composed of each word. The computer device may convert the discrete word sequence into a corresponding initial vector sequence by word embedding processing. The initial vector sequence is then input into a pre-trained machine translation model, and then the initial vector sequence is processed by the hidden layer included in the machine translation model to obtain the hidden layer vector corresponding to the initial vector sequence, and then the hidden layer vector is converted into a machine translation text output through the output layer.
[0061] Among them, hidden layer is a term in the neural network model, which is the middle layer relative to the input layer and the output layer. The hidden layer includes the model parameters obtained by training the neural network model. Here, the hidden layer of the machine translation model is the middle layer relative to the input layer of the machine translation model and the output layer of the machine translation model. All the middle layers between the input layer and the output layer of the machine translation model can be collectively referred to as hidden layers, and these middle layers can also be divided, that is, multiple layers of hidden layers. The hidden layer of the machine translation model may include a multi-layer neural network structure. Each layer of the neural network structure may include one or more neural network layers.
[0062] Here, the hidden layer of the machine translation model can be described as a "black box". The hidden layer vector is the result of the hidden layer of the machine translation model processing the input data. The number of hidden layer vectors can be one or more. When there are multiple hidden layer vectors, it is a hidden layer vector sequence.
[0063] Among them, the pre-trained machine translation model adopts a Sequence-to-Sequence framework based on a neural network. The Sequence-to-Sequence framework is a framework that includes an Encoder-Decoder structure. The Encoder-Decoder structure converts an input sequence into another sequence output. In this framework, the encoder converts the input sequence into a vector, and the decoder accepts the vector and generates an output sequence in chronological order. The encoder and decoder can use the same type of neural network model or different types of neural network models. Neural network models such as CNN (Convolutional Neural Networks) model, RNN (Recurrent Neural Networks) model, Long Short-Term Memory model (Long Short-Term Memory, LSTM), time delay network model or gated convolutional neural network model.
[0064] In one embodiment, after obtaining the parallel corpus, the computer device can train the machine translation model through the parallel corpus. That is, the initial vector sequence corresponding to the source text is input into the machine translation model, and the translation result is output after the data of the hidden layer input included in the machine translation model is processed. The computer device can adjust the model parameters in the direction of reducing the difference according to the difference between the translation result and the reference translation text, and continue training until the training stops when the training stop condition is reached.
[0065] In one embodiment, the computer device can directly obtain a machine translation model trained with other parallel corpora, and then translate the source text with the machine translation model to obtain a machine translated text. It should be noted that the machine translation model used for translation here can also be a model with translation function obtained based on other training methods or other model structures, which is not limited here.
[0066] S206, using the source text and the machine translated text together as training samples for the corpus evaluation model.
[0067] Specifically, the computer device can use the source text and the corresponding machine translation text as training samples for the corpus evaluation model. Since the machine translation text contains various noises, it has a wider coverage and is closer to the real scene than the artificially added noise. It is very suitable to be used as training data for the corpus evaluation model.
[0068] In one embodiment, after obtaining the source text and the machine translated text, the computer device may perform word segmentation processing on the source text to obtain a word sequence composed of each word, and perform word segmentation processing on the machine translated text to obtain a word sequence composed of each word. Furthermore, the computer device may convert the discrete word sequence corresponding to the source text into a corresponding initial vector sequence, and convert the discrete word sequence corresponding to the machine translated text into a corresponding initial vector sequence through word embedding processing. The initial vector sequence corresponding to the source text and the initial vector sequence corresponding to the machine translated text are then respectively input into the corpus evaluation model and processed by the hidden layer included in the corpus evaluation model.
[0069] S208, comparing the machine translated text with the reference translated text to obtain a training label corresponding to the training sample.
[0070] Specifically, the computer device may compare the machine translated text with the reference translated text to obtain a comparison result, and determine a training label corresponding to the training sample according to the comparison result.
[0071] In one embodiment, the computer device may use a preset text matching method to calculate the matching degree between the machine translated text and the reference translated text, and use the matching degree or the linear transformation result of the matching degree as the training label corresponding to the training sample. The computer device may also use a preset text difference calculation method to calculate the difference between the machine translated text and the reference translated text, and use the difference or the linear transformation result of the difference as the training label corresponding to the training sample.
[0072] It can be understood that when the degree of match between the machine translation text and the reference translation text is higher, the translation quality of the machine translation text is considered to be better; when the degree of match between the machine translation text and the reference translation text is lower, the translation quality of the machine translation text is considered to be worse. Alternatively, when the difference between the machine translation text and the reference translation text is smaller, the translation quality of the machine translation text is considered to be better; when the difference between the machine translation text and the reference translation text is greater, the translation quality of the machine translation text is considered to be worse. The corpus evaluation model is a model used to evaluate the quality of parallel expected corpus, and can also be understood as a model for evaluating the translation quality of the translation text. Then the computer device can determine the corresponding training label of the training sample by the degree of match or difference between the machine translation text and the reference translation text.
[0073] In one embodiment, step S208, that is, comparing the machine translated text with the reference translated text to obtain a training label corresponding to the training sample, specifically includes the following steps: calculating the matching degree between the machine translated text and the reference translated text according to a preset text matching method; and using the matching degree as the training label corresponding to the training sample.
[0074] The text matching method is a strategy for calculating the matching degree between the machine translation text and the reference translation text. There are many text matching methods, and the computer device can select any one of them as the preset text matching method in advance.
[0075] In layman's terms, after the machine translation model translates the source text to obtain the machine translated text, an evaluation index is needed to evaluate the effect of this translation. Then the calculation method of the evaluation index here can be used as the text matching method. Evaluation indicators include BLEU (Bilingual Evaluation understudy), NIST (National Institute of standards and Technology), word error rate (WER), or TER (Translation error rate).
[0076] Specifically, after obtaining the machine translation text obtained by machine translation of the source text through the machine translation model, the computer device can compare it with the reference translation text, calculate the matching degree between the machine translation text and the reference translation text according to the preset text matching method, and then use the matching degree as the training label corresponding to the training sample. The matching degree can be recorded as M(Y',Y), Y' is the machine translation text, and Y is the reference translation text.
[0077] In the above embodiment, the matching degree between the machine translated text and the reference translated text can be calculated according to the preset text matching method, and the matching degree is used as the training label corresponding to the training sample, thereby avoiding the need to manually construct and annotate the corpus, and greatly improving the efficiency of model training.
[0078] S210, training the corpus evaluation model through training samples and corresponding training labels.
[0079] Specifically, the training of the corpus evaluation model is a supervised training process. The computer device inputs the training sample into the corpus evaluation model, takes the training label corresponding to the training sample as the target output, and adjusts the model parameters of the corpus evaluation model so that the actual output of the model continuously approaches the target output.
[0080] In one embodiment, the computer device may input the training sample into the corpus evaluation model for training to obtain the corpus evaluation result. A loss function is constructed according to the difference between the corpus evaluation result and the training label. The model parameters when the loss function is minimized are used as the model parameters of the corpus evaluation model, and the step of inputting the training sample into the corpus evaluation model for training to obtain the corpus evaluation result is returned until the training stop condition is met and the training is stopped.
[0081] The training stop condition is the condition for ending the model training. The training stop condition may be reaching a preset number of iterations, or the performance index of the corpus evaluation model after adjusting the model parameters reaches a preset index.
[0082] In one embodiment, the computer device may measure the performance of the corpus evaluation model based on the correlation between the predicted result and the actual result of the corpus evaluation model. The correlation between the predicted result and the actual result may be specifically reflected by the Pearson correlation coefficient between the predicted result and the actual result.
[0083] In one embodiment, since the machine translation text output by the machine translation model includes various noises, it has a wider coverage than artificial noise and is closer to the real scene. Therefore, when the corpus evaluation model is trained by the training samples and training labels in the embodiment of the present application, when the amount of data is sufficient, overfitting generally does not occur.
[0084] The above-mentioned corpus evaluation model training method, device, computer-readable storage medium and computer equipment obtain parallel corpus including source text and corresponding reference translation text, and translate the source text through a machine translation model to obtain a corresponding machine translation text. The source text and the corresponding machine translation text are used as training samples of the corpus evaluation model. The machine translation text and the corresponding reference translation text are compared to obtain a training label corresponding to the training sample. Since there are various noises in the machine translation text, it is no longer necessary to rely on artificially added noise to construct a counterexample. The training label is determined by comparing the machine translation text with the reference translation text, and a large amount of training data can be constructed without relying on artificially annotated corpus, which greatly improves the preparation efficiency of the training data, thereby greatly improving the training efficiency of the model. In addition, since the machine translation text output by the machine translation model includes various noises, it has a wider coverage than artificial noise and is closer to the real scene, and can well avoid the problem of model overfitting caused by the limitations of the training data, and can efficiently train a high-performance corpus evaluation model.
[0085] In one embodiment, step S210, that is, the step of training the corpus evaluation model using training samples and corresponding training labels, specifically includes the following steps:
[0086] S302, processing the word sequence of the source text and the word sequence of the machine translated text respectively through two parallel recurrent neural network structures in the corpus evaluation model.
[0087] Among them, the recurrent neural network structure is a type of recursive neural network structure that takes sequence data as input, performs recursion in the direction of sequence evolution, and all nodes (recurrent units) are connected in a chain.
[0088] Specifically, after obtaining the source text and the machine translation text, the computer device can segment the source text to obtain a word sequence composed of each word, and segment the machine translation text to obtain a word sequence composed of each word. Furthermore, the word sequence of the source text and the word sequence of the machine translation text can be processed separately through two parallel recurrent neural network structures in the corpus evaluation model.
[0089] In one embodiment, the computer device can convert the discrete word sequence corresponding to the source text into the corresponding initial vector sequence, and convert the discrete word sequence corresponding to the machine translation text into the corresponding initial vector sequence through word embedding processing. Then, the initial vector sequence corresponding to the source text is input into one of the recurrent neural network structures in the corpus evaluation model; and the initial vector sequence corresponding to the machine translation text is input into another recurrent neural network structure in the corpus evaluation model.
[0090] In one embodiment, the recurrent neural network structure in the corpus evaluation model is used to extract the implicit semantic information in the input data and encode the input data into a vector form for output. In one embodiment, the recurrent neural network structure in the corpus evaluation model is specifically implemented by a framework of an Encoder-Decoder (encoder-decoder) structure based on LSTM. Or the recurrent neural network structure in the corpus evaluation model is implemented only by the encoder in the Encoder-Decoder structure.
[0091] S304, through the feedforward neural network structure of the corpus evaluation model, the vectors output by the two parallel recurrent neural network structures are concatenated and then processed to obtain a corpus evaluation result.
[0092] The feedforward neural network structure is a unidirectional multi-layer neural network structure, in which each layer contains a number of neurons. Neurons in the same layer are not connected to each other, and information between layers is transmitted in only one direction. The corpus evaluation result is the result obtained after corpus evaluation processing of the source text and the machine translation text. The corpus evaluation result can represent the quality of the machine translation text.
[0093] Specifically, the computer device can concatenate the vectors output by the two parallel recurrent neural network structures through the feedforward neural network structure of the corpus evaluation model to obtain a concatenated vector, and perform at least one of a linear transformation and a nonlinear transformation on the concatenated vector to obtain a corpus evaluation result.
[0094] In one embodiment, the computer device can perform linear transformation and sigmoid (S-shaped growth curve) function processing on the splicing vector through the feedforward neural network structure of the corpus evaluation model, output a value between 0 and 1, and use the output value as the corpus evaluation result.
[0095] refer to Figure 4 , Figure 4 FIG. 1 is a schematic diagram of the model structure of a corpus evaluation model in an embodiment. Figure 4 As shown, the word sequence of the source text and the word sequence of the machine translation text are input into the corresponding two recurrent neural network channels (that is, Figure 4 The RNN-channel 1 and RNN-channel 2 in are respectively processed by two parallel recurrent neural networks through the recurrent neural network structure in . The vectors output by the two parallel recurrent neural network results are input into the feedforward neural network structure. The feedforward neural network structure concatenates the input vectors to obtain a concatenated vector, processes the concatenated vector, and outputs the corpus evaluation result.
[0096] S306, adjusting the model parameters of the corpus evaluation model according to the difference between the corpus evaluation result and the training label and continuing the training until the training stop condition is met.
[0097] The training stop condition is a condition for ending model training. The training stop condition may be reaching a preset number of iterations, or the performance index of the corpus evaluation model after adjusting the model parameters reaches a preset index. Adjusting the model parameters of the corpus evaluation model is to adjust the model parameters of the corpus evaluation model.
[0098] Specifically, the computer device can compare the difference between the corpus evaluation result and the classification label, thereby adjusting the model parameters of the corpus evaluation model in the direction of reducing the difference. If the training stop condition is not met after adjusting the model parameters, the training is returned to step S302 to continue until the training stop condition is met and the training is terminated.
[0099] In one embodiment, the computer device may construct a loss function based on the corpus evaluation result and the square error of the training label. During each training, the model parameters of the corpus evaluation model are updated by minimizing the loss function or by the model parameters when the loss function is less than a preset threshold, until the training is stopped when the training stop condition is met.
[0100] In the above embodiment, the word sequence of the source text and the word sequence of the machine translated text are processed respectively by two parallel recurrent neural network structures in the corpus evaluation model. Then, the vectors output by the two parallel recurrent neural network structures are spliced and processed to obtain the corpus evaluation result. Thus, the corpus evaluation model can be trained in the direction of reducing the difference according to the difference between the corpus evaluation result and the training label. In this way, the semantic evaluation model can learn deep semantic information and perform corpus evaluation from the semantic level. In the process of model training, by continuously adjusting the model parameters, a corpus evaluation model that can accurately evaluate the translation quality of the translated text can be trained as soon as possible, thereby improving the training efficiency.
[0101] In one embodiment, step S302, that is, the step of processing the word sequence of the source text and the word sequence of the machine translation text respectively through two parallel recurrent neural network structures in the corpus evaluation model, specifically includes: semantically encoding the word sequence of the source text through the encoder of the first recurrent neural network structure in the corpus evaluation model to obtain a first semantic vector sequence, and continuing to decode the first semantic vector sequence in sequence through the decoder of the first recurrent neural network structure to obtain a first hidden layer vector sequence; performing weighted sum calculation on each vector in the first hidden layer vector sequence through the first recurrent neural network structure, and outputting the vector obtained by the weighted sum calculation; semantically encoding the word sequence of the machine translation text through the encoder of the second recurrent neural network structure in the corpus evaluation model to obtain a second semantic vector sequence, and continuing to decode the second semantic vector sequence in sequence through the decoder of the second recurrent neural network structure to obtain a second hidden layer vector sequence; performing weighted sum calculation on each vector in the second hidden layer vector sequence through the second recurrent neural network structure, and outputting the vector obtained by the weighted sum calculation; wherein the first recurrent neural network structure is parallel to the second recurrent neural network structure.
[0102] Specifically, for the two parallel recurrent neural network structures in the corpus evaluation model, the two recurrent neural network structures process the input data in the same way. Both use the encoder of the recurrent neural network structure to semantically encode the input word sequence to obtain a semantic vector sequence. Then the decoder in the recurrent neural network structure decodes the semantic vector sequence into a hidden layer vector sequence. The difference is that one recurrent neural network structure processes the word sequence corresponding to the source text, and the other recurrent neural network structure processes the word sequence corresponding to the machine translation text.
[0103] In one embodiment, the encoder of the first recurrent neural network structure in the corpus evaluation model can semantically encode each word in the word sequence in turn according to the word order of the word sequence of the source text to obtain a semantic vector corresponding to each word, thereby obtaining a first semantic vector sequence corresponding to the word sequence of the source text.
[0104] Among them, when the hidden layer of the encoder performs semantic encoding on the current word, the semantic vector corresponding to the previous word can be used directly or after processing as the input of the semantic encoding of the current word to obtain the semantic vector of the current word. In other words, the semantic vector of the current word incorporates the semantic vector of the previous word. In this way, the semantic vector of each word in the word sequence of the source text not only contains the semantic information of the corresponding word, but also integrates the semantic information of the previous word, so that the semantic expression of the first semantic vector sequence finally generated is more accurate. The previous word here refers to the word before the current word, and the word before the current word can be all words or part of the words.
[0105] The following is an example of the process of obtaining the first semantic vector sequence by semantically encoding the word sequence of the source text word by word through the encoder of the first recurrent neural network structure in the corpus evaluation model: Taking the source text X as an example, the computer device performs word segmentation on the source text to obtain the word sequence of the source text as X = (x1, x2, ..., x m ), the word sequence X=(x1,x2,...,x m ) is input into the encoder of the first recurrent neural network structure, the hidden layer of the encoder performs semantic encoding on x1 to obtain the corresponding semantic vector v1, and then performs semantic encoding on x2 according to the semantic vector v1 to obtain the corresponding semantic vector v2, and so on, until x is obtained. m The corresponding semantic vector v m Finally, we get the first semantic vector sequence V = (v1, v2, ..., v m ).
[0106] Furthermore, the encoder of the first recurrent neural network structure in the corpus evaluation model transmits the obtained first semantic vector sequence to the decoder, and the hidden layer of the decoder decodes the first semantic vector sequence to obtain the first hidden layer vector sequence. Here, the first semantic vector sequence and the first hidden layer vector sequence can both reflect the semantic information and grammatical information of the word sequence of the source text.
[0107] In one embodiment, the decoder of the first recurrent neural network generates the first hidden layer vector one by one in sequence. When the decoder generates the first hidden layer vector of the current time, the first hidden layer vector outputted last time can be obtained. Based on the first hidden layer vector outputted last time, the first semantic vector sequence outputted by the encoder is decoded to obtain the first hidden layer vector of the current time. In this way, the first hidden layer vector not only contains the semantic information of each word in the word sequence of the source text, but also integrates the semantic information of the first hidden layer vector outputted last time. The decoder splices each first hidden layer vector according to the generation time sequence of each first hidden layer vector to obtain a first hidden layer vector sequence.
[0108] In one embodiment, when the decoder decodes the first first hidden layer vector, it may use a random vector or a preset vector as the first hidden layer vector before the first first hidden layer vector, and decode based on the random vector or the preset vector and the first semantic vector sequence transmitted by the encoder to obtain the first first hidden layer vector. Then, it decodes based on the first first hidden layer vector and the semantic vector sequence to obtain the second first hidden layer vector. And so on, until the last first hidden layer vector is obtained.
[0109] The following is an example of a process of decoding the first semantic vector sequence by the decoder of the first recurrent neural network in the corpus evaluation model to obtain the first hidden layer vector sequence: the hidden layer of the decoder is based on a random vector or a preset vector, and the first semantic vector sequence V = (v1, v2, ..., v m ) is decoded to obtain the first hidden vector h1; then based on the first hidden vector h1 and the first semantic vector sequence V=(v1,v2,...,v m ) is decoded to obtain the second first hidden layer vector h2; and so on, until h n Finally, we get the first hidden layer vector sequence H = (h1,h2,...,h n ).
[0110] Furthermore, through the first recurrent neural network structure, each vector in the first hidden layer vector sequence is weighted and summed, and the vector obtained by the weighted summation is output. The weight corresponding to each first hidden layer vector in the weighted summation can be a preset weight or a weight obtained by calculating the corpus evaluation model. In one embodiment, the computer device can average each first hidden layer vector to obtain a vector representing the source text, which integrates the semantic information and grammatical information of each word in the source text.
[0111] It can be understood that the specific operation content of semantically encoding the word sequence of the machine translation text through the encoder of the second recurrent neural network structure in the corpus evaluation model to obtain the second semantic vector sequence, and continuing to decode the second semantic vector sequence in turn through the decoder of the second recurrent neural network structure to obtain the second hidden layer vector sequence is the same as the encoding and decoding operation performed by the first recurrent neural network structure described above. The difference is that the first recurrent neural network structure processes the word sequence corresponding to the source text, while the second recurrent neural network structure processes the word sequence corresponding to the machine translation text. For details about the encoding and decoding operation of the second recurrent neural network structure on the word sequence corresponding to the machine translation text, please refer to the description of the encoding and decoding operation of the first recurrent neural network structure on the word sequence corresponding to the source text.
[0112] In one embodiment, when the second recurrent neural network structure processes the word sequence corresponding to the machine translation text, the initial data can be provided by the first recurrent neural network structure. For example, when the second recurrent neural network structure is decoding, the second hidden layer vector used in the previous decoding can be determined based on the last first hidden layer vector output by the first recurrent neural network structure. Alternatively, when the second recurrent neural network structure is decoding, the content vector to be calculated for the next decoding can be determined based on the last content vector in the first recurrent neural network structure.
[0113] Furthermore, through the second recurrent neural network structure, each vector in the second hidden layer vector sequence is weighted and summed, and the vector obtained by the weighted summation is output. The weight corresponding to each second hidden layer vector in the weighted summation can be a preset weight or a weight obtained by calculating the corpus evaluation model. In one embodiment, the computer device can average each second hidden layer vector to obtain a vector representing the machine translation text, which integrates the semantic information and grammatical information of each word in the machine translation text.
[0114] In the above embodiment, the encoder and decoder of the two parallel recurrent neural network structures in the corpus evaluation model are used to perform corresponding encoding and decoding processing on the word sequence of the source text and the word sequence of the machine translated text, respectively, to obtain the first hidden layer vector sequence and the second hidden layer vector sequence. Then, the weighted sum calculation is performed on each vector in the first hidden layer vector sequence and each vector in the second hidden layer vector sequence through the two parallel recurrent neural network structures, and the vectors obtained by the weighted sum calculation are output respectively. In this way, the source text and the machine translated text can be encoded and decoded respectively through the two parallel recurrent neural network structures, and the features corresponding to the source text and the machine translated text can be extracted from the deep semantic information level.
[0115] In one embodiment, the first semantic vector sequence is decoded in sequence by a decoder of a first recurrent neural network structure, and the steps of obtaining a first hidden layer vector sequence specifically include: obtaining an attention allocation weight vector corresponding to the first semantic vector sequence at that time by a decoder of the first recurrent neural network structure; calculating the content vector at that time based on the attention allocation weight vector and the first semantic vector sequence; calculating the first hidden layer vector at that time based on the first hidden layer vector outputted by the decoder of the first recurrent neural network structure last time and the content vector at that time; and combining the first hidden layer vectors outputted in sequence by the decoder of the first recurrent neural network structure to obtain a first hidden layer vector sequence corresponding to the source text.
[0116] In one embodiment, the decoder of the first recurrent neural network may perform an attention mechanism on the first semantic vector to obtain a content vector corresponding to the first semantic vector. The content vector incorporates the semantic information and grammatical information of the source text.
[0117] In one embodiment, a computer device may obtain an attention allocation weight vector corresponding to a first semantic vector sequence during the current decoding process. The attention allocation weights in the attention allocation weight vector correspond to the first semantic vectors in the first semantic vector sequence. The first semantic vectors are fused according to the attention allocation weights corresponding to the first semantic vectors to obtain a content vector. The fusion method may specifically adopt a weighted summation calculation method. Furthermore, the decoder may decode based on the content vector and the first hidden layer vector outputted last time to obtain the first hidden layer vector of the current time. The computer device combines the first hidden layer vectors sequentially outputted by the decoder of the first recurrent neural network structure to obtain a first hidden layer vector sequence corresponding to the source text. The attention allocation weights corresponding to the first semantic vectors indicate that the information obtained by the encoder is selectively selected to assist decoding.
[0118] In one embodiment, the attention allocation weight corresponding to each first semantic vector is calculated by comparing the first hidden layer vector output by the decoder at the previous moment with each first semantic vector, that is, by using the function F(h i-1 , V m ) to obtain the possibility of the first hidden layer vector corresponding to each first semantic vector. Then F(h i-1 , V m The output of the ) function is normalized by Softmax to obtain the attention allocation weight that conforms to the probability distribution value range. The combination of each attention allocation weight is the attention allocation weight vector. Among them, i refers to the i-th decoding.
[0119] The following is an example of how to decode the first semantic vector sequence through the decoder of the first recurrent neural network in the corpus evaluation model to obtain the first hidden layer vector sequence: In the decoding process at that time, the calculation method of the content vector at that time is as follows: Among them, α i,m represents the attention allocation weight corresponding to the mth first semantic vector; v m represents the mth first semantic vector; · represents the vector dot multiplication operation. For the first hidden layer vector of the time, h i Indicates that the first hidden layer vector of the previous time is represented by h i-1 Represented by. Then the first hidden layer vector h can be calculated by the following formula i :h i =f(h i-1 ,c i ); where f() represents the activation function. Correspondingly, the first hidden layer vector for each time can be calculated by the above formula. Then, the decoder can concatenate and combine the first hidden layer vectors to obtain a hidden layer vector sequence.
[0120] In one embodiment, the computer device can also calculate the first hidden layer vector of the current time according to the first hidden layer vector outputted by the decoder of the first recurrent neural network structure last time, the target word outputted last time, and the content vector of the current time. Then, the target word of the current time is determined according to the first hidden layer vector of the current time. In turn, the target word of the current time is used to calculate the first hidden layer vector of the next time.
[0121] In the above embodiment, by means of attention mechanism fusion, relevant information is selected from the information of the encoder as an aid during decoding, and the hidden layer representations in the recurrent neural network structure are more fully learned, thereby reducing the loss of effective information during the corpus evaluation process and greatly improving the accuracy of corpus evaluation.
[0122] It can be understood that the specific operation content of decoding the second semantic vector sequence in sequence through the decoder of the second recurrent neural network structure to obtain the second hidden layer vector sequence is the same as the above-described operation of decoding the first semantic vector sequence in sequence through the decoder of the first recurrent neural network structure to obtain the first hidden layer vector sequence. The difference is that the decoder of the first recurrent neural network structure decodes the first semantic vector sequence, while the decoder of the second recurrent neural network structure decodes the second semantic vector sequence. For details on the operation of the decoder of the second recurrent neural network structure decoding the second semantic vector, please refer to the relevant description of the operation of the decoder of the first recurrent neural network structure decoding the first semantic vector.
[0123] refer to Figure 5 , Figure 5 FIG. 2 shows a schematic diagram of a process for processing parallel corpora by a corpus evaluation model in one embodiment. Figure 5As shown, the computer device can input the word sequence of the source text, such as X=(x1, x2, x3, x4), and the word sequence of the machine translation text, such as Y'=(y'1, y'2, y'3, y'4), respectively into the two recurrent neural network channels of the corpus evaluation model. It can be understood that X=(x1, x2, x3, x4) and Y'=(y'1, y'2, y'3, y'4) are only for illustration, and the number of word sequences of the source text and the machine translation text is not limited in this application. The encoders of two parallel recurrent neural network channels process the word sequence of the source text and the word sequence of the machine translation text respectively to obtain the corresponding content vector sequences C=(c1, c2, c3, c4) and C'=(c'1, c'2, c'3, c'4). Then, the decoders of two parallel recurrent neural network channels are used for decoding to obtain the corresponding first hidden layer vector sequence H = (h1, h2, h3, h4) and second hidden layer vector sequence H' = (h'1, h'2, h'3, h'4). The first recurrent neural network structure averages the first hidden layer vectors in the first hidden layer vector sequence H = (h1, h2, h3, h4) and outputs the vector h representing the source text. 源 The second recurrent neural network structure averages each second hidden layer vector in the second hidden layer vector sequence H'=(h'1, h'2, h'3, h'4) and outputs a vector h representing the machine translation text. 译 . Then vector h 源 and vector h 译 The input is processed in the feedforward neural network structure and the corpus evaluation results are output.
[0124] In one embodiment, the corpus evaluation model training method also includes a step of determining a combined dimension vector, which specifically includes: obtaining the results of translation quality evaluation of machine translation texts under different dimensions; determining the corresponding combined dimension vector according to the results corresponding to the different dimensions. The step of obtaining the corpus evaluation result by splicing the vectors output by the two parallel recurrent neural network structures and continuing to process them through the feedforward neural network structure of the corpus evaluation model includes: splicing the vectors output by the two parallel recurrent neural network structures and the combined dimension vector and continuing to process them through the feedforward neural network structure of the corpus evaluation model to obtain the corpus evaluation result.
[0125] Among them, different dimensions specifically refer to different evaluation index dimensions, such as text length dimension, text distance dimension, word alignment dimension, etc. The translation quality evaluation of machine translated texts under different dimensions can specifically be to calculate the matching degree or difference degree between the source text and the machine translated text by means of bidirectional cross entropy, language model scoring, cosine distance, word alignment, etc. The matching degree or difference degree between the source text and the machine translated text calculated by different methods can be regarded as the result of the translation quality evaluation of the machine translated text under different dimensions.
[0126] Specifically, the computer device can obtain the results of the translation quality evaluation of the machine translation text in different dimensions, and convert the results of the translation quality evaluation of the machine translation text in different dimensions into corresponding quantitative values in the same dimension, such as converting the results obtained in different dimensions into numerical values representing the matching between the source text and the machine translation text. Furthermore, the computer device can splice the results corresponding to different dimensions into a combined dimension vector.
[0127] Furthermore, the computer device can concatenate the vectors outputted by the two parallel recurrent neural network structures and the combined dimension vector through the feedforward neural network structure of the corpus evaluation model to obtain a concatenated vector, and perform at least one of a linear transformation and a nonlinear transformation on the concatenated vector to obtain a corpus evaluation result.
[0128] In one embodiment, there is no limitation on the concatenation order of the vectors output by the two parallel recurrent neural network structures and the combined dimension vectors. It is only necessary to ensure that the concatenation order is the same during each training process of the model.
[0129] In the above embodiment, by concatenating the combined feature vector and the vector of the sentence pair output by the recurrent neural network result, that is, concatenating the artificially designed features into the vector representation of the sentence pair, the corpus model can learn a variety of feature combinations that can minimize the loss. There is no need to set the weights corresponding to features of different dimensions in advance, nor is there a need to use grid search to find suitable weights, which greatly improves the training efficiency and effect of the model.
[0130] In one embodiment, the corpus evaluation model training method further includes a step of screening the target parallel corpus, which specifically includes the following steps:
[0131] S602, obtaining candidate parallel corpora to be processed; the candidate parallel corpora include candidate source texts and corresponding candidate translation texts.
[0132] Specifically, the computer device may crawl corresponding texts in different languages from the Internet as candidate parallel corpora. It is understandable that the candidate translation texts in the candidate parallel corpora may include various noises, and the translation quality of the candidate translation texts varies.
[0133] In one embodiment, the computer device may pre-acquire monolingual corpus, such as a candidate source text, and then translate the candidate source text through a pre-trained machine translation model to obtain a candidate translation text. Alternatively, in another scenario, the computer device may pre-acquire monolingual corpus, such as a candidate translation text, and then reverse translate the candidate translation text through a pre-trained machine translation model to obtain a candidate source text. Since there may be various noises in the text translated by the machine translation model, the candidate parallel corpus constructed at this time may also be called a pseudo-parallel corpus.
[0134] In one embodiment, the candidate source text is a text corresponding to the first language; the candidate translation text is a text corresponding to the second language. The step of obtaining the candidate parallel corpus to be processed specifically includes: obtaining a first parallel corpus and a second parallel corpus; the first parallel corpus includes a candidate source text corresponding to the first language and a corresponding candidate intermediate text corresponding to the third language; the second parallel corpus includes a candidate intermediate text corresponding to the third language and a corresponding candidate translation text corresponding to the second language; constructing a candidate parallel corpus based on the first parallel corpus and the second parallel corpus; the candidate parallel corpus includes a candidate source text corresponding to the first language and a corresponding candidate translation text corresponding to the second language.
[0135] It can be understood that in the actual field of machine translation, the low-noise parallel corpora that can be used to train the machine translation model are often less in number, and sometimes even absent. In one embodiment, the computer device can obtain the first parallel corpus and the second parallel corpus from the network. Wherein, the first parallel corpus includes the candidate source text corresponding to the first language and the corresponding candidate intermediate text corresponding to the third language. The second parallel corpus includes the candidate intermediate text corresponding to the third language and the corresponding candidate translation text corresponding to the second language. And the translation direction at this time is the direction of translating the source text corresponding to the first language to the translation text corresponding to the second language. The computer device can construct the candidate parallel corpus by reverse translation according to the candidate intermediate text corresponding to the third language included in the first parallel corpus and the second parallel corpus. Wherein, the candidate parallel corpus includes the candidate source text corresponding to the first language and the corresponding candidate translation text corresponding to the second language.
[0136] For example, when it is necessary to train a machine translation model between language A and language C, but the computer device can only obtain the first parallel corpus corresponding to language A and language B, and the second parallel corpus corresponding to language B and language C. For example, the computer device obtains the first parallel corpus [A1, B1] and the second parallel corpus [B2, C2]. At this time, the translation model that translates language B into language A can be obtained through [A1, B1] corpus training. The computer device reversely translates corpus B2 into corpus A2 through the trained translation model, so that the pseudo-parallel corpus [A2, C2] can be constructed quickly and easily, that is, the constructed candidate parallel corpus.
[0137] In order to reduce the noise caused by the back translation in the constructed candidate parallel corpus, the candidate parallel corpus can be evaluated using the trained corpus evaluation model, thereby screening out the low-noise parallel corpora corresponding to language A and language C. The screened parallel corpora can be used to train the machine translation model, thereby obtaining a machine translation model with good translation capabilities.
[0138] S604: Perform corpus evaluation processing on the candidate source texts and the corresponding candidate translation texts through the trained corpus evaluation model to obtain corpus evaluation scores corresponding to the candidate translation texts.
[0139] The corpus evaluation score is the corpus evaluation result output after the candidate source text and the corresponding candidate translation text are input into the trained corpus evaluation model for processing. The corpus evaluation score can be used to measure the matching degree or difference between the candidate source text and the candidate translation text. When the matching degree between the candidate source text and the candidate translation text is higher or the difference is smaller, the corresponding corpus evaluation score is higher; when the matching degree between the candidate source text and the candidate translation text is lower or the difference is greater, the corresponding corpus evaluation score is lower.
[0140] Specifically, the computer device can input the word sequences corresponding to the candidate source text and the candidate translation text into the trained corpus evaluation model, respectively. The trained corpus evaluation model is used to perform corpus evaluation processing on the candidate source text and the corresponding candidate translation text to obtain a corpus evaluation score corresponding to the candidate translation text.
[0141] S606: Filter out target parallel corpora whose corresponding corpus evaluation scores meet preset filtering conditions from the candidate parallel corpora.
[0142] Among them, the preset screening condition can specifically be that the corpus evaluation score is greater than or equal to a preset threshold, or the corpus evaluation score is ranked from high to low, and the ranking is in the top N, etc. Specifically, the computer device can filter out the target parallel corpus whose corresponding corpus evaluation score meets the preset screening condition from the candidate parallel corpus. In one embodiment, the computer device can train the machine translation model with the screened target parallel corpus, thereby obtaining a machine translation model with good translation ability. Since the trained corpus evaluation model has learned the deep semantic information of the source text and the translated text, it can perform data screening from the semantic level.
[0143] It is understandable that in practical application scenarios, there are often situations where there are only a small amount of low-noise parallel corpora and a large amount of high-noise parallel corpora, and directly using high-noise parallel corpora to train the machine translation model will reduce the performance of the machine translation model. In this case, the computer device can adopt the corpus evaluation model training method in various embodiments of the present application, and train the corpus evaluation model by a small amount of low-noise parallel corpora. Then, a large amount of high-noise parallel corpora are screened by the trained corpus evaluation model, and the target parallel corpora whose corpus evaluation score meets the screening condition are screened out. Thus, the computer device can train the machine translation model together according to the low-noise parallel corpora and the screened target parallel corpora, so as to obtain a machine translation model with good translation ability.
[0144] It can be understood that in practical application scenarios, the following scenarios may also exist: the computer device can only obtain a small amount of low-noise parallel corpora and a large amount of monolingual corpora. In this case, the computer device can perform reverse translation on the monolingual corpora to expand the data, but the reverse translated corpora will have certain noise. In this case, the computer device can adopt the corpus evaluation model training method in various embodiments of the present application, and train the corpus evaluation model by a small amount of low-noise parallel corpora. Then, the reverse translated parallel corpora are screened by the trained corpus evaluation model, and the target parallel corpora whose corpus evaluation score meets the screening condition are screened out. Thereby, the computer device can jointly train the machine translation model according to the low-noise parallel corpora and the screened target parallel corpora, so as to obtain a machine translation model with good translation ability.
[0145] In the above embodiment, the candidate source text and the corresponding candidate translation text are subjected to corpus evaluation processing by the trained corpus evaluation model to obtain a corpus evaluation score corresponding to the candidate translation text, and the target parallel corpus can be conveniently and quickly screened out from the candidate parallel corpus according to the corpus evaluation score. In this way, the low-noise parallel corpus can be screened out from the high-noise parallel corpus as the target parallel corpus by the trained corpus evaluation model.
[0146] It can be understood that in a scenario where multiple alternative translation texts are output when translating using a machine translation model, if it is necessary to sort these multiple alternative translation texts, or to select a better translation from these multiple alternative translation texts, the corpus evaluation model obtained in each embodiment of the present application can be used to perform corpus evaluation on the parallel corpus composed of these multiple alternative translation texts, and obtain the corpus evaluation score corresponding to each alternative translation text, thereby using the obtained corpus evaluation scores to reorder these alternative translation texts.
[0147] It should be noted that the machine translation model used in this scenario is not limited to the machine translation model mentioned in the embodiments of the present application, but may also be a model with translation function obtained based on other training methods or other model structures.
[0148] In one embodiment, the corpus evaluation model training method further includes a step of reordering the candidate translation texts, which specifically includes the following steps:
[0149] S702: Obtain the text to be translated.
[0150] Specifically, the computer device may obtain the text to be translated from a local or other computer device.
[0151] S704: Input the text to be translated into a machine translation model to obtain a plurality of alternative translation texts.
[0152] Specifically, the computer device performs word segmentation on the text to be translated obtained in the translation scenario to obtain a word sequence, and inputs the word sequence of the text to be translated into the machine translation model. When the machine translation model outputs multiple alternative translation texts and these alternative translation texts need to be sorted or selected, the corpus evaluation model trained in the above embodiment of the present application can be obtained.
[0153] S706: The text to be translated and each of the backup translation texts are respectively organized into more than one set of backup parallel corpora.
[0154] Specifically, the computer device can respectively organize the text to be translated and each of the alternative translation texts into more than one group of alternative parallel corpora. For example, the text to be translated is X, and the multiple alternative translation texts obtained by machine translation of X by the machine translation model are Y1, Y2, Y3 and Y4. Then, the computer device can respectively organize the text to be translated and each of the alternative translation texts into multiple groups of alternative parallel corpora, such as alternative parallel corpus 1 [X, Y1], alternative parallel corpus 2 [X, Y2], alternative parallel corpus 3 [X, Y3] and alternative parallel corpus 4 [X, Y4].
[0155] S708, performing corpus evaluation processing on each of the backup parallel corpora using the trained corpus evaluation model to obtain corpus evaluation scores corresponding to each of the backup translation texts.
[0156] Specifically, the computer device can input multiple backup parallel corpora into the trained corpus evaluation model respectively to obtain corpus evaluation scores corresponding to each backup translation text, so that the corresponding backup translation texts can be reordered according to each corpus evaluation score.
[0157] S710: reorder the candidate translation texts according to the evaluation scores of the corpora.
[0158] Among them, reordering is to reorder the sorting results of the original alternative translation texts. It can be understood that for the machine translation model, when translating the text to be translated, there can be multiple choices each time a target word is output, and finally multiple groups of alternative word sequences, that is, multiple alternative translation texts, can be obtained, and each group of alternative translation texts corresponds to a translation probability. Before outputting the target translation text, the machine translation model can sort the alternative translation texts according to the translation probabilities corresponding to each of the alternative translation texts, and output the alternative translation text corresponding to the maximum translation probability as the target translation text. Therefore, before sorting the alternative translation texts according to the corpus evaluation model, the machine translation model has made a preliminary sorting of the alternative translation texts, and the corpus evaluation score will affect the reordering results.
[0159] In one embodiment, the computer device can directly re-sort the standby translation texts according to the size of the corpus evaluation score corresponding to each standby translation text. Alternatively, the computer device can also comprehensively consider the translation probability and corpus evaluation score corresponding to each standby translation text, and re-sort the standby translation texts. Among them, the translation probability and corpus evaluation score corresponding to each standby translation text are comprehensively considered, for example, the translation probability and corpus evaluation score are converted into a measurable percentage score, and then weighted summation is performed, and re-sorting is performed according to the result of the weighted summation. Of course, the computer device can also adopt other comprehensive consideration methods, which are not limited here.
[0160] The reordering may specifically be sequential ordering, i.e., the alternative translation texts with high corpus evaluation scores are ordered first, and the alternative translation texts with low corpus evaluation scores are ordered last; the reordering may also be reverse ordering, i.e., the alternative translation texts with high corpus evaluation scores are ordered last, and the alternative translation texts with low corpus evaluation scores are ordered first.
[0161] In one embodiment, when it is necessary to select a better alternative translation text from these alternative translation texts, multiple alternative translation texts that are ranked first or ranked high can be selected from the alternative translation texts that are sorted in sequence, or multiple alternative translation texts that are ranked last or ranked low can be selected from the alternative translation texts that are sorted in reverse order. The selected alternative translation texts are used as target translation texts corresponding to the text to be translated.
[0162] In the above embodiment, after the corpus evaluation model is trained, multiple alternative translation texts translated from the to-be-translated text can be reordered or selected by the trained corpus evaluation model, and then applied to the machine translation model, thereby broadening the scope of application.
[0163] In a specific embodiment, the corpus evaluation model training method specifically includes the following steps:
[0164] S802, obtaining parallel corpus; the parallel corpus includes a source text and a corresponding reference translation text.
[0165] S804: Translate the source text using a machine translation model to obtain a corresponding machine translated text.
[0166] S806, using the source text and the machine translated text together as training samples for the corpus evaluation model.
[0167] S808: Calculate the matching degree between the machine translated text and the reference translated text according to a preset text matching method.
[0168] S810: Use the matching degree as a training label corresponding to the training sample.
[0169] S812, semantically encode the word sequence of the source text through the encoder of the first recurrent neural network structure in the corpus evaluation model to obtain a first semantic vector sequence, and continue to decode the first semantic vector sequence in sequence through the decoder of the first recurrent neural network structure to obtain a first hidden layer vector sequence.
[0170] S814, performing a weighted sum calculation on each vector in the first hidden layer vector sequence through the first recurrent neural network structure, and outputting a vector obtained by the weighted sum calculation.
[0171] S816, semantically encode the word sequence of the machine translation text through the encoder of the second recurrent neural network structure in the corpus evaluation model to obtain a second semantic vector sequence, and continue to decode the second semantic vector sequence in turn through the decoder of the second recurrent neural network structure to obtain a second hidden layer vector sequence.
[0172] S818, performing weighted sum calculation on each vector in the second hidden layer vector sequence through the second recurrent neural network structure, and outputting the vector obtained by the weighted sum calculation; wherein the first recurrent neural network structure and the second recurrent neural network structure are parallel.
[0173] S820, obtaining translation quality evaluation results of the machine translation text in different dimensions.
[0174] S822, determine the corresponding combined dimension vector according to the results corresponding to different dimensions.
[0175] S824, through the feedforward neural network structure of the corpus evaluation model, the vectors output by the two parallel recurrent neural network structures and the combined dimension vector are concatenated and processed to obtain the corpus evaluation result.
[0176] S826, according to the difference between the corpus evaluation result and the training label, adjust the model parameters of the corpus evaluation model and continue training until the training stop condition is met.
[0177] The above-mentioned corpus evaluation model training method obtains a parallel corpus including a source text and a corresponding reference translation text, and translates the source text through a machine translation model to obtain a corresponding machine translation text. The source text and the corresponding machine translation text are used together as training samples of the corpus evaluation model. The machine translation text and the corresponding reference translation text are compared to obtain a training label corresponding to the training sample. Since there are various noises in the machine translation text, it is no longer necessary to rely on artificially added noise to construct a counterexample. The training label is determined by comparing the machine translation text with the reference translation text, and a large amount of training data can be constructed without relying on manually annotated corpus, which greatly improves the preparation efficiency of the training data, thereby greatly improving the training efficiency of the model. In addition, since the machine translation text output by the machine translation model includes various noises, it has a wider coverage than artificial noise and is closer to the real scene, and can well avoid the problem of model overfitting caused by the limitations of the training data, and can efficiently train a high-performance corpus evaluation model.
[0178] Figure 8 FIG. 1 is a flow chart of a method for training a corpus evaluation model in one embodiment. It should be understood that although Figure 8 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 8At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0179] like Fig. 9 As shown, in one embodiment, a corpus evaluation model training device 900 is provided, including an acquisition module 901, a translation module 902, a determination module 903, a comparison module 904 and a training module 905.
[0180] The acquisition module 901 is used to acquire parallel corpora; the parallel corpora include source texts and corresponding reference translation texts.
[0181] The translation module 902 is used to translate the source text through a machine translation model to obtain a corresponding machine translated text.
[0182] The determination module 903 is used to use the source text and the machine translated text as training samples for the corpus evaluation model.
[0183] The comparison module 904 is used to compare the machine translated text with the reference translated text to obtain a training label corresponding to the training sample.
[0184] The training module 905 is used to train the corpus evaluation model through training samples and corresponding training labels.
[0185] In one embodiment, the comparison module 904 is further used to calculate the matching degree between the machine translated text and the reference translated text according to a preset text matching method; and use the matching degree as a training label corresponding to the training sample.
[0186] In one embodiment, the training module 905 is also used to process the word sequence of the source text and the word sequence of the machine translated text respectively through two parallel recurrent neural network structures in the corpus evaluation model; concatenate the vectors output by each of the two parallel recurrent neural network structures and continue to process them through the feedforward neural network structure of the corpus evaluation model to obtain a corpus evaluation result; and adjust the model parameters of the corpus evaluation model and continue training according to the difference between the corpus evaluation result and the training label, until the training is terminated when the training stop condition is met.
[0187] In one embodiment, the training module 905 is also used to semantically encode the word sequence of the source text through the encoder of the first recurrent neural network structure in the corpus evaluation model to obtain a first semantic vector sequence, and continue to decode the first semantic vector sequence in sequence through the decoder of the first recurrent neural network structure to obtain a first hidden layer vector sequence; perform weighted sum calculation on each vector in the first hidden layer vector sequence through the first recurrent neural network structure, and output the vector obtained by the weighted sum calculation; perform semantic encoding on the word sequence of the machine translation text through the encoder of the second recurrent neural network structure in the corpus evaluation model to obtain a second semantic vector sequence, and continue to decode the second semantic vector sequence in sequence through the decoder of the second recurrent neural network structure to obtain a second hidden layer vector sequence; perform weighted sum calculation on each vector in the second hidden layer vector sequence through the second recurrent neural network structure, and output the vector obtained by the weighted sum calculation; wherein the first recurrent neural network structure and the second recurrent neural network structure are parallel.
[0188] In one embodiment, the training module 905 is also used to obtain the attention allocation weight vector corresponding to the first semantic vector sequence at that time through the decoder of the first recurrent neural network structure; calculate the content vector at that time based on the attention allocation weight vector and the first semantic vector sequence; calculate the first hidden layer vector at that time based on the first hidden layer vector output by the decoder of the first recurrent neural network structure last time and the content vector at that time; combine the first hidden layer vectors output in sequence by the decoder of the first recurrent neural network structure to obtain the first hidden layer vector sequence corresponding to the source text.
[0189] In one embodiment, the training module 905 is also used to obtain the results of translation quality evaluation of machine translated texts in different dimensions; determine the corresponding combined dimension vectors according to the results corresponding to the different dimensions; and use the feedforward neural network structure of the corpus evaluation model to splice and continue processing the vectors output by each of the two parallel recurrent neural network structures and the combined dimension vector to obtain the corpus evaluation results.
[0190] refer to Fig.10 In one embodiment, the corpus evaluation model training device 900 further includes: using module 906, which is used to obtain module 901, and is also used to obtain candidate parallel corpora to be processed; the candidate parallel corpora include candidate source texts and corresponding candidate translation texts; through the trained corpus evaluation model, corpus evaluation processing is performed on the candidate source texts and the corresponding candidate translation texts to obtain corpus evaluation scores; from the candidate parallel corpora, the target parallel corpora whose corresponding corpus evaluation scores meet the preset screening conditions are screened out.
[0191] In one embodiment, the candidate source text is a text corresponding to the first language; the candidate translation text is a text corresponding to the second language; the acquisition module 901 is further used to acquire a first parallel corpus and a second parallel corpus; the first parallel corpus includes the candidate source text corresponding to the first language and the corresponding candidate intermediate text corresponding to the third language; the second parallel corpus includes the candidate intermediate text corresponding to the third language and the corresponding candidate translation text corresponding to the second language; a candidate parallel corpus is constructed based on the first parallel corpus and the second parallel corpus; the candidate parallel corpus includes the candidate source text corresponding to the first language and the corresponding candidate translation text corresponding to the second language.
[0192] In one embodiment, module 906 is used to obtain a text to be translated; input the text to be translated into a machine translation model to obtain a plurality of alternative translation texts; respectively form the text to be translated and the alternative translation texts into more than one set of alternative parallel corpora; perform corpus evaluation processing on each alternative parallel corpus through a trained corpus evaluation model to obtain a corpus evaluation score corresponding to each alternative translation text; and reorder the alternative translation texts according to the corpus evaluation scores.
[0193] The above-mentioned corpus evaluation model training device obtains a parallel corpus including a source text and a corresponding reference translation text, and translates the source text through a machine translation model to obtain a corresponding machine translation text. The source text and the corresponding machine translation text are used together as training samples of the corpus evaluation model. The machine translation text and the corresponding reference translation text are compared to obtain a training label corresponding to the training sample. Since there are various noises in the machine translation text, it is no longer necessary to rely on artificially added noise to construct a counterexample. The training label is determined by comparing the machine translation text with the reference translation text, and a large amount of training data can be constructed without relying on manually annotated corpus, which greatly improves the preparation efficiency of the training data, thereby greatly improving the training efficiency of the model. In addition, since the machine translation text output by the machine translation model includes various noises, it has a wider coverage than artificial noise and is closer to the real scene, and can well avoid the problem of model overfitting caused by the limitations of the training data, and can efficiently train a high-performance corpus evaluation model.
[0194] Fig.11 The internal structure diagram of a computer device in one embodiment is shown. The computer device may specifically be Figure 1 The terminal 110 or the server 120 in FIG. Fig.11As shown, the computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program, which, when executed by the processor, enables the processor to implement the corpus evaluation model training method. The internal memory may also store a computer program, which, when executed by the processor, enables the processor to execute the corpus evaluation model training method.
[0195] Those skilled in the art will understand that Fig.11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0196] In one embodiment, the corpus evaluation model training device provided in the present application can be implemented in the form of a computer program. The computer program can be Fig.11 The computer device is run on the computer device shown. The memory of the computer device can store various program modules that constitute the corpus evaluation model training device, such as: Fig. 9 The acquisition module, translation module, determination module, comparison module and training module shown in the figure. The computer program composed of each program module enables the processor to execute the steps in the corpus evaluation model training method of each embodiment of the present application described in this specification.
[0197] For example, Fig.11 The computer device shown can be Fig. 9 The acquisition module in the corpus evaluation model training device shown executes step S202. The computer device may execute step S204 through the translation module. The computer device may execute step S206 through the determination module. The computer device may execute step S208 through the comparison module. The computer device may execute step S210 through the training module.
[0198] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above-mentioned corpus evaluation model training method. The steps of the corpus evaluation model training method here may be the steps of the corpus evaluation model training method in each of the above-mentioned embodiments.
[0199] In one embodiment, a computer-readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, the processor executes the steps of the above-mentioned corpus evaluation model training method. The steps of the corpus evaluation model training method here can be the steps in the corpus evaluation model training method of each of the above-mentioned embodiments.
[0200] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0201] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0202] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A corpus evaluation model training method, comprising: Acquire parallel corpus; the parallel corpus includes a source text and a corresponding reference translation text; Translating the source text through a machine translation model to obtain a corresponding machine translated text; Using the source text and the machine translated text together as training samples for a corpus evaluation model; Comparing the machine translated text with the reference translated text to obtain a training label corresponding to the training sample; The word sequence of the source text and the word sequence of the machine translated text are processed respectively by two parallel recurrent neural network structures in the corpus evaluation model; The vectors outputted by the two parallel recurrent neural network structures are spliced and processed through the feedforward neural network structure of the corpus evaluation model to obtain a corpus evaluation result; According to the difference between the corpus evaluation result and the training label, the model parameters of the corpus evaluation model are adjusted and the training is continued until the training is terminated when the training stop condition is met.
2. The method according to claim 1, characterized in that The comparing the machine translated text with the reference translated text to obtain a training label corresponding to the training sample includes: Calculating the matching degree between the machine translated text and the reference translated text according to a preset text matching method; The matching degree is used as a training label corresponding to the training sample.
3. The method according to claim 1, characterized in that: The processing of the word sequence of the source text and the word sequence of the machine translated text respectively by two parallel recurrent neural network structures in the corpus evaluation model includes: The word sequence of the source text is semantically encoded by the encoder of the first recurrent neural network structure in the corpus evaluation model to obtain a first semantic vector sequence, and the first semantic vector sequence is decoded in turn by the decoder of the first recurrent neural network structure to obtain a first hidden layer vector sequence; Performing a weighted sum calculation on each vector in the first hidden layer vector sequence through the first recurrent neural network structure, and outputting a vector obtained by the weighted sum calculation; The word sequence of the machine translation text is semantically encoded by the encoder of the second recurrent neural network structure in the corpus evaluation model to obtain a second semantic vector sequence, and the second semantic vector sequence is decoded in turn by the decoder of the second recurrent neural network structure to obtain a second hidden layer vector sequence; Performing a weighted sum calculation on each vector in the second hidden layer vector sequence through the second recurrent neural network structure, and outputting a vector obtained by the weighted sum calculation; Among them, the first recurrent neural network structure and the second recurrent neural network structure are parallel.
4. The method according to claim 3, characterized in that The first semantic vector sequence is decoded in sequence by the decoder of the first recurrent neural network structure to obtain a first hidden layer vector sequence, including: Obtaining, through the decoder of the first recurrent neural network structure, an attention allocation weight vector corresponding to the first semantic vector sequence at that time; Calculate the current content vector according to the attention allocation weight vector and the first semantic vector sequence; Calculate the first hidden layer vector of the current time according to the first hidden layer vector outputted by the decoder of the first recurrent neural network structure last time and the content vector of the current time; The first hidden layer vectors sequentially output by the decoder of the first recurrent neural network structure are combined to obtain a first hidden layer vector sequence corresponding to the source text.
5. The method according to claim 1, characterized in that The method further comprises: Obtaining translation quality evaluation results of the machine translated text in different dimensions; Determine the corresponding combined dimension vector according to the results corresponding to different dimensions; The feedforward neural network structure of the corpus evaluation model splices and processes the vectors output by the two parallel recurrent neural network structures to obtain a corpus evaluation result, including: Through the feedforward neural network structure of the corpus evaluation model, the vectors output by each of the two parallel recurrent neural network structures and the combined dimension vector are spliced and further processed to obtain a corpus evaluation result.
6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: Obtaining candidate parallel corpora to be processed; the candidate parallel corpora include candidate source texts and corresponding candidate translation texts; Performing corpus evaluation processing on the candidate source text and the corresponding candidate translation text using a trained corpus evaluation model to obtain a corpus evaluation score; From the candidate parallel corpora, target parallel corpora whose corresponding corpus evaluation scores meet preset screening conditions are screened out.
7. The method according to claim 6, characterized in that The candidate source text is a text corresponding to the first language; the candidate translation text is a text corresponding to the second language; The obtaining of candidate parallel corpora to be processed comprises: Acquire a first parallel corpus and a second parallel corpus; the first parallel corpus includes a candidate source text corresponding to a first language and a corresponding candidate intermediate text corresponding to a third language; The second parallel corpus includes candidate intermediate texts corresponding to the third language and corresponding candidate translation texts corresponding to the second language; A candidate parallel corpus is constructed according to the first parallel corpus and the second parallel corpus; the candidate parallel corpus includes a candidate source text corresponding to the first language and a corresponding candidate translation text corresponding to the second language.
8. The method according to any one of claims 1 to 5, characterized in that The method further comprises: Get the text to be translated; Inputting the text to be translated into a machine translation model to obtain a plurality of alternative translation texts; The text to be translated and each of the alternative translation texts are respectively formed into more than one set of alternative parallel corpora; Using the trained corpus evaluation model, each of the backup parallel corpora is subjected to corpus evaluation processing to obtain a corpus evaluation score corresponding to each of the backup translation texts; The candidate translation texts are reordered according to the evaluation scores of the corpora.
9. A corpus evaluation model training device, characterized in that: The device comprises: An acquisition module, used for acquiring parallel corpora; the parallel corpora include source texts and corresponding reference translation texts; A translation module, used to translate the source text through a machine translation model to obtain a corresponding machine translated text; A determination module, configured to use the source text and the machine translated text as training samples for a corpus evaluation model; A comparison module, used for comparing the machine translated text with the reference translated text to obtain a training label corresponding to the training sample; The training module is used to process the word sequence of the source text and the word sequence of the machine translated text respectively through the two parallel recurrent neural network structures in the corpus evaluation model; the vectors output by the two parallel recurrent neural network structures are spliced and then continued to be processed through the feedforward neural network structure of the corpus evaluation model to obtain the corpus evaluation result; according to the difference between the corpus evaluation result and the training label, the model parameters of the corpus evaluation model are adjusted and the training is continued until the training stop condition is met and the training is terminated.
10. The device according to claim 9, characterized in that The comparison module is further used to: calculate the matching degree between the machine translated text and the reference translated text according to a preset text matching method; and use the matching degree as a training label corresponding to the training sample.
11. The device according to claim 9, characterized in that The training module is also used to: semantically encode the word sequence of the source text through the encoder of the first recurrent neural network structure in the corpus evaluation model to obtain a first semantic vector sequence, and continue to decode the first semantic vector sequence in sequence through the decoder of the first recurrent neural network structure to obtain a first hidden layer vector sequence; perform weighted sum calculation on each vector in the first hidden layer vector sequence through the first recurrent neural network structure, and output the vector obtained by the weighted sum calculation; semantically encode the word sequence of the machine translated text through the encoder of the second recurrent neural network structure in the corpus evaluation model to obtain a second semantic vector sequence, and continue to decode the second semantic vector sequence in sequence through the decoder of the second recurrent neural network structure to obtain a second hidden layer vector sequence; perform weighted sum calculation on each vector in the second hidden layer vector sequence through the second recurrent neural network structure, and output the vector obtained by the weighted sum calculation; wherein the first recurrent neural network structure is parallel to the second recurrent neural network structure.
12. The device according to claim 11, characterized in that The training module is also used to: obtain the attention allocation weight vector corresponding to the first semantic vector sequence at the time through the decoder of the first recurrent neural network structure; calculate the content vector at the time based on the attention allocation weight vector and the first semantic vector sequence; calculate the first hidden layer vector at the time based on the first hidden layer vector output by the decoder of the first recurrent neural network structure last time and the content vector at the time; combine the first hidden layer vectors output in sequence by the decoder of the first recurrent neural network structure to obtain the first hidden layer vector sequence corresponding to the source text.
13. The device according to claim 9, characterized in that The training module is also used to: obtain the results of translation quality evaluation of the machine translation text in different dimensions; determine the corresponding combined dimension vector according to the results corresponding to the different dimensions; and concatenate and continue to process the vectors output by each of the two parallel recurrent neural network structures and the combined dimension vector through the feedforward neural network structure of the corpus evaluation model to obtain the corpus evaluation result.
14. The device according to any one of claims 9 to 13, characterized in that The device also includes a using module for obtaining candidate parallel corpora to be processed; the candidate parallel corpora include candidate source texts and corresponding candidate translation texts; using a trained corpus evaluation model, corpus evaluation processing is performed on the candidate source texts and the corresponding candidate translation texts to obtain a corpus evaluation score; From the candidate parallel corpora, target parallel corpora whose corresponding corpus evaluation scores meet preset screening conditions are screened out.
15. The device according to claim 14, characterized in that The candidate source text is a text corresponding to the first language; the candidate translation text is a text corresponding to the second language; the acquisition module is further used to: acquire a first parallel corpus and a second parallel corpus; the first parallel corpus includes a candidate source text corresponding to the first language and a corresponding candidate intermediate text corresponding to the third language; The second parallel corpus includes candidate intermediate texts corresponding to the third language and corresponding candidate translation texts corresponding to the second language; a candidate parallel corpus is constructed based on the first parallel corpus and the second parallel corpus; the candidate parallel corpus includes candidate source texts corresponding to the first language and corresponding candidate translation texts corresponding to the second language.
16. The device according to any one of claims 9 to 13, characterized in that The device also includes a using module, which is used to: obtain a text to be translated; input the text to be translated into a machine translation model to obtain a plurality of alternative translation texts; respectively form more than one set of alternative parallel corpora with the text to be translated and the alternative translation texts; Through the trained corpus evaluation model, corpus evaluation processing is performed on each of the backup parallel corpora to obtain corpus evaluation scores corresponding to each of the backup translation texts; and the backup translation texts are reordered according to each of the corpus evaluation scores.
17. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 8.
18. A computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method according to any one of claims 1 to 8.
