Translation model training method and device

By introducing the corpus editing model into the translation model, editing and correcting the translation results, the accuracy and domain matching of the corpus translation of the translation model in a specific field is solved, and a more efficient and accurate translation effect is achieved.

CN113642338BActive Publication Date: 2024-12-27ALIBABA GROUP HOLDING LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010393106.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-05-11
Publication Date
2024-12-27
Estimated Expiration
2040-05-11

AI Technical Summary

Technical Problem

The existing translation model has problems with accuracy and domain matching in corpus translation within a specific domain, resulting in inaccurate translation results.

Method used

By obtaining the corpus of the target field, using the translation model for translation, and inputting the original corpus and translation results into the corpus editing model for editing, generating the editing corpus as training samples, which are used to train the target translation model to achieve correction and domain matching of the translation model. .

Benefits of technology

It improves the accuracy of corpus translation in the target field, avoids translation errors and field mismatch problems, reduces the need for manpower correction, and improves translation efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113642338B_ABST
    Figure CN113642338B_ABST
Patent Text Reader

Abstract

The present specification provides a translation model training method and device, wherein the translation model training method comprises: obtaining a first corpus in a target domain; translating the first corpus using a first translation model to obtain a second corpus; inputting the first corpus and the second corpus into a corpus editing model to perform corpus editing to obtain an edited corpus of the second corpus; and training a second translation model using the first corpus and the edited corpus as training samples to obtain a target translation model in the target domain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of machine learning technology, and in particular to a translation model training method and device. Background Art

[0002] With the development of Internet technology, translation technology is becoming more and more mature. In order to facilitate users to use it more conveniently and quickly translate the target corpus, a trained translation model is usually used for the translation process. However, in some specific fields, the translation of corpus using translation models may not be accurate. For example, in the sales field, the meaning of the word "baby" mostly represents the "goods" sold. If it is translated into English through a translation model, the translation result is "baby", which does not conform to the meaning of the word in the sales field. In order to avoid this situation, in the process of translating corpus in a specific field, a common method is to use the monolingual corpus in the field, obtain pseudo-parallel data through reverse translation, and then train the translation model to achieve corpus translation in a specific field. However, there are some translation errors and field mismatches in the pseudo-parallel data, which will introduce erroneous samples into the translation model, resulting in the final translation model not being very effective in translating the corpus in the field. Summary of the invention

[0003] In view of this, the embodiments of this specification provide a translation model training method. This specification also relates to a translation model training device, three computing devices, and three computer-readable storage media to solve the technical defects existing in the prior art.

[0004] According to a first aspect of an embodiment of this specification, a first translation model training method is provided, including:

[0005] Obtain the first corpus of the target domain;

[0006] Using a first translation model to translate the first corpus to obtain a second corpus;

[0007] Inputting the first corpus and the second corpus into a corpus editing model to perform corpus editing to obtain an edited corpus of the second corpus;

[0008] The second translation model is trained using the first corpus and the edited corpus as training samples to obtain a target translation model for the target domain.

[0009] Optionally, the second translation model and the first translation model are reverse translation models.

[0010] Optionally, the corpus editing model is trained in the following manner:

[0011] Acquire a third corpus in the target domain; the third corpus and the first corpus are target corpus and source corpus respectively;

[0012] Translating the third corpus using the second translation model to obtain a fourth corpus;

[0013] Using the first translation model to translate the fourth corpus to obtain a fifth corpus;

[0014] The first corpus editing model to be trained is trained using the third corpus, the fourth corpus and the fifth corpus as training samples to obtain the corpus editing model.

[0015] Optionally, also include:

[0016] Inputting the third corpus and the fourth corpus into a second corpus editing model to perform corpus editing to obtain an edited corpus of the fourth corpus;

[0017] The first translation model is trained using the edited corpus of the third corpus and the fourth corpus as training samples to obtain a second target translation model of the target domain.

[0018] Optionally, the second corpus editing model is trained in the following manner:

[0019] Inputting the second corpus into the second translation model for translation to obtain a sixth corpus;

[0020] The first corpus, the second corpus and the sixth corpus are used as training samples to train the second corpus editing model to obtain the second corpus editing model.

[0021] Optionally, the translation model training method is performed in an iterative manner;

[0022] Wherein, during the iteration process, the target translation model obtained by training after the previous iteration is used as the second translation model in the next iteration process;

[0023] The second target translation model obtained by training after the previous iteration is used as the first translation model in the next iteration.

[0024] Optionally, during the iteration process,

[0025] The corpus editing model obtained by training after the previous iteration is used as the corpus editing model in the next iteration;

[0026] The second corpus editing model obtained by training after the previous iteration is used as the second corpus editing model in the next iteration.

[0027] Optionally, the iteration termination condition of the iteration includes:

[0028] The target translation model obtained by training after the previous iteration execution satisfies the first iteration termination condition compared with the target translation model obtained by training after the previous iteration execution;

[0029] and / or,

[0030] The second target translation model obtained by training after the previous iteration execution satisfies the second iteration termination condition compared with the second target translation model obtained by training after the previous iteration execution.

[0031] Optionally, the step of inputting the first corpus and the second corpus into a corpus editing model to perform corpus editing to obtain an edited corpus of the second corpus includes:

[0032] Performing vectorization processing on the first corpus and the second corpus to obtain a first word vector of the first corpus and a second word vector of the second corpus;

[0033] A first encoding unit included in the corpus editing model encodes the first word vector into a first encoding vector, and a second encoding unit included in the corpus editing model encodes the second word vector into a second encoding vector;

[0034] The decoding unit included in the corpus editing model decodes the first encoding vector and the second encoding vector to obtain the edited corpus.

[0035] Optionally, the first translation model and / or the second translation model is a translation model of a non-target domain other than the target domain.

[0036] Optionally, the first corpus is a source corpus, and the second corpus is a target translation corpus.

[0037] The third corpus is the target corpus, the fourth corpus is the source translation corpus,

[0038] The fifth corpus is the target secondary translation corpus, and the sixth corpus is the source secondary translation corpus;

[0039] or,

[0040] The first corpus is the target corpus, the second corpus is the source translation corpus,

[0041] The third corpus is a source corpus, the fourth corpus is a target translation corpus,

[0042] The fifth corpus is a source secondary translation corpus, and the sixth corpus is a target secondary translation corpus.

[0043] According to a second aspect of the embodiments of this specification, a first translation model training device is provided, comprising:

[0044] An acquisition module, configured to acquire a first corpus in a target domain;

[0045] A translation module, configured to translate the first corpus using a first translation model to obtain a second corpus;

[0046] an editing module, configured to input the first corpus and the second corpus into a corpus editing model, perform corpus editing, and obtain an edited corpus of the second corpus;

[0047] The training module is configured to train the second translation model using the first corpus and the edited corpus as training samples to obtain a target translation model for the target domain.

[0048] According to a third aspect of the embodiments of this specification, a second translation model training method is provided, including:

[0049] Obtain the first corpus and the second corpus;

[0050] Using a first translation model to translate the first corpus into a third corpus, and using a second translation model to translate the second corpus into a fourth corpus;

[0051] Inputting the first corpus and the third corpus into a first corpus editing model for corpus editing to obtain a first edited corpus, and inputting the second corpus and the fourth corpus into a second corpus editing model for corpus editing to obtain a second edited corpus;

[0052] The second translation model is trained as a second target translation model using the first corpus and the first edited corpus as training samples, and the first translation model is trained as a first target translation model using the second corpus and the second edited corpus as training samples.

[0053] Optionally, the second translation model and the first translation model are reverse translation models;

[0054] and / or,

[0055] The first corpus and the second corpus are source corpus and target corpus for each other.

[0056] Optionally, the first corpus editing model is trained in the following manner:

[0057] Using the first translation model to translate the fourth corpus to obtain a fifth corpus;

[0058] The first corpus editing model to be trained is trained using the second corpus, the fourth corpus and the fifth corpus as training samples to obtain the first corpus editing model.

[0059] Optionally, the second corpus editing model is trained in the following manner:

[0060] Inputting the third corpus into the second translation model for translation to obtain a sixth corpus;

[0061] The second corpus editing model to be trained is trained with the first corpus, the third corpus and the sixth corpus as training samples to obtain the second corpus editing model.

[0062] Optionally, the translation model training method is performed in an iterative manner;

[0063] Wherein, during the iteration process, the second target translation model obtained by training after the previous iteration is used as the second translation model in the next iteration process;

[0064] The first target translation model obtained by training after the previous iteration is used as the first translation model in the next iteration.

[0065] Optionally, during the iteration process,

[0066] The first corpus editing model obtained by training after the previous iteration is used as the first corpus editing model in the next iteration;

[0067] The second corpus editing model obtained by training after the previous iteration is used as the second corpus editing model in the next iteration.

[0068] Optionally, the iteration termination condition of the iteration includes:

[0069] The first target translation model obtained by training after the previous iteration execution satisfies the first iteration termination condition compared with the first target translation model obtained by training after the previous iteration execution;

[0070] and / or,

[0071] The second target translation model obtained by training after the previous iteration execution satisfies the second iteration termination condition compared with the second target translation model obtained by training after the previous iteration execution.

[0072] Optionally, the step of inputting the first corpus and the third corpus into a first corpus editing model for corpus editing to obtain a first edited corpus includes:

[0073] Performing vectorization processing on the first corpus and the third corpus to obtain a first word vector of the first corpus and a third word vector of the third corpus;

[0074] The first encoding unit included in the first corpus editing model encodes the first word vector into a first encoding vector, and the second encoding unit included in the first corpus editing model encodes the third word vector into a third encoding vector;

[0075] The first encoding vector and the third encoding vector are decoded by a decoding unit included in the first corpus editing model to obtain the first edited corpus.

[0076] Optionally, the step of inputting the second corpus and the fourth corpus into a second corpus editing model to perform corpus editing to obtain a second edited corpus includes:

[0077] Performing vectorization processing on the second corpus and the fourth corpus to obtain a second word vector of the fourth corpus and a fourth word vector of the fourth corpus;

[0078] The first encoding unit included in the second corpus editing model encodes the second word vector into a second encoding vector, and the second encoding unit included in the second corpus editing model encodes the fourth word vector into a fourth encoding vector;

[0079] The second encoding vector and the fourth encoding vector are decoded by a decoding unit included in the second corpus editing model to obtain the second edited corpus.

[0080] Optionally, the first corpus and the second corpus are corpora of a target domain, and the first translation model and / or the second translation model are translation models of a non-target domain other than the target domain.

[0081] Optionally, the first corpus is a source corpus, and the second corpus is a target corpus.

[0082] The third corpus is the target translation corpus, and the fourth corpus is the source translation corpus;

[0083] or,

[0084] The first corpus is the target corpus, the second corpus is the source corpus,

[0085] The third corpus is a source translation corpus, and the fourth corpus is a target translation corpus.

[0086] According to a fourth aspect of the embodiments of this specification, a second translation model training device is provided, including:

[0087] An acquisition module is configured to acquire a first corpus and a second corpus;

[0088] A translation module, configured to translate the first corpus into a third corpus using a first translation model, and to translate the second corpus into a fourth corpus using a second translation model;

[0089] an editing module configured to input the first corpus and the third corpus into a first corpus editing model for corpus editing to obtain a first edited corpus, and input the second corpus and the fourth corpus into a second corpus editing model for corpus editing to obtain a second edited corpus;

[0090] The training module is configured to use the first corpus and the first edited corpus as training samples to train the second translation model into a second target translation model, and use the second corpus and the second edited corpus as training samples to train the first translation model into a first target translation model.

[0091] According to a fifth aspect of the embodiments of this specification, a third translation model training method is provided, including:

[0092] Obtain multiple corpora that are source and target corpora for each other;

[0093] Using a plurality of translation models corresponding to the plurality of corpora, the plurality of corpora are translated into a plurality of target corpora; the plurality of translation models are mutually reverse translation models;

[0094] According to the corpus pairs that are mutually the corpus and the target corpus among the multiple corpora and the multiple target corpora, the corpus pairs are input into the corresponding corpus editing model for corpus editing to obtain multiple edited corpora;

[0095] The plurality of corpora and corpus pairs that are corpora and translation corpora in the plurality of edited corpora are used as training samples, and the plurality of translation models are trained into a plurality of target translation models.

[0096] According to a sixth aspect of the embodiments of this specification, a third translation model training device is provided, including:

[0097] An acquisition module is configured to acquire a plurality of corpora that are source corpora and target corpora;

[0098] A translation module is configured to translate the multiple corpora into multiple target corpora using multiple translation models corresponding to the multiple corpora; the multiple translation models are mutually reverse translation models;

[0099] An editing module is configured to input the corpus pairs that are mutually corpus and target corpus into corresponding corpus editing models to perform corpus editing, thereby obtaining multiple edited corpora;

[0100] The training module is configured to train the multiple translation models into multiple target translation models by using the multiple corpora and the corpus pairs that are mutually corpora and translation corpora in the multiple edited corpora as training samples.

[0101] According to a seventh aspect of an embodiment of this specification, a first computing device is provided, including:

[0102] Memory and processor;

[0103] The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions:

[0104] Obtain the first corpus of the target domain;

[0105] Using a first translation model to translate the first corpus to obtain a second corpus;

[0106] Inputting the first corpus and the second corpus into a corpus editing model to perform corpus editing to obtain an edited corpus of the second corpus;

[0107] The second translation model is trained using the first corpus and the edited corpus as training samples to obtain a target translation model for the target domain.

[0108] According to an eighth aspect of the embodiments of this specification, a second computing device is provided, including:

[0109] Memory and processor;

[0110] The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions:

[0111] Obtain the first corpus and the second corpus;

[0112] Using a first translation model to translate the first corpus into a third corpus, and using a second translation model to translate the second corpus into a fourth corpus;

[0113] Inputting the first corpus and the third corpus into a first corpus editing model for corpus editing to obtain a first edited corpus, and inputting the second corpus and the fourth corpus into a second corpus editing model for corpus editing to obtain a second edited corpus;

[0114] The second translation model is trained as a second target translation model using the first corpus and the first edited corpus as training samples, and the first translation model is trained as a first target translation model using the second corpus and the second edited corpus as training samples.

[0115] According to a ninth aspect of the embodiments of this specification, a third computing device is provided, including:

[0116] Memory and processor;

[0117] The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions:

[0118] Obtain multiple corpora that are source and target corpora for each other;

[0119] Using a plurality of translation models corresponding to the plurality of corpora, the plurality of corpora are translated into a plurality of target corpora; the plurality of translation models are mutually reverse translation models;

[0120] According to the corpus pairs that are mutually the corpus and the target corpus among the multiple corpora and the multiple target corpora, the corpus pairs are input into the corresponding corpus editing model for corpus editing to obtain multiple edited corpora;

[0121] The plurality of corpora and corpus pairs that are corpora and translation corpora in the plurality of edited corpora are used as training samples, and the plurality of translation models are trained into a plurality of target translation models.

[0122] According to the tenth aspect of the embodiments of this specification, a first computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the first translation model training method are implemented.

[0123] According to the eleventh aspect of the embodiments of this specification, a second computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the second translation model training method are implemented.

[0124] According to the twelfth aspect of the embodiments of this specification, a third computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the third translation model training method are implemented.

[0125] A first translation model training method provided in an embodiment of the present specification obtains a first corpus in a target domain and translates the first corpus using a first translation model to obtain a second corpus. At this time, a corpus editing model is introduced, and the first corpus and the second corpus are input into the corpus editing model to obtain an edited corpus of the second corpus. Finally, the edited corpus and the first corpus are used as training samples to train the second translation model to obtain a target translation model in the target domain. The training samples used to train the translation model are corrected in combination with the corpus editing model, thereby achieving the correction of the translation model training samples without the need for manpower, effectively improving the accuracy of the target translation model in translating the target corpus, so that after the trained target translation model translates the corpus in the domain, the translated corpus can be obtained to conform to the target domain.

[0126] A second translation model training method provided in an embodiment of the present specification obtains a first corpus and a second corpus, and then uses the first translation model and the second translation model to translate the first corpus and the second corpus to obtain a third corpus and a fourth corpus, then introduces the first corpus editing model to edit the first corpus and the third corpus obtained after its translation, and introduces the second corpus editing model to edit the second corpus and the fourth corpus obtained after its translation to obtain a first edited corpus and a second edited corpus, and finally uses the first corpus and the first edited corpus as samples to train the second translation model, and uses the second corpus and the second edited corpus as samples to train the first translation model to obtain the second target translation model and the first target translation model, and by introducing the first corpus editing model and the second corpus editing model to edit the corpus, the adjustment of the corpus translation process is achieved, and the output results of the first corpus editing model and the second corpus editing model are used in combination with the original corpus to train the translation model, which can effectively improve the translation accuracy of the translation model and can effectively reduce translation errors and domain mismatch problems.

[0127] The third translation model training method provided in an embodiment of the present specification obtains multiple corpora of target corpora that are mutually source corpora, uses multiple translation models to translate and process them to obtain multiple target corpora, then introduces a corpus editing model to edit and process the corpus pairs of the multiple corpora and the multiple target corpora that are mutually source corpora, to obtain multiple edited corpora, and finally uses the multiple edited corpora and the multiple corpora as samples to train multiple translation models to obtain multiple target translation models, and obtains multiple edited corpora by introducing the corpus editing model for editing and processing, and trains multiple translation models in combination with multiple corpora corresponding to the source corpora, thereby improving the accuracy of the target translation model, and any corpora in the source corpora can be translated into each other, and the translation accuracy is significantly improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0128] Figure 1 is a flow chart of a first translation model training method provided in an embodiment of this specification;

[0129] Figure 2 It is a structural diagram of a first translation model training method provided in an embodiment of this specification;

[0130] Figure 3 It is a structural diagram of a corpus editing model provided in an embodiment of this specification;

[0131] Figure 4 It is a structural diagram of a first translation model training device provided in an embodiment of this specification;

[0132] Figure 5 is a flow chart of a second translation model training method provided in an embodiment of this specification;

[0133] Figure 6 is a schematic diagram of a second translation model training method provided in an embodiment of this specification;

[0134] Figure 7 is a structural diagram of a second translation model training device provided in an embodiment of this specification;

[0135] Figure 8 is a flowchart of a third translation model training method provided in an embodiment of this specification;

[0136] Fig. 9 is a structural diagram of a third translation model training device provided in an embodiment of this specification;

[0137] Fig.10 is a structural block diagram of a first computing device provided in an embodiment of this specification;

[0138] Fig.11 is a structural block diagram of a second computing device provided in an embodiment of this specification;

[0139] Fig.12 It is a structural block diagram of a third computing device provided in an embodiment of this specification. DETAILED DESCRIPTION

[0140] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.

[0141] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0142] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0143] In this specification, a translation model training method is provided. This specification also involves a translation model training device, three computing devices, and three computer-readable storage media, which are described in detail one by one in the following embodiments.

[0144] The first translation model training method embodiment provided in this application is as follows:

[0145] Figure 1 A flowchart of a first translation model training method provided according to an embodiment of this specification is shown. Figure 2 A schematic diagram showing the structure of a first translation model training method provided according to an embodiment of this specification is shown. Figure 3 A schematic diagram of the structure of a corpus editing model provided according to an embodiment of this specification is shown; Figure 1 The specific steps include:

[0146] Step S102: obtaining a first corpus in the target domain.

[0147] In actual applications, when using a translation model outside the target domain to translate the original corpus in the target domain, the problem of the translated target corpus expressing a different meaning from the original corpus may occur. If you want to achieve that the translated target corpus after the translation model has the same meaning as the original corpus in the target domain, you need to train a specific translation model for the target domain. The way to train a translation model is usually to manually annotate the training samples. In this process, a lot of manpower and material resources will be consumed to train a translation model that meets the target domain.

[0148] See also Figure 2 As shown, the first translation model training method provided in this embodiment, in order to save manpower and material resources while speeding up the training efficiency of the translation model in the target field, corrects the training samples used for training the translation model by combining the corpus editing model, thereby realizing the correction of the training samples of the translation model without borrowing manpower, and is more efficient than the manual labeling method, which can not only speed up the training of the translation model that meets the target field, but also effectively improve the translation accuracy of the translation model in the target field.

[0149] In a specific implementation, the target domain specifically refers to the domain to which the first corpus belongs, and the target domain has designated vocabulary, and the meaning of the vocabulary in the target domain may be different from that in other domains; for example, the target domain may be sales, online sales, sports, games, etc.;

[0150] Based on this, for example, if the target field is the online sales field, the meanings of some words in this field are different from the meanings of these words in other fields. For example, "baby" means commodity in the online sales field, but means child in the non-online sales field, or "bring goods" means recommending commodities in the online sales field, but means bringing goods in the non-online sales field. At this time, if "baby" or "bring goods" is translated into English through a translation model outside the online sales field, the translated English is "Baby" or "Bring goods", while "Baby" means child and "Bring goods" means bringing goods. The meanings expressed in the translated English do not match the online sales field. At this time, the translation effect of the translation model used does not meet the requirements of the online sales field. Therefore, it is necessary to train a translation model for the online sales field to achieve the effect of translating "baby" into "commodity" to indicate the meaning of commodity and translating "bring goods" into "Pick of the week" to indicate the meaning of recommending commodities, or translating "commodity" into "baby" and "Pick of the week" into "bring goods". Of course, it should be added here that although the meanings of many words are different in different fields, these words with different meanings can also be of great help in the collection of new words / hot words from a business perspective, and can enrich and accumulate vocabulary in the translation field, thereby achieving commercial use and added value.

[0151] Furthermore, this embodiment will use the first corpus of the target domain as the Chinese corpus to describe the translation model training method, so that the target translation model finally trained can translate the English corpus into the Chinese corpus matching the target domain, thus indicating that the target translation model matches the target domain and can translate the English corpus in the domain into the Chinese corpus in the domain.

[0152] In addition, the translation model involved in this embodiment can be a model of any structure, such as a translation model based on a convolutional neural network or a translation model based on a recurrent neural network. Regardless of the structure of the translation model, the translation model can be trained into a target translation model that matches the target domain through the translation model training method provided in this embodiment, and applied to the target domain to achieve corpus translation in the target domain.

[0153] Step S104: Use a first translation model to translate the first corpus to obtain a second corpus.

[0154] Specifically, based on the above-mentioned acquisition of the first corpus in the target domain, it is indicated that it is now necessary to train a translation model for the target domain, so that the trained translation model can be applied to the translation of the corpus in the target domain. Further, the first translation model is used to translate the first corpus to obtain the second corpus.

[0155] The first translation model is a translation model outside the target domain or an initial translation model to be trained, and needs to be trained so that it can be applied to the target domain after training.

[0156] This embodiment describes the process of training a translation model to match a target domain and capable of translating Chinese corpus into English corpus by assuming that the first corpus is Chinese corpus, and the target translation model can be matched with the target domain. Therefore, the second corpus is English corpus, and is English corpus obtained by translating Chinese corpus in the target domain through the first translation model.

[0157] For example, it is necessary to translate the Chinese corpus in the target domain into the English corpus in the target domain. In this case, it is necessary to train a translation model that matches the target domain. First, the Chinese corpus X_in of the target domain is obtained. Secondly, the Chinese corpus X_in is translated through the translation model MT_out{X->Y} to obtain the English corpus Y'_in, where the English corpus Y'_in represents the reverse pseudo corpus obtained after the Chinese corpus X_in is translated, and then used for subsequent translation model training.

[0158] Step S106: input the first corpus and the second corpus into a corpus editing model to perform corpus editing to obtain an edited corpus of the second corpus.

[0159] Specifically, based on the above-mentioned use of the first translation model to translate the first corpus to obtain the second corpus, further, in order to enable the translation model finally trained to match the target domain, corpus editing is required. The samples of the training translation model are adjusted through corpus editing, which specifically means that the corpus corresponding to the training sample represents the meaning of the target domain before and after translation, so that the translation model finally trained to match the target domain; therefore, the first corpus and the second corpus are input into the corpus editing model for corpus editing, and the edited corpus of the second corpus is obtained for subsequent translation model training.

[0160] See also Figure 3 As shown, the corpus editing model will be constructed based on the domain adaptation method of post-translation prototype editing (Domain Adaptation with Prototype Editing, referred to as DAPE). By training the corpus editing model (DAPE model), then inputting the reverse pseudo corpus (second corpus) outside the target domain, and modifying its source end (first corpus), it is possible to avoid the problem of mismatch between the trained translation model and the target domain and inaccurate translation expression, and effectively improve the accuracy of the translation model.

[0161] Furthermore, the corpus editing model is a dual-source input sequence-to-sequence model, which has two encoders (Encoder) and a decoder (Decoder). During use, the first corpus (target corpus SourceEmbedding) and the second corpus (target corpus translated corpus Target Embedding) are input into the encoder for encoding, and the encoding result is then input into the decoder to obtain the edited corpus corresponding to the second corpus.

[0162] In one or more implementations of this embodiment, the corpus editing process of the corpus editing model is as follows:

[0163] Performing vectorization processing on the first corpus and the second corpus to obtain a first word vector of the first corpus and a second word vector of the second corpus;

[0164] A first encoding unit included in the corpus editing model encodes the first word vector into a first encoding vector, and a second encoding unit included in the corpus editing model encodes the second word vector into a second encoding vector;

[0165] The decoding unit included in the corpus editing model decodes the first encoding vector and the second encoding vector to obtain the edited corpus.

[0166] In practical applications, before the corpus editing model is used to perform corpus editing, the first corpus and the second corpus need to be vectorized to obtain a first word vector and a second word vector. Secondly, the corpus editing model is used to perform corpus editing. The specific process includes: the first encoding unit and the second encoding unit included in the corpus editing model encode the first word vector and the second word vector to obtain a first encoding vector and a second encoding vector. Finally, the decoding unit included in the corpus editing model decodes the first encoding vector and the second encoding vector to obtain the edited corpus corresponding to the second corpus.

[0167] The corpus editing process is still described with the first corpus as the Chinese corpus. After the Chinese corpus X_in is translated by the translation model MT_out{X->Y} to obtain the English corpus Y'_in, the Chinese corpus X_in and the English corpus Y'_in are input into the corpus editing model DAPE{Y'_in, X->Y} for corpus editing. The corpus editing process of the corpus editing model DAPE{Y'_in, X->Y} specifically refers to: first, the Chinese corpus X_in and the English corpus Y'_in are vectorized to obtain Chinese word vectors and English word vectors, then the first encoder and the second encoder in the corpus editing model DAPE{Y'_in, X->Y} encode the Chinese word vectors and the English word vectors to obtain Chinese encoding vectors and English encoding vectors, and finally the Chinese encoding vectors and the English encoding vectors are decoded by the decoder in the corpus editing model DAPE{Y'_in, X->Y} to obtain the English edited corpus Y*_in corresponding to the English corpus Y'_in for subsequent training of the translation model.

[0168] Furthermore, before using the corpus editing model to edit the corpus, the corpus editing model needs to be trained, so that the corpus editing model used in the application process can have the purpose of adjusting the training samples for training the second translation model, so that the training samples adjusted by the corpus editing model are matched with the target domain, so that the corpus adjusted by the corpus editing model can be used as the training sample of the second translation model, and the subsequent translation model can be trained, so that the trained translation model can be matched with the target domain. Matching specifically means that the translation effect of the trained translation model can make the corpus before and after the translation have the same meaning as the corpus in the target domain. In one or more implementations of this embodiment, the specific implementation method is as follows:

[0169] Acquire a third corpus in the target domain; the third corpus and the first corpus are target corpus and source corpus respectively;

[0170] Translating the third corpus using the second translation model to obtain a fourth corpus;

[0171] Using the first translation model to translate the fourth corpus to obtain a fifth corpus;

[0172] The first corpus editing model to be trained is trained using the third corpus, the fourth corpus and the fifth corpus as training samples to obtain the corpus editing model.

[0173] In practical applications, it is first necessary to obtain a third corpus in the target domain, wherein the third corpus and the first corpus are each other's target corpus and source corpus; the target corpus specifically refers to the corpus to be translated, and the source corpus specifically refers to the corpus corresponding to the corpus type to which the corpus to be translated belongs after translation. It should be noted that the source corpus is not obtained after translation of the target corpus, so the third corpus belongs to the corpus type after the first corpus is translated, and is not the corpus after the first corpus is translated, and there is no corresponding relationship between the two.

[0174] Based on this, the third corpus is translated by the second translation model to obtain a fourth corpus, and the fourth corpus is of the same corpus type as the first corpus. The fourth corpus is then translated by the first translation model to obtain a fifth corpus, and the fifth corpus is of the same corpus type as the second corpus. Finally, the third corpus, the fourth corpus and the fifth corpus are used as training samples to train the first corpus editing model to be trained, so as to obtain the corpus editing model for adjusting the training samples of the translation model.

[0175] Among them, the second translation model and the first translation model are reverse translation models to each other. Reverse translation models specifically mean that the input and output corpus types of the first translation model have a reverse correspondence with the input and output of the second translation model, that is, the input corpus type of the first translation model is the same as the output corpus type of the second translation model, and the output corpus type of the first translation model is the same as the input corpus type of the second translation model.

[0176] Using the above example, we first obtain the English corpus Y_in of the target domain, where the Chinese corpus X_in and the English corpus Y_in are the target corpus and the source corpus of each other. Then, we translate the English corpus Y_in through the second translation model MT_out{Y->X} to obtain the Chinese corpus X'_in, where the Chinese corpus X'_in represents the reverse pseudo corpus obtained after the English corpus Y_in is translated. Then, we translate the Chinese corpus X'_in using the first translation model MT_out{X->Y} to obtain the English corpus Y”_in, where the English corpus Y”_in represents the reverse pseudo corpus obtained after the Chinese corpus X'_in is translated. Round-trip corpus; finally, based on the English corpus Y_in, the Chinese corpus X'_in and the English corpus Y"_in, the first corpus editing model DAPE{Y', X->Y} to be trained can be obtained to obtain the corpus editing model DAPE{Y'_in, X->Y}, so as to realize that the corresponding English editing corpus Y*_in can be determined through the English corpus Y'_in, wherein the English editing corpus Y*_in represents the reverse pseudo corpus of the target domain obtained after the English corpus Y'_in is edited, so as to achieve the purpose of adjusting the training samples of the second translation model MT_out{Y->X}.

[0177] In summary, in the process of training the corpus editing model, the third corpus is translated into the fourth corpus by using the second translation model, and then the fourth corpus is translated into the fifth corpus by the first translation model, and finally the corpus editing model is trained in combination with the third corpus, thereby obtaining a model for corpus editing of the second corpus, and achieving the purpose of adjusting the second corpus. Therefore, in the subsequent training process of the second translation model, the trained translation model can translate the third corpus into a corpus of the same corpus type as the first corpus, and conform to the corpus expression meaning of the target field.

[0178] Step S108: training a second translation model using the first corpus and the edited corpus as training samples to obtain a target translation model for the target domain.

[0179] Specifically, based on the above-mentioned acquisition of the editing corpus of the second corpus, it is now indicated that the adjustment process of the training samples of the second translation model is completed, that is, the editing corpus and the first corpus can be used to train the second translation model. The second translation model specifically refers to a corpus that can translate the corpus of the corpus type to which the editing corpus belongs into the corpus of the corpus type to which the first corpus belongs. Correspondingly, the target translation model obtained after the training is completed can realize the translation of the corpus in the corpus type to which the editing corpus belongs into the corpus of the corpus type to which the first corpus belongs within the target field; for example, the first corpus is a Chinese corpus, the editing corpus is an English corpus, and the target field is an online sales field. The target translation model finally obtained can translate the English corpus into the Chinese corpus that conforms to the meaning of the corpus in the target field, wherein the second translation model refers to a translation model outside the target field or an initial translation model to be trained, which needs to be trained so that the trained translation model can be applied to the target field.

[0180] Using the above example, after obtaining the English edited corpus Y*_in corresponding to the English corpus Y'_in, the second translation model MT_out{Y->X} is trained based on the Chinese corpus X_in and the English edited corpus Y*_in to obtain the target translation model MT_{in}^{Y->X} that meets the target domain. The target translation model MT_{in}^{Y->X} can be used to translate the English corpus into Chinese corpus, and the translated Chinese corpus meets the meaning of the corpus expression in the target domain.

[0181] Furthermore, if the target domain is the online sales domain, the trained target translation model MT_{in}^{Y->X} matches the online sales domain. Through this model, the English corpus "Baby" can be translated into "commodity", making the trained model more compatible with the target domain.

[0182] In addition, on the basis of completing the training of the second translation model, the first translation model may also be trained to achieve the translation of the corpus of the corpus type to which the first corpus belongs into the corpus of the corpus type to which the third corpus that conforms to the target field belongs. In one or more implementations of this embodiment, the training process of the first translation model is as follows:

[0183] Inputting the third corpus and the fourth corpus into a second corpus editing model to perform corpus editing to obtain an edited corpus of the fourth corpus;

[0184] The first translation model is trained using the edited corpus of the third corpus and the fourth corpus as training samples to obtain a second target translation model of the target domain.

[0185] Specifically, after the third corpus is translated by the second translation model, the fourth corpus is obtained. Furthermore, in order to enable the translation model finally trained to match the target domain, corpus editing is required. The sample for training the first translation model is adjusted through corpus editing, specifically, the corpus corresponding to the training sample is made to represent the meaning of the target domain before and after translation, thereby improving the ability of the first translation model finally trained to match the target domain. Therefore, the third corpus and the fourth corpus are input into the second corpus editing model for corpus editing to obtain the edited corpus of the fourth corpus. The second corpus editing model has a similar structure to the above-mentioned corpus editing model. The process of implementing corpus editing can refer to the above-mentioned corresponding description content. This embodiment will not be described in detail here. It should be noted that the second corpus editing model implements corpus editing of the fourth corpus. The corpus type of the fourth corpus is relative to that of the second corpus. Therefore, the corpus type of the fourth corpus after translation is the same as that of the second corpus.

[0186] Furthermore, this indicates that the adjustment process of the training samples of the first translation model is completed, and the first translation model can be trained using the edited corpus of the fourth corpus and the third corpus to obtain a second target translation model of the target domain. The second target translation model can realize the translation of the corpus of the corpus type to which the first corpus belongs into the corpus of the corpus type to which the third corpus belongs within the target domain; for example, if the first corpus is Chinese, the third corpus is English, and the target domain is the online sales domain, the second target translation model finally obtained can translate the Chinese corpus into English that conforms to the meaning of the corpus within the target domain.

[0187] Continuing with the above example, after obtaining the English corpus Y_in of the target domain, the English corpus Y_in is translated through the translation model MT_out{Y->X} to obtain the Chinese corpus X'_in, and then the English corpus Y_in and the Chinese corpus X'_in are input into the corpus editing model DAPE{X'_in, Y->X} for corpus editing to obtain the Chinese edited corpus X*_in corresponding to the Chinese corpus X'_in. Finally, based on the Chinese edited corpus X*_in and the English corpus Y_in, the first translation model MT_out{X->Y} is trained to obtain the second target translation model MT_{in}^{X->Y} that meets the target domain. The second target translation model MT_{in}^{X->Y} can be used to translate the Chinese corpus into English corpus, and the English corpus obtained after translation meets the meaning of the corpus expression in the target domain.

[0188] Furthermore, before using the second corpus editing model to edit the corpus, the second corpus editing model needs to be trained, so that the second corpus editing model used in the application process can have the purpose of adjusting the training samples for training the first translation model, so that the training samples adjusted by the second corpus editing model are matched with the target domain, so that the corpus adjusted by the second corpus editing model can be used as the training sample of the first translation model, and the subsequent translation model can be trained, so that the trained translation model can be matched with the target domain. Matching specifically means that the translation effect of the trained translation model can make the corpus before and after the translation have the same meaning as the corpus in the target domain. In one or more implementations of this embodiment, the specific implementation method is as follows:

[0189] Inputting the second corpus into the second translation model for translation to obtain a sixth corpus;

[0190] The first corpus, the second corpus and the sixth corpus are used as training samples to train the second corpus editing model to obtain the second corpus editing model.

[0191] In actual applications, the second corpus is input into the second translation model for translation to obtain a sixth corpus; the sixth corpus is of the same corpus type as the first corpus, and then the second corpus editing model to be trained is trained based on the first corpus, the second corpus and the sixth corpus as training samples to obtain the second corpus editing model.

[0192] In specific implementation, during the training of the first translation model, since the first translation model is used to translate the first corpus into the second corpus when training the second translation model, the second corpus can be directly translated into the sixth corpus through the second translation model, thereby saving the process of translating the corpus. That is, in actual applications, two or more translation models can be trained for the target field at the same time, so that the corpus can be used mutually when training other translation models, thereby achieving the purpose of reducing training costs.

[0193] Among them, the training process of the second corpus editing model and the training process of the first translation model can refer to the description content related to the training process of the corpus editing model and the second translation model. This embodiment will not be described in detail here. It should be noted that the first translation model and the second translation model are reverse translation models of each other. Correspondingly, the corpus editing process of the second corpus editing model and the corpus type targeted by the corpus editing process of the corpus editing model are reverse corpora.

[0194] Specifically, the first translation model and / or the second translation model is a translation model of a non-target domain outside the target domain; and, in the case where the first corpus is the source corpus, the second corpus is the target translation corpus, the third corpus is the target corpus, the fourth corpus is the source translation corpus, the fifth corpus is the target secondary translation corpus, and the sixth corpus is the source secondary translation corpus; or, in the case where the first corpus is the target corpus, the second corpus is the source translation corpus, the third corpus is the source corpus, the fourth corpus is the target translation corpus, the fifth corpus is the source secondary translation corpus, and the sixth corpus is the target secondary translation corpus.

[0195] Furthermore, in the process of training the second translation model, it is difficult to obtain a translation model with good translation effect after a small number of trainings, so the second translation model needs to be trained a large number of times to obtain a translation model with a translation effect that meets the target domain. In one or more implementations of this embodiment, in order to obtain a target translation model with good effect, this embodiment trains the second translation model in an iterative manner;

[0196] In the iterative process, the target translation model obtained by training after the previous iteration is used as the second translation model in the next iteration; the second target translation model obtained by training after the previous iteration is used as the first translation model in the next iteration;

[0197] Furthermore, the corpus editing model obtained through training in the previous iteration is used as the corpus editing model in the next iteration; and the second corpus editing model obtained through training in the previous iteration is used as the second corpus editing model in the next iteration.

[0198] In order to obtain a translation model with better translation effect and avoid over-training of the model or training that fails to achieve the expected effect, a translation model with better effect can be obtained by configuring the iteration termination condition. In one or more implementations of this embodiment, the iteration termination condition of the iteration includes:

[0199] The target translation model obtained after training in the previous iteration satisfies the first iteration termination condition compared with the target translation model obtained after training in the previous iteration; and / or, the second target translation model obtained after training in the previous iteration satisfies the second iteration termination condition compared with the second target translation model obtained after training in the previous iteration.

[0200] Specifically, the first iteration termination condition is to detect whether the effect of the target translation model obtained after training is improved; the second iteration termination condition is to detect whether the effect of the second target translation model obtained after training is improved.

[0201] Using the above example, after obtaining the target translation model MT_{in}^{Y->X} and the second target translation model MT_{in}^{X->Y}, the translation effects of the target translation model and the second target translation model may not be very good at this time, so the translation model can be continuously trained in an iterative manner; in the iterative process, the target translation model MT_{in}^{Y->X} replaces the second translation model MT_out{Y->X} used in the next training process, and the second target translation model MT_{in}^{X->Y} replaces the first translation model MT_out{X->Y} used in the next training process, and at the same time, the trained corpus editing model DAPE{Y'_in, X->Y} replaces the corpus editing model used in the next training process, and the trained corpus editing model DAPE{X'_in, Y->X} replaces the corpus editing model used in the next training process, so as to realize the continued training of the target translation model MT_{in}^{Y->X} and the second target translation model MT_{in}^{X->Y};

[0202] After each training is completed, it is necessary to check whether the trained translation model meets the requirements for continued improvement of the translation effect. When it is detected that the translation effect of the trained translation model is no longer improved, the target translation model T-MT_{in}^{Y->X} and the second target translation model T-MT_{in}^{X->Y} trained at this time are used as the final translation models of the target domain. The target translation model T-MT_{in}^{Y->X} can be used to translate any vocabulary in the English corpus into vocabulary in the Chinese corpus that conforms to the target domain, and the second target translation model T-MT_{in}^{X->Y} can be used to translate any vocabulary in the Chinese corpus into vocabulary in the English corpus that conforms to the target domain.

[0203] In summary, by training the translation model in an iterative manner, the translation effect of the translation model can be effectively improved, and the model effect can be tested in combination with the iteration termination condition, so that the translation effect of the final translation model is highly matched with the target domain. During the user's use, the to-be-translated vocabulary submitted by the user can be translated into the target vocabulary that conforms to the target domain, further improving the user experience.

[0204] In actual applications, different cross-border online platforms have different language translation requirements. For platforms with different language translation requirements, it is necessary to train a target translation model that meets the translation requirements to ensure the consistency of meaning before and after language translation. Therefore, the process of applying the target translation model is as follows:

[0205] Selecting a language translation model according to the language type of the browsing user, and determining the text to be translated corresponding to the browsing user;

[0206] The text to be translated is input into the pre-trained language translation model for text translation to obtain a translated text.

[0207] The text to be translated corresponding to the browsing user may be a text input by the user or a text viewed by the user. This embodiment will explain the application of the language translation model based on different translation requirements from three aspects. The specific implementation methods are as follows:

[0208] 1) The online sales platform S serving countries T and M can realize cross-border sales, that is, users in country M can purchase goods from country T on the cross-border sales website corresponding to platform S, thereby realizing users' cross-border purchase needs; since the cross-border sales website is applied to two countries, it is necessary to provide users from different countries with content corresponding to the language of their respective countries for users to browse. Therefore, a Thai-Malay translation model will be trained based on Thai in country T and Malay in country M, so that the Thai in the cross-border sales website can be translated into Malay, and it is in line with the sales field, so that users in country M can purchase goods from country T more conveniently.

[0209] Based on this, when users from country M purchase goods provided by country T through the cross-border sales website, in order to facilitate users from country M to browse the product information, the Thai content involved in the user's browsing page will be translated into Malay through the Thai-Malay translation model and displayed through the browsing page, so that users from country M can view the product information of country T in Malay, which is more convenient for users from country M to purchase goods.

[0210] 2) The online sales platform S serving countries M and N can realize cross-border sales, that is, users in country M can purchase goods from country N on the cross-border sales website corresponding to platform S, and users in country N can purchase goods from country M on the cross-border sales website corresponding to platform S, thereby realizing the cross-border purchasing needs of users in the two countries; and in order to facilitate shopping for users in the above two countries, it will be necessary to build an India-Malaysia translation model and a Malaysia-India translation model based on Indonesian, the language of country N, and Malay, the language of country M, to realize mutual translation of the languages ​​of users in countries M and N, so as to facilitate shopping for users in the two countries.

[0211] Based on this, when users in country N purchase goods provided by country M through the cross-border sales website, in order to facilitate user operations, users can submit purchase needs through voice input. At this time, platform S will convert the user's input voice into Indonesian text corresponding to Indonesian, and then input the Indonesian text into the Indonesian-Malaysian translation model to obtain the Malay text corresponding to the user. Based on the Malay text, products from country M that meet the user's purchase needs are screened out, and the Malay product information related to the products from country M is translated into Indonesian product information through the Malaysia-Indonesia translation model. Finally, the products from country M can be displayed to the user through the display page, so that the products meet the user's purchase needs and are displayed in the Indonesian language familiar to the user, making it more convenient for users to purchase goods across borders.

[0212] 3) The online sales platform S serving countries G and Y can realize cross-border sales, that is, users in country G can purchase goods from country Y on the cross-border sales website corresponding to platform S, thereby realizing the users' needs for cross-border purchase of goods; since the cross-border sales website is applied to two countries, it is necessary to provide users from different countries with content corresponding to the language of their respective countries for users to browse. Therefore, at this time, a Khmer-English translation model and an English-Khmer translation model will be trained based on the Khmer language of country G and the English of country Y, so that the Khmer and English in the cross-border sales website can be translated into each other, so that users from both countries can more conveniently purchase goods across borders.

[0213] Based on this, when a user from country G purchases goods from country Y through a cross-border sales website, in order to facilitate the user's browsing of goods, all the contents of the display page will be displayed to the user in Khmer based on the Khmer language of country G. When the user enters the demand to purchase goods from country Y, the Khmer purchase demand information will be translated into English purchase demand information through the Khmer-English translation model, and goods matching the English purchase demand information will be selected as the goods to be displayed. Since the goods to be displayed are goods from country Y and the related goods information is also English goods information, it is also necessary to translate the English goods information of the goods to be displayed into Khmer goods information through the English-Khmer translation model, and finally display it to the user through the display page, so that the user can purchase goods from country Y according to the purchase demand.

[0214] In addition, in some cross-border platforms that serve many countries, in order to facilitate interaction among users from various countries, a large number of translation models can be trained through the above-mentioned model training method according to all language types involved, so that the languages ​​between countries can be translated into each other, thereby facilitating users from various countries to interact effectively on the cross-border platform and further improving the user experience.

[0215] The first translation model training method provided in this embodiment obtains a first corpus in a target domain and translates the first corpus using a first translation model to obtain a second corpus. At this time, a corpus editing model is introduced, and the first corpus and the second corpus are input into the corpus editing model to obtain an edited corpus of the second corpus. Finally, the edited corpus and the first corpus are used as training samples to train the second translation model to obtain a target translation model in the target domain. The training samples used to train the translation model are corrected in combination with the corpus editing model, thereby achieving the correction of the translation model training samples without manpower, effectively improving the accuracy of the target translation model in translating the target corpus, so that after the trained target translation model translates the corpus in the domain, the translated corpus can be obtained to conform to the target domain.

[0216] The first translation model training device embodiment provided by the present application is as follows:

[0217] Corresponding to the above method embodiment, this specification also provides a first translation model training device embodiment, Figure 4 FIG. 1 shows a schematic diagram of the structure of a first translation model training device provided in an embodiment of this specification. Figure 4 As shown, the device comprises:

[0218] An acquisition module 402 is configured to acquire a first corpus in a target domain;

[0219] A translation module 404 is configured to translate the first corpus using a first translation model to obtain a second corpus;

[0220] An editing module 406 is configured to input the first corpus and the second corpus into a corpus editing model, perform corpus editing, and obtain an edited corpus of the second corpus;

[0221] The training module 408 is configured to train the second translation model using the first corpus and the edited corpus as training samples to obtain a target translation model for the target domain.

[0222] In an optional embodiment, the second translation model and the first translation model are reverse translation models.

[0223] In an optional embodiment, the corpus editing model is trained in the following manner:

[0224] Acquire a third corpus in the target domain; the third corpus and the first corpus are target corpus and source corpus respectively;

[0225] Translating the third corpus using the second translation model to obtain a fourth corpus;

[0226] Using the first translation model to translate the fourth corpus to obtain a fifth corpus;

[0227] The first corpus editing model to be trained is trained using the third corpus, the fourth corpus and the fifth corpus as training samples to obtain the corpus editing model.

[0228] In an optional embodiment, the translation model training device further includes:

[0229] a corpus editing module, configured to input the third corpus and the fourth corpus into a second corpus editing model, perform corpus editing, and obtain an edited corpus of the fourth corpus;

[0230] The translation model training module is configured to train the first translation model using the edited corpus of the third corpus and the fourth corpus as training samples to obtain a second target translation model of the target domain.

[0231] In an optional embodiment, the second corpus editing model is trained in the following manner:

[0232] Inputting the second corpus into the second translation model for translation to obtain a sixth corpus;

[0233] The first corpus, the second corpus and the sixth corpus are used as training samples to train the second corpus editing model to obtain the second corpus editing model.

[0234] In an optional embodiment, the translation model training method is performed in an iterative manner;

[0235] Wherein, during the iteration process, the target translation model obtained by training after the previous iteration is used as the second translation model in the next iteration process;

[0236] The second target translation model obtained by training after the previous iteration is used as the first translation model in the next iteration.

[0237] In an optional embodiment, during the iteration process,

[0238] The corpus editing model obtained by training after the previous iteration is used as the corpus editing model in the next iteration;

[0239] The second corpus editing model obtained by training after the previous iteration is used as the second corpus editing model in the next iteration.

[0240] In an optional embodiment, the iteration termination condition of the iteration includes:

[0241] The target translation model obtained by training after the previous iteration execution satisfies the first iteration termination condition compared with the target translation model obtained by training after the previous iteration execution;

[0242] and / or,

[0243] The second target translation model obtained by training after the previous iteration execution satisfies the second iteration termination condition compared with the second target translation model obtained by training after the previous iteration execution.

[0244] In an optional embodiment, the editing module 406 includes:

[0245] a vectorization processing unit, configured to perform vectorization processing on the first corpus and the second corpus to obtain a first word vector for the first corpus and a second word vector for the second corpus;

[0246] The encoding unit is configured to encode the first word vector into a first encoding vector by a first encoding unit included in the corpus editing model, and to encode the second word vector into a second encoding vector by a second encoding unit included in the corpus editing model;

[0247] The decoding unit is configured to decode the first encoding vector and the second encoding vector by the decoding unit included in the corpus editing model to obtain the editing corpus.

[0248] In an optional embodiment, the first translation model and / or the second translation model is a translation model of a non-target domain other than the target domain.

[0249] In an optional embodiment, the first corpus is a source corpus, and the second corpus is a target translation corpus.

[0250] The third corpus is the target corpus, the fourth corpus is the source translation corpus,

[0251] The fifth corpus is the target secondary translation corpus, and the sixth corpus is the source secondary translation corpus;

[0252] or,

[0253] The first corpus is the target corpus, the second corpus is the source translation corpus,

[0254] The third corpus is a source corpus, the fourth corpus is a target translation corpus,

[0255] The fifth corpus is a source secondary translation corpus, and the sixth corpus is a target secondary translation corpus.

[0256] The first translation model training device provided in this embodiment obtains a first corpus in a target domain and translates the first corpus using a first translation model to obtain a second corpus. At this time, a corpus editing model is introduced, and the first corpus and the second corpus are input into the corpus editing model to obtain an edited corpus of the second corpus. Finally, the edited corpus and the first corpus are used as training samples to train the second translation model to obtain a target translation model in the target domain. The training samples used to train the translation model are corrected in combination with the corpus editing model, thereby achieving the correction of the translation model training samples without the need for manpower, effectively improving the accuracy of the target translation model in translating the target corpus, so that after the trained target translation model translates the corpus in the domain, the translated corpus can be obtained to conform to the target domain.

[0257] The above is a schematic scheme of the first translation model training device of this embodiment. It should be noted that the technical scheme of the translation model training device and the technical scheme of the first translation model training method mentioned above belong to the same concept, and the details not described in detail in the technical scheme of the translation model training device can be referred to the description of the technical scheme of the first translation model training method mentioned above.

[0258] The second translation model training method embodiment provided in this application is as follows:

[0259] Figure 5 A flowchart of a second translation model training method provided according to an embodiment of this specification is shown. Figure 6 A schematic diagram of a second translation model training method provided according to an embodiment of this specification is shown; wherein Figure 5 The specific steps include:

[0260] Step S502: Obtain the first corpus and the second corpus.

[0261] In actual applications, when using a translation model outside the target domain to translate the original corpus in the target domain, the problem of the translated target corpus expressing a different meaning from the original corpus may occur. If you want to achieve that the translated target corpus after the translation model has the same meaning as the original corpus in the target domain, you need to train a specific translation model for the target domain. The way to train a translation model is usually to manually annotate the training samples. In this process, a lot of manpower and material resources will be consumed to train a translation model that meets the target domain.

[0262] The second translation model training method provided in an embodiment of the present specification saves manpower and material resources while speeding up the efficiency of training the translation model of the target field. After obtaining the first corpus and the second corpus, the first translation model and the second translation model are used to translate the first corpus and the second corpus to obtain the third corpus and the fourth corpus, and then the first corpus editing model is introduced to perform corpus editing on the first corpus and the third corpus obtained after the translation, and the second corpus editing model is introduced to perform corpus editing on the second corpus and the fourth corpus obtained after the translation to obtain the first edited corpus and the second edited corpus, and finally the first corpus and the first edited corpus are used as samples to train the second translation model. The first translation model is trained by taking the second corpus and the second edited corpus as samples to obtain the second target translation model and the first target translation model; the training samples for training the first translation model and the second translation model are corrected by introducing the first corpus editing model and the second corpus editing model, thereby achieving the correction of training samples without manpower, and being more efficient than manual labeling, which can not only speed up the training of translation models that meet the target field, but also effectively improve the translation accuracy of translation models in the target field; by training the two translation models at the same time, the training cost can be saved while further improving the efficiency of model training.

[0263] In a specific implementation, the first corpus and the second corpus are two corpora in the same field, and the first corpus and the second corpus are each other's source corpus and target corpus. For the relevant contents about the field, source corpus and target corpus, please refer to the contents described in the above embodiment, and this embodiment will not be elaborated in detail here. It should be noted that the first corpus, the second corpus, the third corpus and the fourth corpus in this embodiment have no corresponding relationship with the first corpus, the second corpus, the third corpus and the fourth corpus in the above embodiment; and the first corpus and the second corpus involved in this embodiment have no corresponding relationship.

[0264] Based on this, this embodiment will describe the second translation model training method with the first corpus being English corpus and the second corpus being Chinese corpus, so that the first target translation model finally trained can translate English corpus into Chinese corpus, and the second target translation model can translate Chinese corpus into English corpus.

[0265] In addition, the translation model involved in this embodiment can be a model of any structure, such as a translation model based on a convolutional neural network or a translation model based on a recurrent neural network. No matter what kind of network the structure of the translation model is, the translation model training method provided in this embodiment can be used to train the translation model into a target translation model, which has the effect of satisfying the corresponding fields after translating the first corpus and the second corpus.

[0266] Step S504: using a first translation model to translate the first corpus into a third corpus, and using a second translation model to translate the second corpus into a fourth corpus.

[0267] Specifically, based on the acquisition of the first corpus and the second corpus, it is indicated that the first translation model and the second translation model need to be trained so that the trained translation model can translate the corpus into a translation corpus with the same meaning in the field to which the first corpus and the second corpus belong. Furthermore, the first translation model is used to translate the first corpus to obtain a third corpus, and the second translation model is used to translate the second corpus to obtain a fourth corpus; wherein the corpus type of the third corpus is the same as the corpus type of the second corpus, which is the first corpus type; the corpus type of the fourth corpus is the same as the corpus type of the first corpus, which is the second corpus type;

[0268] Based on this, the translation effect of the first translation model is to translate the corpus from the second corpus type to the first corpus type, and the translation effect of the second translation model is to translate the corpus from the first corpus type to the second corpus type, and the first translation model and the second translation model are translation models outside the fields to which the first corpus and the second corpus belong or initial translation models to be trained, and both need to be trained so that after the two translation models are trained, they can be applied to the fields to which the first corpus and the second corpus belong.

[0269] Still taking the first corpus as the English corpus and the second corpus as the Chinese corpus, the process of obtaining the third corpus and the fourth corpus is described; first, the English corpus Y_in and the Chinese corpus X_in are obtained, and then the English corpus Y_in is input into the first translation model MT_out{Y->X} for translation to obtain the Chinese corpus X'_in, and at the same time, the Chinese corpus X_in is input into the second translation model MT_out{X->Y} for translation to obtain the English corpus Y'_in, wherein Y'_in represents the reverse pseudo corpus obtained after the Chinese corpus X_in is translated, and X'_in represents the reverse pseudo corpus obtained after the English corpus Y_in is translated, and then used for the subsequent training of the two translation models.

[0270] Step S506: input the first corpus and the third corpus into a first corpus editing model for corpus editing to obtain a first edited corpus, and input the second corpus and the fourth corpus into a second corpus editing model for corpus editing to obtain a second edited corpus.

[0271] Specifically, based on the third and fourth corpora obtained by translating the first corpus and the second corpus using the first translation model and the second translation model, further, in order to enable the final trained translation model to have a better translation effect, corpus editing is required. The samples of the training translation model are adjusted through corpus editing, which specifically refers to making the corpus corresponding to the training sample represent the meaning of the field to which it belongs before and after translation, so that the final trained translation model can match the field to which the first corpus and the second corpus belong; therefore, the first corpus and the third corpus are input into the first corpus editing model for corpus editing to obtain the first edited corpus, and the second corpus and the fourth corpus are input into the second corpus editing model for corpus editing to obtain the second edited corpus.

[0272] In practical applications, the first corpus editing model and the second corpus editing model will be constructed based on the Domain Adaptation with Prototype Editing (DAPE) method. By training the first corpus editing model and the second corpus editing model, reverse pseudo corpus (third corpus) is input into the first corpus editing model, and its source end (first corpus) is modified, so as to avoid the problem of low translation accuracy of the trained second target translation model. At the same time, reverse pseudo corpus (fourth corpus) is input into the second corpus editing model, and its source end (second corpus) is modified, so as to avoid the problem of low translation accuracy of the trained first target translation model, and further improve the translation accuracy of the first target translation model and the second target translation model.

[0273] Furthermore, the first corpus editing model and the second corpus editing model are a dual-source input sequence-to-sequence model, each having two encoders and a decoder. During the use of the first corpus editing model, the first corpus and the third corpus are input into the encoder for encoding, and the encoding result is then input into the decoder to obtain the first edited corpus. The structures of the first corpus editing model and the second corpus editing model can be found in Figure 3 In one or more implementations of this embodiment, the corpus editing process of the first corpus editing model is as follows:

[0274] Performing vectorization processing on the first corpus and the third corpus to obtain a first word vector of the first corpus and a third word vector of the third corpus;

[0275] The first encoding unit included in the first corpus editing model encodes the first word vector into a first encoding vector, and the second encoding unit included in the first corpus editing model encodes the third word vector into a third encoding vector;

[0276] The first encoding vector and the third encoding vector are decoded by a decoding unit included in the first corpus editing model to obtain the first edited corpus.

[0277] In practical applications, before performing corpus editing through the first corpus editing model, it is first necessary to vectorize the first corpus and the third corpus to obtain a first word vector and a third word vector. Secondly, the corpus editing model is used to edit the corpus. The specific process includes: encoding the first word vector and the third word vector by the first encoding unit and the second encoding unit included in the first corpus editing model to obtain a first encoding vector and a third encoding vector. Finally, the decoding unit included in the first corpus editing model decodes the first encoding vector and the third encoding vector to obtain the first edited corpus.

[0278] Using the above example, after the English corpus Y_in is translated into the Chinese corpus X'_in (third corpus) by the first translation model MT_out{Y->X}, the English corpus Y_in and the Chinese corpus X'_in are input into the first corpus editing model DAPE{X'_in, Y->X} for corpus editing. The corpus editing process of the first corpus editing model DAPE{X'_in, Y->X} specifically refers to: firstly, the English corpus Y_in and the Chinese corpus X'_in are vectorized to obtain the first English word vector (first word vector) and the first Chinese word vector (third word vector), then the first encoding unit and the second encoding unit in the first corpus editing model DAPE{X'_in, Y->X} encode the first English word vector and the first Chinese word vector to obtain the first English encoding vector (first encoding vector) and the first Chinese encoding vector (third encoding vector), finally, the first English encoding vector and the first Chinese encoding vector are decoded by the decoding unit in the first corpus editing model DAPE{X'_in, Y->X} to obtain the Chinese edited corpus X*_in for subsequent training of the second translation model.

[0279] Furthermore, before using the first corpus editing model to edit corpus, the first corpus editing model needs to be trained, so that the first corpus editing model used in the application process can have the purpose of adjusting the training samples for training the second translation model, so that the training samples adjusted by the first corpus editing model match the field to which the first corpus belongs. In one or more implementations of this embodiment, the specific implementation method is as follows:

[0280] Using the first translation model to translate the fourth corpus to obtain a fifth corpus;

[0281] The first corpus editing model to be trained is trained using the second corpus, the fourth corpus and the fifth corpus as training samples to obtain the first corpus editing model.

[0282] In practical applications, the fourth corpus is translated using the first translation model to obtain a fifth corpus, and the fifth corpus has the same corpus type as the second corpus; then, based on the second corpus, the fourth corpus and the fifth corpus as training samples, the first corpus editing model to be trained is trained to obtain the first corpus editing model.

[0283] See also Figure 6 As shown in the middle figure (a), on the basis of translating the Chinese corpus X_in into the English corpus Y'_in (the fourth corpus) by using the second translation model MT_out{X->Y}, the first translation model MT_out{Y->X} is further used to translate the English corpus Y'_in (the fourth corpus) to obtain the Chinese corpus X"_in (the fifth corpus), wherein the Chinese corpus X"_in represents the round-trip corpus obtained after the English corpus Y'_in is translated; then based on the Chinese corpus X"_ in, English corpus Y'_in and Chinese corpus X_in train the first corpus editing model DAPE{X', Y->X} to be trained, and the first corpus editing model DAPE{X'_in, Y->X} can be obtained, so that the corresponding Chinese edited corpus X*_in can be determined through the Chinese corpus X'_in, wherein the Chinese edited corpus X*_in represents the reverse pseudo corpus obtained after the Chinese corpus X'_in is edited, so as to achieve the purpose of adjusting the training samples of the second translation model MT_out{X->Y}.

[0284] Furthermore, during the use of the second corpus editing model, the second corpus and the fourth corpus are input into an encoder for encoding, and the encoding result is input into a decoder to obtain the second edited corpus. In one or more implementations of this embodiment, the corpus editing process of the second corpus editing model is as follows:

[0285] Performing vectorization processing on the second corpus and the fourth corpus to obtain a second word vector of the fourth corpus and a fourth word vector of the fourth corpus;

[0286] The first encoding unit included in the second corpus editing model encodes the second word vector into a second encoding vector, and the second encoding unit included in the second corpus editing model encodes the fourth word vector into a fourth encoding vector;

[0287] The second encoding vector and the fourth encoding vector are decoded by a decoding unit included in the second corpus editing model to obtain the second edited corpus.

[0288] In actual applications, before the corpus is edited through the second corpus editing model, it is first necessary to vectorize the second corpus and the fourth corpus to obtain the second word vector and the fourth word vector. Secondly, the corpus is edited by the second corpus editing model. The specific process includes: the first encoding unit and the second encoding unit included in the second corpus editing model encode the second word vector and the fourth word vector to obtain the second encoding vector and the fourth encoding vector. Finally, the decoding unit included in the second corpus editing model decodes the second encoding vector and the fourth encoding vector to obtain the second edited corpus.

[0289] Using the above example, after the Chinese corpus X_in is translated into the English corpus Y'_in (the fourth corpus) by the second translation model MT_out{X->Y}, the Chinese corpus X_in and the English corpus Y'_in are input into the second corpus editing model DAPE{Y'_in, X->Y} for corpus editing. The corpus editing process of the second corpus editing model DAPE{Y'_in, X->Y} specifically refers to: first, the Chinese corpus X_in and the English corpus Y'_in are vectorized to obtain the second Chinese word vector (the second word vector) and the second English word vector (fourth word vector), then the first encoding unit and the second encoding unit in the second corpus editing model DAPE{Y'_in, X->Y} encode the second Chinese word vector and the second English word vector to obtain the second Chinese encoding vector (second encoding vector) and the second English encoding vector (fourth encoding vector), finally, the second Chinese encoding vector and the second English encoding vector are decoded by the decoding unit in the second corpus editing model DAPE{Y'_in, X->Y} to obtain the English edited corpus Y*_in for subsequent training of the first translation model.

[0290] Furthermore, before using the second corpus editing model to edit corpus, the second corpus editing model needs to be trained, so that the second corpus editing model used in the application process can have the purpose of adjusting the training samples for training the first translation model, so that the training samples adjusted by the second corpus editing model match the field to which the second corpus belongs. In one or more implementations of this embodiment, the specific implementation method is as follows:

[0291] Inputting the third corpus into the second translation model for translation to obtain a sixth corpus;

[0292] The second corpus editing model to be trained is trained with the first corpus, the third corpus and the sixth corpus as training samples to obtain the second corpus editing model.

[0293] In actual applications, the third corpus is input into the second translation model for translation to obtain a sixth corpus; the sixth corpus has the same corpus type as the first corpus, and then the second corpus editing model to be trained is trained based on the first corpus, the third corpus and the sixth corpus as training samples to obtain the second corpus editing model.

[0294] Continuing with the above example, the Chinese corpus X'_in (the third corpus) is translated using the second translation model MT_out{X->Y} to obtain the English corpus Y"_in (the sixth corpus), wherein the English corpus Y"_in represents the round-trip corpus obtained after the Chinese corpus X'_in is translated; then the second corpus editing model DAPE{Y', X->Y} to be trained is trained based on the English corpus Y"_in, the Chinese corpus X'_in and the English corpus Y_in to obtain the second corpus editing model DAPE{Y'_in, X->Y}, so as to determine the corresponding English edited corpus Y*_in through the English corpus Y'_in, wherein the English edited corpus Y*_in represents the reverse pseudo corpus obtained after the English corpus Y'_in is edited, thereby achieving the purpose of adjusting the training samples of the first translation model MT_out{Y->X}.

[0295] In summary, by training the first corpus editing model and the second corpus editing model, a model for corpus editing the third corpus and the fourth corpus is obtained, and the purpose of adjusting the third corpus and the fourth corpus can be achieved, so that in the subsequent training process of the second translation model and the first translation model, the trained first translation model can translate the first corpus into a corpus of the same corpus type as the second corpus, and the second translation model can translate the second corpus into a corpus of the same corpus type as the first corpus, and the corpus expression meaning is consistent with the fields to which the first corpus and the second corpus belong.

[0296] Step S508: Using the first corpus and the first edited corpus as training samples, the second translation model is trained as a second target translation model, and using the second corpus and the second edited corpus as training samples, the first translation model is trained as a first target translation model.

[0297] Specifically, based on the above-mentioned acquisition of the first edited corpus and the second edited corpus, it is now indicated that the adjustment process of the training samples of the second translation model and the first translation model is completed, that is, the first edited corpus and the first corpus can be used to train the second translation model, and the second edited corpus and the second corpus can be used to train the first translation model, the second translation model specifically refers to a corpus that can translate the corpus type to which the first edited corpus belongs into the corpus type to which the first corpus belongs, and the first translation model specifically refers to a corpus that can translate the corpus type to which the second edited corpus belongs into the corpus type to which the second corpus belongs;

[0298] Based on this, the second target translation model that has been trained can realize that the corpus in the corpus type to which the first edited corpus belongs can be translated into the corpus of the corpus type to which the first corpus belongs; for example, the first corpus is an English corpus, and the first edited corpus is a Chinese corpus, and the second target translation model finally obtained can translate the Chinese corpus into the English corpus corresponding to the first corpus; the first target translation model that has been trained can realize that the corpus in the corpus type to which the second edited corpus belongs can be translated into the corpus of the corpus type to which the second corpus belongs; for example, the second corpus is a Chinese corpus, and the second edited corpus is an English corpus, and the first target translation model finally obtained can translate the English corpus into the English corpus corresponding to the second corpus; wherein, the second translation model and the first translation model are reverse translation models to each other; then the second target translation model that has been trained and the first target translation model are also reverse translation models to each other.

[0299] In practical applications, since the first corpus and the second corpus belong to the same field, the second target translation model and the first target translation model that are finally trained both match the field, so that the corpus translated by the second target translation model corresponds to the corpus translated by the first target translation model, and have a reverse translation relationship.

[0300] See also Figure 6 As shown in the middle figure (b), after obtaining the Chinese edited corpus X*_in and the English edited corpus Y*_in, the second translation model MT_out{X->Y} is trained based on the English corpus Y_in and the Chinese edited corpus X*_in to obtain the second target translation model MT_{in}^{X->Y}. The second target translation model MT_{in}^{X->Y} can be used to translate the Chinese corpus into English corpus, and the English corpus obtained after translation conforms to the corpus expression meaning of the field to which the Chinese corpus belongs before translation;

[0301] By training the first translation model MT_out{Y->X} based on the Chinese corpus X_in and the English edited corpus Y*_in, the first target translation model MT_{in}^{Y->X} can be obtained. The first target translation model MT_{in}^{Y->X} can be used to translate the English corpus into Chinese corpus, and the Chinese corpus obtained after translation conforms to the corpus expression meaning in the field to which the English corpus belongs before translation.

[0302] In a specific implementation, the first corpus and the second corpus are corpora of a target domain, and the first translation model and / or the second translation model are translation models of a non-target domain other than the target domain; accordingly, the first corpus is a source corpus, the second corpus is a target corpus, the third corpus is a target translation corpus, and the fourth corpus is a source translation corpus; or, the first corpus is a target corpus, the second corpus is a source corpus, the third corpus is a source translation corpus, and the fourth corpus is a target translation corpus.

[0303] In summary, during the process of translating corpus, the trained first target translation model and the second target translation model can make the corpus obtained before and after translation belong to the same field, thereby ensuring that the first target translation model and the second target translation model are applicable to the same field, further improving the translation accuracy of the first target translation model and the second target translation model in the target field.

[0304] Furthermore, in the process of training the second translation model and the first translation model, it is difficult to obtain a translation model with good translation effect after a small number of trainings, so the second translation model and the first translation model need to be trained a large number of times to obtain a translation model with good translation effect. In one or more implementations of this embodiment, in order to obtain a translation model with good effect, this embodiment trains the second translation model and the first translation model in an iterative manner;

[0305] Among them, during the iteration process, the second target translation model obtained after training in the previous iteration is used as the second translation model in the next iteration process; the first target translation model obtained after training in the previous iteration is used as the first translation model in the next iteration process.

[0306] Furthermore, the first corpus editing model obtained through training after the previous iteration is used as the first corpus editing model in the next iteration; and the second corpus editing model obtained through training after the previous iteration is used as the second corpus editing model in the next iteration.

[0307] In order to obtain a translation model with better translation effect and avoid over-training of the model or training that fails to achieve the expected effect, a translation model with better effect can be obtained by configuring the iteration termination condition. In one or more implementations of this embodiment, the iteration termination condition of the iteration includes:

[0308] The first target translation model obtained after training in the previous iteration satisfies the first iteration termination condition compared with the first target translation model obtained after training in the previous iteration; and / or the second target translation model obtained after training in the previous iteration satisfies the second iteration termination condition compared with the second target translation model obtained after training in the previous iteration.

[0309] Using the above example, after obtaining the second target translation model MT_{in}^{X->Y} and the first target translation model MT_{in}^{Y->X}, the translation effects of the second target translation model and the first target translation model may not be very good at this time, so the translation model can be continuously trained in an iterative manner; in the iterative process, the second target translation model MT_{in}^{X->Y} replaces the second translation model MT_out{X->Y} used in the next training process, and the first target translation model MT_{in}^{Y->X} replaces the first translation model MT_out{Y->X} used in the next training process, and the first target translation model MT_{in}^{Y->X} replaces the first translation model MT_out{Y->X} used in the next training process, and at the same time, the trained first corpus editing model replaces the first corpus editing model used in the next training process, and the trained second corpus editing model replaces the second corpus editing model used in the next training process, so as to realize the continued training of the second target translation model MT_{in}^{X->Y} and the first target translation model MT_{in}^{Y->X};

[0310] After each training is completed, it is necessary to detect whether the trained translation model meets the requirements for continued improvement of the translation effect. When it is detected that the translation effect of the trained translation model is no longer improved, the second target translation model T-MT_{in}^{X->Y} and the first target translation model T-MT_{in}^{Y->X} trained at this time are used as the final translation models of the target domain. The second target translation model T-MT_{in}^{X->Y} can be used to translate the vocabulary in the Chinese corpus into the vocabulary in the English corpus that conforms to the target domain, and the first target translation model T-MT_{in}^{Y->X} can be used to translate the vocabulary in the English corpus into the vocabulary in the Chinese corpus that conforms to the target domain.

[0311] In summary, by training the translation model in an iterative manner, the translation effect of the translation model can be effectively improved, and the model effect can be tested in combination with the iteration termination condition, so that the translation effect of the final translation model is highly matched with the target domain. During the user's use, the to-be-translated vocabulary submitted by the user can be translated into the target vocabulary that conforms to the target domain, further improving the user experience.

[0312] In actual applications, different cross-border online platforms have different language translation requirements. For platforms with different language translation requirements, it is necessary to train a target translation model that meets the translation requirements to ensure the consistency of meaning before and after language translation. Therefore, the process of applying the target translation model is as follows:

[0313] Selecting a language translation model according to the language type of the browsing user, and determining the text to be translated corresponding to the browsing user;

[0314] The text to be translated is input into the pre-trained language translation model for text translation to obtain a translated text.

[0315] This embodiment will illustrate the application of the language translation model based on different translation requirements from two aspects, and the specific implementation method is as follows:

[0316] 1) The online sales platform S serving countries M and N can realize cross-border sales, that is, users in country M can purchase goods from country N on the cross-border sales website corresponding to platform S, and users in country N can purchase goods from country M on the cross-border sales website corresponding to platform S, thereby realizing the cross-border purchasing needs of users in the two countries; and in order to facilitate shopping for users in the above two countries, it is necessary to build an Indonesian-Malaysian translation model and a Malay-India translation model based on Indonesian, the language of country N, and Malay, the language of country M, to realize mutual translation of the languages ​​of users in countries M and N, so as to facilitate shopping for users in the two countries.

[0317] Based on this, when users in country N purchase goods provided by country M through the cross-border sales website, in order to facilitate user operations, users can submit purchase needs through voice input. At this time, platform S will convert the user's input voice into Indonesian text corresponding to Indonesian, and then input the Indonesian text into the Indonesian-Malaysian translation model to obtain the Malay text corresponding to the user. Based on the Malay text, products from country M that meet the user's purchase needs are screened out, and the Malay product information related to the products from country M is translated into Indonesian product information through the Malaysia-Indonesia translation model. Finally, the products from country M can be displayed to the user through the display page, so that the products meet the user's purchase needs and are displayed in the Indonesian language familiar to the user, making it more convenient for users to purchase goods across borders.

[0318] 2) The online sales platform S serving countries G and Y can realize cross-border sales, that is, users in country G can purchase goods from country Y on the cross-border sales website corresponding to platform S, thereby realizing the users' needs for cross-border purchase of goods; since the cross-border sales website is applied to two countries, it is necessary to provide users from different countries with content corresponding to the language of their respective countries for users to browse. Therefore, at this time, a Khmer-English translation model and an English-Khmer translation model will be trained based on the Khmer language of country G and the English of country Y, so that the Khmer and English in the cross-border sales website can be translated into each other, so that users from both countries can more conveniently purchase goods across borders.

[0319] Based on this, when a user from country G purchases goods from country Y through a cross-border sales website, in order to facilitate the user's browsing of goods, all the contents of the display page will be displayed to the user in Khmer based on the Khmer language of country G. When the user enters the demand to purchase goods from country Y, the Khmer purchase demand information will be translated into English purchase demand information through the Khmer-English translation model, and goods matching the English purchase demand information will be selected as the goods to be displayed. Since the goods to be displayed are goods from country Y and the related goods information is also English goods information, it is also necessary to translate the English goods information of the goods to be displayed into Khmer goods information through the English-Khmer translation model, and finally display it to the user through the display page, so that the user can purchase goods from country Y according to the purchase demand.

[0320] In addition, in some cross-border platforms that serve many countries, in order to facilitate interaction among users from various countries, a large number of translation models for mutual translation can be trained through the above-mentioned model training method based on all language types involved, so that the languages ​​of various countries can be translated into each other, thereby facilitating effective interaction among users from various countries on the cross-border platform and further improving the user experience.

[0321] A second translation model training method provided in an embodiment of the present specification obtains a first corpus and a second corpus, and then uses a first translation model and a second translation model to translate the first corpus and the second corpus to obtain a third corpus and a fourth corpus, and then introduces a first corpus editing model to perform corpus editing on the first corpus and the third corpus obtained after translation, and at the same time introduces a second corpus editing model to perform corpus editing on the second corpus and the fourth corpus obtained after translation, to obtain a first edited corpus and a second edited corpus, and finally uses the first corpus and the first edited corpus as samples to train the second translation model, and uses the second corpus and the second edited corpus as samples. Samples are used to train the first translation model, and the second target translation model and the first target translation model are obtained. The training samples for training the first translation model and the second translation model are corrected by introducing the first corpus editing model and the second corpus editing model, so that the correction of training samples can be completed without borrowing manpower, and the efficiency is faster than that of manual labeling. It can not only speed up the training of translation models that meet the target field, but also effectively improve the translation accuracy of translation models in the target field. By training the two translation models at the same time, the training cost can be saved and the efficiency of model training can be further improved.

[0322] The second translation model training device embodiment provided by the present application is as follows:

[0323] Corresponding to the above method embodiment, this specification also provides a second translation model training device embodiment, Figure 7 FIG. 2 shows a schematic diagram of the structure of a second translation model training device provided in an embodiment of this specification. Figure 7 As shown, the device comprises:

[0324] An acquisition module 702 is configured to acquire a first corpus and a second corpus;

[0325] A translation module 704 is configured to translate the first corpus into a third corpus using a first translation model, and to translate the second corpus into a fourth corpus using a second translation model;

[0326] The editing module 706 is configured to input the first corpus and the third corpus into a first corpus editing model for corpus editing to obtain a first edited corpus, and input the second corpus and the fourth corpus into a second corpus editing model for corpus editing to obtain a second edited corpus;

[0327] The training module 708 is configured to train the second translation model into a second target translation model using the first corpus and the first edited corpus as training samples, and to train the first translation model into a first target translation model using the second corpus and the second edited corpus as training samples.

[0328] In an optional embodiment, the second translation model and the first translation model are reverse translation models;

[0329] and / or,

[0330] The first corpus and the second corpus are source corpus and target corpus for each other.

[0331] In an optional embodiment, the first corpus editing model is trained in the following manner:

[0332] Using the first translation model to translate the fourth corpus to obtain a fifth corpus;

[0333] The first corpus editing model to be trained is trained using the second corpus, the fourth corpus and the fifth corpus as training samples to obtain the first corpus editing model.

[0334] In an optional embodiment, the second corpus editing model is trained in the following manner:

[0335] Inputting the third corpus into the second translation model for translation to obtain a sixth corpus;

[0336] The second corpus editing model to be trained is trained with the first corpus, the third corpus and the sixth corpus as training samples to obtain the second corpus editing model.

[0337] In an optional embodiment, the translation model training method is performed in an iterative manner;

[0338] Wherein, during the iteration process, the second target translation model obtained by training after the previous iteration is used as the second translation model in the next iteration process;

[0339] The first target translation model obtained by training after the previous iteration is used as the first translation model in the next iteration.

[0340] In an optional embodiment, during the iteration process,

[0341] Using the first corpus editing model obtained by training after the previous iteration as the first corpus editing model in the next iteration;

[0342] The second corpus editing model obtained by training after the previous iteration is used as the second corpus editing model in the next iteration.

[0343] In an optional embodiment, the iteration termination condition of the iteration includes:

[0344] The first target translation model obtained by training after the previous iteration execution satisfies the first iteration termination condition compared with the first target translation model obtained by training after the previous iteration execution;

[0345] and / or,

[0346] The second target translation model obtained by training after the previous iteration execution satisfies the second iteration termination condition compared with the second target translation model obtained by training after the previous iteration execution.

[0347] In an optional embodiment, the editing module 706 includes:

[0348] A first vectorization processing unit is configured to perform vectorization processing on the first corpus and the third corpus to obtain a first word vector of the first corpus and a third word vector of the third corpus;

[0349] A first encoding unit is configured to encode the first word vector into a first encoding vector by the first encoding unit included in the first corpus editing model, and to encode the third word vector into a third encoding vector by the second encoding unit included in the first corpus editing model;

[0350] The first decoding unit is configured to decode the first encoding vector and the third encoding vector by the decoding unit included in the first corpus editing model to obtain the first editing corpus.

[0351] In an optional embodiment, the editing module 706 includes:

[0352] A second vectorization processing unit is configured to perform vectorization processing on the second corpus and the fourth corpus to obtain a second word vector of the fourth corpus and a fourth word vector of the fourth corpus;

[0353] A second encoding unit is configured to encode the second word vector into a second encoding vector by the first encoding unit included in the second corpus editing model, and to encode the fourth word vector into a fourth encoding vector by the second encoding unit included in the second corpus editing model;

[0354] The second decoding unit is configured to decode the second encoding vector and the fourth encoding vector by the decoding unit included in the second corpus editing model to obtain the second editing corpus.

[0355] In an optional embodiment, the first corpus and the second corpus are corpora of a target domain, and the first translation model and / or the second translation model are translation models of a non-target domain other than the target domain.

[0356] In an optional embodiment, the first corpus is a source corpus, and the second corpus is a target corpus.

[0357] The third corpus is the target translation corpus, and the fourth corpus is the source translation corpus;

[0358] or,

[0359] The first corpus is the target corpus, the second corpus is the source corpus,

[0360] The third corpus is a source translation corpus, and the fourth corpus is a target translation corpus.

[0361] The second translation model training device provided in the present embodiment obtains a first corpus and a second corpus, and then uses the first translation model and the second translation model to translate the first corpus and the second corpus to obtain a third corpus and a fourth corpus, then introduces the first corpus editing model to perform corpus editing on the first corpus and the third corpus obtained after its translation, and introduces the second corpus editing model to perform corpus editing on the second corpus and the fourth corpus obtained after its translation to obtain a first edited corpus and a second edited corpus, and finally uses the first corpus and the first edited corpus as samples to train the second translation model, and uses the second corpus and the second edited corpus as samples to train the first translation model to obtain the second target translation model and the first target translation model, and introduces the first corpus editing model and the second corpus editing model to correct the training samples for training the first translation model and the second translation model, so that the correction of the training samples can be completed without borrowing manpower, and the efficiency is faster than that of manual annotation, which can not only speed up the training of the translation model that meets the target field, but also effectively improve the translation accuracy of the translation model in the target field, and by training the two translation models at the same time, it can save training costs and further improve the efficiency of model training.

[0362] The above is a schematic scheme of the second translation model training device of this embodiment. It should be noted that the technical scheme of the translation model training device and the technical scheme of the second translation model training method described above belong to the same concept, and the details not described in detail in the technical scheme of the translation model training device can be found in the description of the technical scheme of the second translation model training method described above.

[0363] The third translation model training method embodiment provided in this application is as follows:

[0364] Figure 8 A flowchart of a third translation model training method provided according to an embodiment of this specification is shown, which specifically includes the following steps:

[0365] Step S802: Acquire multiple corpora that are source corpora and target corpora.

[0366] The second translation model training method provided in an embodiment of the present specification is to effectively improve the translation accuracy of translating corpora by obtaining multiple corpora that are target corpora that are mutually source corpora, using multiple translation models to translate and process them to obtain multiple translated corpora, and then introducing a corpus editing model to edit and process the corpus pairs that are mutually corpora and translated corpora among the multiple corpora and the multiple translated corpora to obtain multiple edited corpora, and finally using the multiple edited corpora and the multiple corpora as samples to train multiple translation models to obtain multiple target translation models, and by introducing multiple corpus editing models to correct the training samples for training multiple translation models, the correction of training samples can be completed without borrowing manpower, and the efficiency is faster than that of manual annotation, which can not only speed up the efficiency of training the translation model, but also effectively improve the translation accuracy of the trained translation model, and any corpora in the source corpus can be translated into each other, and the translation accuracy is significantly improved.

[0367] In practical applications, the multiple corpora specifically refer to a situation where there are more than or equal to three corpora. In this embodiment, the third translation model training method is described by including Chinese corpora, English corpora and Korean corpora in the multiple corpora. For the situation where there are more than three corpora, please refer to the relevant description of this implementation and the above two embodiments. This application will not go into details here, and the specific training process can be referred to in the above embodiments.

[0368] Step S804: using a plurality of translation models corresponding to the plurality of corpora to translate the plurality of corpora into a plurality of target corpora.

[0369] Specifically, the multiple translation models are reverse translation models of each other, and are all translation models outside the fields to which the multiple corpora belong or initial translation models to be trained. The multiple translation models need to be trained so that the trained multiple translation models can be applied to the fields to which the multiple corpora belong;

[0370] Based on this, when the multiple corpora include Chinese corpus A_in, English corpus B_in and Korean corpus C_in, six translation models need to be trained, namely, Chinese-English translation model, English-Chinese translation model, Chinese-Korean translation model, Korean-Chinese translation model, English-Korean translation model, and Korean-English translation model, wherein the training process of any translation model can refer to the corresponding description content in the above-mentioned first translation model training method; after determining the corpus, the Chinese corpus A_in is respectively input into the Chinese-English translation model and the Chinese-Korean translation model, and the translation corpora obtained are respectively English translation corpus B1_in and Korean translation corpus C1_in; the English corpus B_in is respectively input into the English-Chinese translation model and the English-Korean translation model, and the translation corpora obtained are respectively Chinese translation corpus A1_in and Korean translation corpus C2_in; the Korean corpus C_in is respectively input into the Korean-Chinese translation model and the Korean-English translation model, and the translation corpora obtained are respectively Chinese translation corpus A2_in and English translation corpus B2_in.

[0371] Step S806: according to the corpus pairs that are mutually the corpus and the target corpus among the multiple corpora and the multiple target corpora, the corpus pairs are input into the corresponding corpus editing model for corpus editing to obtain multiple edited corpora.

[0372] In practical applications, the Chinese corpus A_in and the translated English corpus B1_in are input into the first corpus editing model to obtain the first edited corpus B1*_in, the Chinese corpus A_in and the translated Korean corpus C1_in are input into the second corpus editing model to obtain the second edited corpus C1*_in; the English corpus B_in and the translated Chinese corpus A1_in are input into the third corpus editing model to obtain the third edited corpus A1*_in, the English corpus B_in and the translated Korean corpus C2_in are input into the fourth corpus editing model to obtain the fourth edited corpus C2*_in; the Korean corpus C_in and the translated Chinese corpus A2_in are input into the fifth corpus editing model to obtain the fifth edited corpus A2*_in, the Korean corpus C_in and the translated English corpus B2_in are input into the sixth corpus editing model to obtain the sixth edited corpus B2*_in; in addition, the structure of the corpus editing model is as follows Figure 3 shown.

[0373] Step S808: using the corpus pairs of the multiple corpora and the multiple edited corpora that are each other's corpus and translation corpus as training samples, and training the multiple translation models into multiple target translation models.

[0374] In practical applications, the English-Chinese translation model is trained with the Chinese corpus A_in and the first edited corpus B1*_in as training samples to obtain a target English-Chinese translation model; the Korean-Chinese translation model is trained with the Chinese corpus A_in and the second edited corpus C1*_in as training samples to obtain a target Korean-Chinese translation model; the Chinese-English translation model is trained with the English corpus B_in and the third edited corpus A1*_in as training samples to obtain a target Chinese-English translation model; the Korean-English translation model is trained with the English corpus B_in and the fourth edited corpus C2*_in as training samples to obtain a target Korean-English translation model; the Chinese-Korean translation model is trained with the Korean corpus C_in and the fifth edited corpus A2*_in as training samples to obtain a target Chinese-Korean translation model; the English-Korean translation model is trained with the Korean corpus C_in and the sixth edited corpus B2*_in as training samples to obtain a target English-Korean translation model.

[0375] In addition, the editing process and training process of the multiple corpus editing models, as well as the iterative method used to train the multiple translation models can all be found in the description of the above embodiment, and this embodiment will not be elaborated in detail here.

[0376] The third translation model training method provided in this embodiment obtains multiple corpora that are target corpora that are mutually source corpora, uses multiple translation models to translate and process them to obtain multiple target corpora, then introduces a corpus editing model to edit and process the corpus pairs that are mutually source corpora and target corpora among the multiple target corpora to obtain multiple edited corpora, and finally uses the multiple edited corpora and the multiple corpora as samples to train multiple translation models to obtain multiple target translation models. By introducing multiple corpus editing models to correct the training samples for training multiple translation models, the correction of training samples can be completed without borrowing manpower, and the efficiency is faster than that of manual annotation. It can not only speed up the efficiency of training the translation model, but also effectively improve the translation accuracy of the trained translation model. In addition, any corpora in the source corpus can be translated into each other, and the translation accuracy is significantly improved.

[0377] The third translation model training device embodiment provided by this application is as follows:

[0378] Corresponding to the above method embodiment, this specification also provides a third translation model training device embodiment, Fig. 9 FIG. 2 shows a schematic diagram of the structure of a third translation model training device provided in an embodiment of this specification. Fig. 9 As shown, the device comprises:

[0379] An acquisition module 902 is configured to acquire a plurality of corpora that are source corpora and target corpora.

[0380] The translation module 904 is configured to translate the multiple corpora into multiple target corpora using multiple translation models corresponding to the multiple corpora; the multiple translation models are mutually reverse translation models;

[0381] The editing module 906 is configured to input the corpus pairs that are mutually corpus and target corpus in the multiple corpora and the multiple target corpora into the corresponding corpus editing model for corpus editing to obtain multiple edited corpora;

[0382] The training module 908 is configured to train the multiple translation models into multiple target translation models by using the multiple corpora and the corpus pairs of the multiple edited corpora that are each other's corpus and translation corpus as training samples.

[0383] The third translation model training device provided in this embodiment obtains multiple corpora of target corpora that are mutually source corpora, uses multiple translation models to translate and process them to obtain multiple translated corpora, then introduces a corpus editing model to edit and process the corpus pairs of the multiple corpora and the multiple translated corpora that are mutually corpora and translated corpora, to obtain multiple edited corpora, and finally uses the multiple edited corpora and the multiple corpora as samples to train multiple translation models, to obtain multiple target translation models, and introduces multiple corpora editing models to correct the training samples for training multiple translation models, thereby achieving the correction of training samples without borrowing manpower, and is more efficient than manual annotation, which can not only speed up the efficiency of training the translation model, but also effectively improve the translation accuracy of the trained translation model, and any corpora in the source corpus can be translated into each other, and the translation accuracy is significantly improved.

[0384] The above is a schematic scheme of the third translation model training device of this embodiment. It should be noted that the technical scheme of the translation model training device and the technical scheme of the third translation model training method mentioned above belong to the same concept, and the details not described in detail in the technical scheme of the translation model training device can be referred to the description of the technical scheme of the third translation model training method mentioned above.

[0385] Fig.10 The structure block diagram of the first computing device 1000 provided according to an embodiment of the present specification is shown. The components of the computing device 1000 include but are not limited to a memory 1010 and a processor 1020. The processor 1020 is connected to the memory 1010 via a bus 1030, and the database 1050 is used to store data.

[0386] The computing device 1000 also includes an access device 1040 that enables the computing device 1000 to communicate via one or more networks 1060. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 1040 may include one or more of any type of network interface (e.g., a network interface card (NIC)) that is wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.

[0387] In one embodiment of the present specification, the above components of the computing device 1000 and Fig.10 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Fig.10 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0388] The computing device 1000 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 1000 may also be a mobile or stationary server.

[0389] The processor 1020 is used to execute the following computer executable instructions:

[0390] Obtain the first corpus of the target domain;

[0391] Using a first translation model to translate the first corpus to obtain a second corpus;

[0392] Inputting the first corpus and the second corpus into a corpus editing model to perform corpus editing to obtain an edited corpus of the second corpus;

[0393] The second translation model is trained using the first corpus and the edited corpus as training samples to obtain a target translation model for the target domain.

[0394] The above is a schematic scheme of the first computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the first translation model training method mentioned above are of the same concept, and the details not described in detail in the technical scheme of the computing device can be found in the description of the technical scheme of the first translation model training method mentioned above.

[0395] Fig.11 The structure block diagram of the second computing device 1100 provided according to an embodiment of the present specification is shown. The components of the computing device 1100 include but are not limited to a memory 1110 and a processor 1120. The processor 1120 is connected to the memory 1110 via a bus 1130, and the database 1150 is used to store data.

[0396] The computing device 1100 also includes an access device 1140 that enables the computing device 1100 to communicate via one or more networks 1160. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 1140 may include one or more of any type of network interface (e.g., a network interface card (NIC)) whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.

[0397] In one embodiment of the present specification, the above components of the computing device 1100 and Fig.11 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Fig.11 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0398] The computing device 1100 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 1100 may also be a mobile or stationary server.

[0399] The processor 1120 is used to execute the following computer executable instructions:

[0400] Obtain the first corpus and the second corpus;

[0401] Using a first translation model to translate the first corpus into a third corpus, and using a second translation model to translate the second corpus into a fourth corpus;

[0402] Inputting the first corpus and the third corpus into a first corpus editing model for corpus editing to obtain a first edited corpus, and inputting the second corpus and the fourth corpus into a second corpus editing model for corpus editing to obtain a second edited corpus;

[0403] The second translation model is trained as a second target translation model using the first corpus and the first edited corpus as training samples, and the first translation model is trained as a first target translation model using the second corpus and the second edited corpus as training samples.

[0404] The above is a schematic scheme of the second computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the second translation model training method described above are of the same concept, and the details not described in detail in the technical scheme of the computing device can be found in the description of the technical scheme of the second translation model training method described above.

[0405] Fig.12 The structure block diagram of the third computing device 1200 provided according to an embodiment of the present specification is shown. The components of the computing device 1200 include but are not limited to a memory 1210 and a processor 1220. The processor 1220 is connected to the memory 1210 via a bus 1230, and the database 1250 is used to store data.

[0406] The computing device 1200 also includes an access device 1240 that enables the computing device 1200 to communicate via one or more networks 1260. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 1140 may include one or more of any type of network interface (e.g., a network interface card (NIC)) whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.

[0407] In one embodiment of the present specification, the above components of the computing device 1200 and Fig.12 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Fig.12The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0408] The computing device 1200 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 1200 may also be a mobile or stationary server.

[0409] The processor 1220 is used to execute the following computer executable instructions:

[0410] Obtain multiple corpora that are source and target corpora for each other;

[0411] Using a plurality of translation models corresponding to the plurality of corpora, the plurality of corpora are translated into a plurality of target corpora; the plurality of translation models are mutually reverse translation models;

[0412] According to the corpus pairs that are mutually the corpus and the target corpus among the multiple corpora and the multiple target corpora, the corpus pairs are input into the corresponding corpus editing model for corpus editing to obtain multiple edited corpora;

[0413] The plurality of corpora and corpus pairs that are corpora and translation corpora in the plurality of edited corpora are used as training samples, and the plurality of translation models are trained into a plurality of target translation models.

[0414] The above is a schematic scheme of the third computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the third translation model training method mentioned above are of the same concept, and the details not described in detail in the technical scheme of the computing device can be found in the description of the technical scheme of the third translation model training method mentioned above.

[0415] An embodiment of the present specification also provides a first computer-readable storage medium, which stores computer instructions, and when the instructions are executed by a processor, are used to:

[0416] Obtain the first corpus of the target domain;

[0417] Using a first translation model to translate the first corpus to obtain a second corpus;

[0418] Inputting the first corpus and the second corpus into a corpus editing model to perform corpus editing to obtain an edited corpus of the second corpus;

[0419] The second translation model is trained using the first corpus and the edited corpus as training samples to obtain a target translation model for the target domain.

[0420] The above is a schematic scheme of the first computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the first translation model training method mentioned above are of the same concept, and the details not described in detail in the technical scheme of the storage medium can be found in the description of the technical scheme of the first translation model training method mentioned above.

[0421] An embodiment of the present specification also provides a second computer-readable storage medium, which stores computer instructions, and when the instructions are executed by a processor, the second computer-readable storage medium is used to:

[0422] Obtain the first corpus and the second corpus;

[0423] Using a first translation model to translate the first corpus into a third corpus, and using a second translation model to translate the second corpus into a fourth corpus;

[0424] Inputting the first corpus and the third corpus into a first corpus editing model for corpus editing to obtain a first edited corpus, and inputting the second corpus and the fourth corpus into a second corpus editing model for corpus editing to obtain a second edited corpus;

[0425] The second translation model is trained as a second target translation model using the first corpus and the first edited corpus as training samples, and the first translation model is trained as a first target translation model using the second corpus and the second edited corpus as training samples.

[0426] The above is a schematic scheme of the second computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the second translation model training method described above are of the same concept, and the details not described in detail in the technical scheme of the storage medium can be found in the description of the technical scheme of the second translation model training method described above.

[0427] An embodiment of the present specification also provides a third computer-readable storage medium, which stores computer instructions, and when the instructions are executed by a processor, is used to:

[0428] Obtain multiple corpora that are source and target corpora for each other;

[0429] Using a plurality of translation models corresponding to the plurality of corpora, the plurality of corpora are translated into a plurality of target corpora; the plurality of translation models are mutually reverse translation models;

[0430] According to the corpus pairs that are mutually the corpus and the target corpus among the multiple corpora and the multiple target corpora, the corpus pairs are input into the corresponding corpus editing model for corpus editing to obtain multiple edited corpora;

[0431] The plurality of corpora and corpus pairs that are corpora and translation corpora in the plurality of edited corpora are used as training samples, and the plurality of translation models are trained into a plurality of target translation models.

[0432] The above is a schematic scheme of the third computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the third translation model training method mentioned above belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the translation model training method mentioned above.

[0433] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0434] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0435] It should be noted that, for the convenience of description, the aforementioned method embodiments are all described as a series of action combinations, but those skilled in the art should be aware that this specification is not limited by the order of the actions described, because according to this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this specification.

[0436] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0437] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is limited only by the claims and their full scope and equivalents.

Claims

1. A translation model training method, comprising: Obtain the first corpus of the target domain; Using a first translation model to translate the first corpus to obtain a second corpus; Inputting the first corpus and the second corpus into a corpus editing model to perform corpus editing to obtain an edited corpus of the second corpus, wherein the corpus editing model is a dual-source input sequence-to-sequence model having two encoders and one decoder, wherein the encoder is used to perform encoding processing on the first corpus and the second corpus, and the decoder is used to perform decoding processing on the encoding processing results; The second translation model is trained with the first corpus and the edited corpus as training samples to obtain a target translation model of the target domain, wherein the first translation model and / or the second translation model is a translation model of a non-target domain other than the target domain.

2. According to the translation model training method of claim 1, the second translation model and the first translation model are reverse translation models.

3. According to the translation model training method of claim 2, the corpus editing model is trained in the following manner: Acquire a third corpus in the target domain; the third corpus and the first corpus are target corpus and source corpus respectively; Translating the third corpus using the second translation model to obtain a fourth corpus; Using the first translation model to translate the fourth corpus to obtain a fifth corpus; The first corpus editing model to be trained is trained using the third corpus, the fourth corpus and the fifth corpus as training samples to obtain the corpus editing model.

4. The translation model training method according to claim 3, further comprising: Inputting the third corpus and the fourth corpus into a second corpus editing model to perform corpus editing to obtain an edited corpus of the fourth corpus; The first translation model is trained using the edited corpus of the third corpus and the fourth corpus as training samples to obtain a second target translation model of the target domain.

5. According to the translation model training method of claim 4, the second corpus editing model is trained in the following manner: Inputting the second corpus into the second translation model for translation to obtain a sixth corpus; The first corpus, the second corpus and the sixth corpus are used as training samples to train the second corpus editing model to obtain the second corpus editing model.

6. The translation model training method according to claim 5, wherein the translation model training method is performed in an iterative manner; in, In the iteration process, the target translation model obtained by training in the previous iteration is used as the second translation model in the next iteration process; The second target translation model obtained by training after the previous iteration is used as the first translation model in the next iteration.

7. The translation model training method according to claim 6, wherein during the iterative process, The corpus editing model obtained by training after the previous iteration is used as the corpus editing model in the next iteration; The second corpus editing model obtained by training after the previous iteration is used as the second corpus editing model in the next iteration.

8. According to the translation model training method of claim 6 or 7, the iteration termination condition of the iteration comprises: The target translation model obtained by training after the previous iteration execution satisfies the first iteration termination condition compared with the target translation model obtained by training after the previous iteration execution; and / or, The second target translation model obtained by training after the previous iteration execution satisfies the second iteration termination condition compared with the second target translation model obtained by training after the previous iteration execution.

9. The translation model training method according to claim 1, wherein the step of inputting the first corpus and the second corpus into a corpus editing model to perform corpus editing to obtain an edited corpus of the second corpus comprises: Performing vectorization processing on the first corpus and the second corpus to obtain a first word vector of the first corpus and a second word vector of the second corpus; A first encoding unit included in the corpus editing model encodes the first word vector into a first encoding vector, and a second encoding unit included in the corpus editing model encodes the second word vector into a second encoding vector; The decoding unit included in the corpus editing model decodes the first encoding vector and the second encoding vector to obtain the edited corpus.

10. The translation model training method according to claim 5, wherein the first corpus is a source corpus, and the second corpus is a target translation corpus. The third corpus is the target corpus, the fourth corpus is the source translation corpus, The fifth corpus is the target secondary translation corpus, and the sixth corpus is the source secondary translation corpus; or, The first corpus is the target corpus, the second corpus is the source translation corpus, The third corpus is a source corpus, the fourth corpus is a target translation corpus, The fifth corpus is a source secondary translation corpus, and the sixth corpus is a target secondary translation corpus.

11. A translation model training device, comprising: An acquisition module, configured to acquire a first corpus in a target domain; A translation module, configured to translate the first corpus using a first translation model to obtain a second corpus; an editing module, configured to input the first corpus and the second corpus into a corpus editing model, perform corpus editing, and obtain an edited corpus of the second corpus, wherein the corpus editing model is a dual-source input sequence-to-sequence model having two encoders and one decoder, wherein the encoder is used to encode the first corpus and the second corpus, and the decoder is used to decode the encoding processing results; The training module is configured to train the second translation model using the first corpus and the edited corpus as training samples to obtain a target translation model of the target domain, wherein the first translation model and / or the second translation model is a translation model of a non-target domain other than the target domain.

12. A translation model training method, comprising: Obtain the first corpus and the second corpus; Using a first translation model to translate the first corpus into a third corpus, and using a second translation model to translate the second corpus into a fourth corpus; Input the first corpus and the third corpus into a first corpus editing model for corpus editing to obtain a first edited corpus, and input the second corpus and the fourth corpus into a second corpus editing model for corpus editing to obtain a second edited corpus, wherein the first corpus editing model and the second corpus editing model are both a sequence-to-sequence model with dual-source input, and both have two encoders and one decoder, the encoder of the first corpus editing model is used to encode the first corpus and the third corpus, the decoder of the first corpus editing model is used to decode the encoding results of the first corpus and the third corpus, the encoder of the second corpus editing model is used to encode the second corpus and the fourth corpus, and the decoder of the second corpus editing model is used to decode the encoding results of the second corpus and the fourth corpus; The second translation model is trained as a second target translation model using the first corpus and the first edited corpus as training samples, and the first translation model is trained as a first target translation model using the second corpus and the second edited corpus as training samples, wherein the first translation model and / or the second translation model is a translation model of a non-target domain outside the target domain.

13. The translation model training method according to claim 12, wherein the second translation model and the first translation model are reverse translation models; and / or, The first corpus and the second corpus are source corpus and target corpus for each other.

14. The translation model training method according to claim 13, wherein the first corpus editing model is trained in the following manner: Using the first translation model to translate the fourth corpus to obtain a fifth corpus; The first corpus editing model to be trained is trained using the second corpus, the fourth corpus and the fifth corpus as training samples to obtain the first corpus editing model.

15. The translation model training method according to claim 13, wherein the second corpus editing model is trained in the following manner: Inputting the third corpus into the second translation model for translation to obtain a sixth corpus; The second corpus editing model to be trained is trained with the first corpus, the third corpus and the sixth corpus as training samples to obtain the second corpus editing model.

16. The translation model training method according to claim 15, wherein the translation model training method is performed in an iterative manner; in, In the iteration process, the second target translation model obtained by training in the previous iteration is used as the second translation model in the next iteration process; The first target translation model obtained by training after the previous iteration is used as the first translation model in the next iteration.

17. The translation model training method according to claim 16, wherein during the iterative process, Using the first corpus editing model obtained by training after the previous iteration as the first corpus editing model in the next iteration; The second corpus editing model obtained by training after the previous iteration is used as the second corpus editing model in the next iteration.

18. According to the translation model training method of claim 16 or 17, the iteration termination condition of the iteration comprises: The first target translation model obtained by training after the previous iteration execution satisfies the first iteration termination condition compared with the first target translation model obtained by training after the previous iteration execution; and / or, The second target translation model obtained by training after the previous iteration execution satisfies the second iteration termination condition compared with the second target translation model obtained by training after the previous iteration execution.

19. The translation model training method according to claim 12, wherein the step of inputting the first corpus and the third corpus into a first corpus editing model for corpus editing to obtain a first edited corpus comprises: Performing vectorization processing on the first corpus and the third corpus to obtain a first word vector of the first corpus and a third word vector of the third corpus; The first encoding unit included in the first corpus editing model encodes the first word vector into a first encoding vector, and the second encoding unit included in the first corpus editing model encodes the third word vector into a third encoding vector; The first encoding vector and the third encoding vector are decoded by a decoding unit included in the first corpus editing model to obtain the first editing corpus.

20. The translation model training method according to claim 12, wherein the step of inputting the second corpus and the fourth corpus into a second corpus editing model to perform corpus editing to obtain a second edited corpus comprises: Performing vectorization processing on the second corpus and the fourth corpus to obtain a second word vector of the fourth corpus and a fourth word vector of the fourth corpus; The first encoding unit included in the second corpus editing model encodes the second word vector into a second encoding vector, and the second encoding unit included in the second corpus editing model encodes the fourth word vector into a fourth encoding vector; The second encoding vector and the fourth encoding vector are decoded by a decoding unit included in the second corpus editing model to obtain the second edited corpus.

21. The translation model training method according to claim 12, wherein the first corpus and the second corpus are corpora of a target domain.

22. The translation model training method according to claim 21, wherein the first corpus is a source corpus, the second corpus is a target corpus, The third corpus is the target translation corpus, and the fourth corpus is the source translation corpus; or, The first corpus is the target corpus, the second corpus is the source corpus, The third corpus is a source translation corpus, and the fourth corpus is a target translation corpus.

23. A translation model training device, comprising: An acquisition module is configured to acquire a first corpus and a second corpus; A translation module, configured to translate the first corpus into a third corpus using a first translation model, and to translate the second corpus into a fourth corpus using a second translation model; an editing module, configured to input the first corpus and the third corpus into a first corpus editing model for corpus editing to obtain a first edited corpus, and input the second corpus and the fourth corpus into a second corpus editing model for corpus editing to obtain a second edited corpus, wherein the first corpus editing model and the second corpus editing model are both a sequence-to-sequence model with dual-source input, and both have two encoders and one decoder, the encoder of the first corpus editing model is used to encode the first corpus and the third corpus, the decoder of the first corpus editing model is used to decode the encoding results of the first corpus and the third corpus, the encoder of the second corpus editing model is used to encode the second corpus and the fourth corpus, and the decoder of the second corpus editing model is used to decode the encoding results of the second corpus and the fourth corpus; The training module is configured to use the first corpus and the first edited corpus as training samples to train the second translation model into a second target translation model, and use the second corpus and the second edited corpus as training samples to train the first translation model into a first target translation model, wherein the first translation model and / or the second translation model is a translation model of a non-target domain outside the target domain.

24. A translation model training method, comprising: Obtain multiple corpora that are source and target corpora for each other; Using a plurality of translation models corresponding to the plurality of corpora, the plurality of corpora are translated into a plurality of target corpora; The multiple translation models are mutually reverse translation models; According to the corpus pairs that are mutually the corpus and the target corpus among the multiple corpora and the multiple target corpora, the corpus pairs are input into the corresponding corpus editing model for corpus editing to obtain multiple edited corpora, wherein the corpus editing model is a sequence-to-sequence model with dual-source input, having two encoders and one decoder, the encoder is used to encode the corpus pairs, and the decoder is used to decode the encoding processing results; The plurality of corpora and corpus pairs that are mutually corpora and translation corpora in the plurality of edited corpora are used as training samples, and the plurality of translation models are trained into a plurality of target translation models, wherein the plurality of translation models are all translation models outside the fields to which the plurality of corpora belong.

25. A translation model training device, comprising: An acquisition module is configured to acquire a plurality of corpora that are source corpora and target corpora; A translation module, configured to translate the multiple corpora into multiple target corpora using multiple translation models corresponding to the multiple corpora; The multiple translation models are mutually reverse translation models; The editing module is configured to input the corpus pairs that are mutually the corpus and the target corpus into a corresponding corpus editing model to perform corpus editing, thereby obtaining multiple edited corpora, wherein the corpus editing model is a sequence-to-sequence model with dual-source input, and has two encoders and one decoder, wherein the encoder is used to encode the corpus pairs, and the decoder is used to decode the encoding processing results; The training module is configured to use the corpus pairs of the multiple corpora and the multiple edited corpora that are each other's corpus and translation corpus as training samples, and train the multiple translation models into multiple target translation models, wherein the multiple translation models are all translation models outside the field to which the multiple corpora belong.

26. A computing device comprising: Memory and processor; The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions: Obtain the first corpus of the target domain; Using a first translation model to translate the first corpus to obtain a second corpus; Inputting the first corpus and the second corpus into a corpus editing model to perform corpus editing to obtain an edited corpus of the second corpus, wherein the corpus editing model is a dual-source input sequence-to-sequence model having two encoders and one decoder, wherein the encoder is used to perform encoding processing on the first corpus and the second corpus, and the decoder is used to perform decoding processing on the encoding processing results; The second translation model is trained with the first corpus and the edited corpus as training samples to obtain a target translation model of the target domain, wherein the first translation model and / or the second translation model is a translation model of a non-target domain other than the target domain.

27. A computing device comprising: Memory and processor; The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions: Obtain the first corpus and the second corpus; Using a first translation model to translate the first corpus into a third corpus, and using a second translation model to translate the second corpus into a fourth corpus; Input the first corpus and the third corpus into a first corpus editing model for corpus editing to obtain a first edited corpus, and input the second corpus and the fourth corpus into a second corpus editing model for corpus editing to obtain a second edited corpus, wherein the first corpus editing model and the second corpus editing model are both a sequence-to-sequence model with dual-source input, and both have two encoders and one decoder, the encoder of the first corpus editing model is used to encode the first corpus and the third corpus, the decoder of the first corpus editing model is used to decode the encoding results of the first corpus and the third corpus, the encoder of the second corpus editing model is used to encode the second corpus and the fourth corpus, and the decoder of the second corpus editing model is used to decode the encoding results of the second corpus and the fourth corpus; The second translation model is trained as a second target translation model using the first corpus and the first edited corpus as training samples, and the first translation model is trained as a first target translation model using the second corpus and the second edited corpus as training samples, wherein the first translation model and / or the second translation model is a translation model of a non-target domain outside the target domain.

28. A computing device comprising: Memory and processor; The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions: Obtain multiple corpora that are source and target corpora for each other; Using a plurality of translation models corresponding to the plurality of corpora, the plurality of corpora are translated into a plurality of target corpora; the plurality of translation models are mutually reverse translation models; According to the corpus pairs that are mutually the corpus and the target corpus among the multiple corpora and the multiple target corpora, the corpus pairs are input into the corresponding corpus editing model for corpus editing to obtain multiple edited corpora, wherein the corpus editing model is a sequence-to-sequence model with dual-source input, having two encoders and one decoder, and the decoder is used to decode the encoding processing result; The plurality of corpora and corpus pairs that are mutually corpora and translation corpora in the plurality of edited corpora are used as training samples, and the plurality of translation models are trained into a plurality of target translation models, wherein the plurality of translation models are all translation models outside the fields to which the plurality of corpora belong.

29. A computer-readable storage medium storing computer instructions, which, when executed by a processor, implement the steps of the translation model training method described in any one of claims 1 to 10.

30. A computer-readable storage medium storing computer instructions, which, when executed by a processor, implement the steps of the translation model training method described in any one of claims 12 to 22.

31. A computer-readable storage medium storing computer instructions, which, when executed by a processor, implement the steps of the translation model training method described in claim 24.

32. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the steps of the translation model training method according to any one of claims 1 to 10.

33. A computer program product, characterized in that The method comprises computer instructions which, when executed by a processor, implement the steps of the translation model training method according to any one of claims 12 to 22.

34. A computer program product, characterized in that It includes computer instructions, which, when executed by a processor, implement the steps of the translation model training method described in claim 24.