Translation model training method, device, electronic device and medium

By obtaining and expanding the training samples of the translation model, determining the target parallel corpus pairs and training the initial translation model, the problems of low training accuracy and low efficiency in the existing technology are solved, and more efficient and accurate translation model training is achieved.

CN114757212BActive Publication Date: 2025-03-21BEIJING KINGSOFT DIGITAL ENTERTAINMENT CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210328982.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-30
Publication Date
2025-03-21
Estimated Expiration
2042-03-30

AI Technical Summary

Technical Problem

In the existing translation model training methods, the fluency of the paired corpus obtained based on back translation vs. parallel corpus, resulting in low training accuracy and low efficiency of the translation model.

Method used

By obtaining the first parallel corpus pair, the target parallel corpus pair is determined, wherein the target parallel corpus pair includes the first parallel corpus pair and/or the second parallel corpus pair, the training sample of the translation model is expanded, and the initial translation model is trained according to the target parallel corpus pair to obtain the target translation model.

Benefits of technology

It effectively improves the training efficiency and accuracy of the translation model, and improves the performance of the model by expanding the training samples and optimizing the training process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114757212B_ABST
    Figure CN114757212B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a translation model training method, device, electronic device and medium; wherein the method comprises: obtaining a first parallel corpus pair, determining a target parallel corpus pair according to the first parallel corpus pair, the target parallel corpus pair comprising: a first parallel corpus pair, and / or a second parallel corpus pair, the first parallel corpus pair comprising: a corpus pair matching a first monolingual corpus with a second monolingual corpus, or a corpus pair matching a second monolingual corpus with a first monolingual corpus; training an initial translation model according to the target parallel corpus pair to obtain a target translation model. This embodiment can effectively improve the training efficiency of the translation model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of model training, and in particular to a translation model training method, device, electronic device and medium. Background Art

[0002] The translation model can be a content translation model between two languages, such as a Chinese-English translation model, an English-Chinese translation model, a Chinese-Mongolian translation model, and a Mongolian-Chinese translation model.

[0003] In the related art, a machine translation model is mainly obtained by training a large number of parallel corpora (such as training a Chinese-English parallel corpus to obtain a Chinese-English translation model), and then the machine translation model is used to back-translate monolingual corpora to obtain paired corpora (such as back-translating monolingual Chinese to obtain the corresponding English, forming an English-Chinese parallel corpus) to train another corresponding machine translation model (such as an English-Chinese translation model).

[0004] However, in the above translation process, the fluency of the paired corpus obtained based on back translation is quite different from that of the parallel corpus, which in turn reduces the training accuracy of the translation model and makes the training efficiency of the translation model low. Summary of the invention

[0005] In order to solve the above technical problems, the present disclosure provides a translation model training method, device, electronic device and medium.

[0006] In a first aspect, this embodiment provides a translation model training method, including:

[0007] Acquire a first parallel corpus pair, wherein the first parallel corpus pair includes: a corpus pair of a first monolingual corpus and a second monolingual corpus matching each other, or a corpus pair of a second monolingual corpus and a first monolingual corpus matching each other;

[0008] Determining a target parallel corpus pair according to the first parallel corpus pair, the target parallel corpus pair comprising: the first parallel corpus pair, and / or, a second parallel corpus pair, the correspondence between the monolingual corpora in the second parallel corpus pair being the same as the correspondence between the monolingual corpora in the first parallel corpus pair;

[0009] The initial translation model is trained according to the target parallel corpus pair to obtain a target translation model.

[0010] Optionally, the target parallel corpus pair includes: a first parallel corpus pair and a second parallel corpus pair;

[0011] The step of training the initial translation model according to the target parallel corpus pair to obtain the target translation model comprises:

[0012] Determine the frequency of training cycles;

[0013] Determine, within the training cycle frequency, a training batch of the first parallel corpus pair and a training batch of the second parallel corpus pair, wherein the training batch includes: a training number and a training sequence number;

[0014] Based on the training batch of the first parallel corpus pair and the training batch of the second parallel corpus pair, an initial translation model is trained according to the first parallel corpus pair and the second parallel corpus pair to obtain a target translation model.

[0015] Optionally, determining the training batch of the first parallel corpus pair and the training batch of the second parallel corpus pair includes:

[0016] Based on the weight of the first parallel corpus pair and the weight of the second parallel corpus pair, a training batch of the first parallel corpus pair and a training batch of the second parallel corpus pair are determined.

[0017] Optionally, determining a target parallel corpus pair according to the first parallel corpus pair includes:

[0018] Determine a second parallel corpus pair according to the first parallel corpus pair;

[0019] A target parallel corpus pair is determined according to the second parallel corpus pair and the first parallel corpus pair.

[0020] Optionally, determining the second parallel corpus pair according to the first parallel corpus pair includes:

[0021] Training an initial translation model according to the first parallel corpus pair to obtain a first translation model;

[0022] A second parallel corpus pair is determined according to the low-frequency dictionary library of the first translation model.

[0023] Optionally, before determining the second parallel corpus pair from the low-frequency dictionary library of the first translation model, the method further includes:

[0024] Determining a low-frequency dictionary library of the first translation model;

[0025] The step of determining a second parallel corpus pair according to the low-frequency dictionary library of the first translation model comprises:

[0026] Determining a target monolingual corpus from a low-frequency dictionary library of the first translation model;

[0027] Determining a paired monolingual corpus of the target monolingual corpus according to the target monolingual corpus and the first translation model;

[0028] A second parallel corpus pair is determined according to the target monolingual corpus and the paired monolingual corpus.

[0029] Optionally, determining a low-frequency dictionary library of the first translation model includes:

[0030] A low-frequency dictionary is constructed based on candidate monolingual corpora in the first parallel corpus pair whose occurrence frequency is greater than a first preset threshold and less than a second preset threshold.

[0031] Optionally, before determining a paired monolingual corpus of the target monolingual corpus according to the target monolingual corpus and the first translation model, the method further includes:

[0032] Get random monolingual corpus;

[0033] The target monolingual corpus is updated according to the weight of the candidate monolingual corpus and the weight of the random monolingual corpus.

[0034] In a second aspect, this embodiment provides a translation model training device, including:

[0035] An acquisition module, configured to acquire a first parallel corpus pair, wherein the first parallel corpus pair includes: a corpus pair matching a first monolingual corpus and a second monolingual corpus, or a corpus pair matching a second monolingual corpus and a first monolingual corpus;

[0036] a determination module, configured to determine a target parallel corpus pair according to the first parallel corpus pair, wherein the target parallel corpus pair includes: the first parallel corpus pair, and / or, a second parallel corpus pair, wherein the correspondence between the monolingual corpora in the second parallel corpus pair is the same as the correspondence between the monolingual corpora in the first parallel corpus pair;

[0037] The training module is used to train the initial translation model according to the target parallel corpus pair to obtain a target translation model.

[0038] Optionally, the target parallel corpus pair includes: a first parallel corpus pair and a second parallel corpus pair;

[0039] A training module, comprising: a first determining unit, a second determining unit and a training unit;

[0040] A first determining unit, used to determine the frequency of the training cycle;

[0041] A second determining unit is used to determine a training batch of the first parallel corpus pair and a training batch of the second parallel corpus pair within the training cycle frequency, wherein the training batch includes: a training number and a training sequence number;

[0042] A training unit is used to train an initial translation model based on the training batch of the first parallel corpus pair and the training batch of the second parallel corpus pair, according to the first parallel corpus pair and the second parallel corpus pair, to obtain a target translation model.

[0043] Optional, training unit, specifically used for:

[0044] Based on the weight of the first parallel corpus pair and the weight of the second parallel corpus pair, a training batch of the first parallel corpus pair and a training batch of the second parallel corpus pair are determined.

[0045] Optionally, the determination module includes: a third determination unit and a fourth determination unit;

[0046] A third determining unit, configured to determine a second parallel corpus pair according to the first parallel corpus pair;

[0047] The fourth determining unit is configured to determine a target parallel corpus pair according to the second parallel corpus pair and the first parallel corpus pair.

[0048] Optionally, the third determining unit is specifically configured to:

[0049] Training an initial translation model according to the first parallel corpus pair to obtain a first translation model;

[0050] A second parallel corpus pair is determined according to the low-frequency dictionary library of the first translation model.

[0051] Optionally, the determination module is further used to determine a low-frequency dictionary library of the first translation model;

[0052] The third determining unit is specifically configured to:

[0053] Determining a target monolingual corpus from a low-frequency dictionary library of the first translation model;

[0054] Determining a paired monolingual corpus of the target monolingual corpus according to the target monolingual corpus and the first translation model;

[0055] A second parallel corpus pair is determined according to the target monolingual corpus and the paired monolingual corpus.

[0056] Optionally, determine the module, specifically for:

[0057] A low-frequency dictionary is constructed based on candidate monolingual corpora in the first parallel corpus pair whose occurrence frequency is greater than a first preset threshold and less than a second preset threshold.

[0058] Optionally, it also includes: an update module;

[0059] The acquisition module is also used to obtain random monolingual corpora;

[0060] An updating module updates the target monolingual corpus according to the weight of the candidate monolingual corpus and the weight of the random monolingual corpus.

[0061] In a third aspect, this embodiment further provides an electronic device, including:

[0062] one or more processors;

[0063] a storage device for storing one or more programs,

[0064] When the one or more programs are executed by the one or more processors, the one or more processors implement any one of the translation model training methods described in the embodiments of the present invention.

[0065] In a fourth aspect, this embodiment further provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, any one of the translation model training methods in the embodiments of the present invention is implemented.

[0066] The technical solution provided by the embodiments of the present disclosure has the following advantages over the prior art: by obtaining a first parallel corpus pair, the first parallel corpus pair includes: a corpus pair matching a first monolingual corpus and a second monolingual corpus, or a corpus pair matching a second monolingual corpus and a first monolingual corpus, a target parallel corpus pair is determined according to the first parallel corpus pair, wherein the target parallel corpus pair may include: the first parallel corpus pair and / or the second parallel corpus pair, thereby expanding the training samples of the translation model, and training the initial translation model according to the target parallel corpus pair to obtain the target translation model, thereby effectively improving the training efficiency of the translation model. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0068] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0069] Figure 1 is a flowchart of a translation model training method provided in this embodiment;

[0070] Figure 2 is a flowchart of another translation model training method provided in this embodiment;

[0071] Figure 3 is a flowchart of another translation model training method provided in this embodiment;

[0072] Figure 4 is a flowchart of another translation model training method provided in this embodiment;

[0073] Figure 5 is a structural diagram of a translation model training device provided in this embodiment;

[0074] Figure 6 It is a structural schematic diagram of an electronic device provided by this embodiment. DETAILED DESCRIPTION

[0075] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.

[0076] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.

[0077] Currently, when training a translation model, the initial translation model is mainly trained through a large number of training samples to obtain a target translation model.

[0078] For example, when training a Chinese-English translation model, the first group of Chinese-English parallel corpus pairs can be used to train the initial translation model to obtain an English-Chinese translation model, and then some Chinese monolingual corpora can be found. The English monolingual corpus corresponding to the Chinese monolingual corpus can be obtained through the English-Chinese translation model. The Chinese monolingual corpus and the English monolingual corpus can be combined to obtain a second group of English-Chinese parallel corpus pairs, and then the initial translation model can be updated and trained based on the second group of English-Chinese parallel corpus pairs.

[0079] Among them, the training of existing translation models is to alleviate the problem of lack of parallel corpus pairs by constructing pseudo-parallel corpus pairs (pseudo-parallel corpus is a group of parallel corpus similar to a group of parallel corpus obtained based on the parallel corpus, such as the second group of English-Chinese parallel corpus pairs mentioned above). However, the fluency of the pseudo-parallel corpus pairs obtained after back-translation by the model is different from that of the parallel corpus, which makes it difficult to ensure the training accuracy of the model, thereby affecting the training efficiency of the model.

[0080] Exemplarily, the present disclosure provides a translation model training method, device, electronic device and medium, which obtains a first parallel corpus pair, wherein the first parallel corpus pair includes: a corpus pair of a first monolingual corpus matching a second monolingual corpus, or a corpus pair of a second monolingual corpus matching the first monolingual corpus, and determines a target parallel corpus pair based on the first parallel corpus pair, wherein the target parallel corpus pair may include: the first parallel corpus pair and / or the second parallel corpus pair, thereby expanding the training samples of the translation model, and training the initial translation model based on the target parallel corpus pair to obtain the target translation model, thereby effectively improving the training efficiency of the translation model.

[0081] Figure 1 is a flowchart of a translation model training method provided in this embodiment. The method of this embodiment can be executed by a translation model training device, which can be implemented in hardware / software and can be configured in an electronic device. The translation model training method described in any embodiment of this application can be implemented. Figure 1 As shown, the method specifically includes the following:

[0082] S110: Obtain a first parallel corpus pair.

[0083] The first parallel corpus pair includes: a corpus pair of a first monolingual corpus and a second monolingual corpus that matches, or a corpus pair of a second monolingual corpus and a first monolingual corpus that matches.

[0084] The first parallel corpus pair includes: a corpus pair of a first monolingual corpus and a second monolingual corpus matching each other, or a corpus pair of a second monolingual corpus and a first monolingual corpus matching each other.

[0085] For example, when the first parallel corpus pair includes: a corpus pair of a first monolingual corpus and a second monolingual corpus, and the first monolingual corpus is English and the second monolingual corpus is Chinese, the first parallel corpus pair may be an English-Chinese corpus pair.

[0086] In combination with the above example, when the first parallel corpus pair includes: a corpus pair in which the second monolingual corpus matches the first monolingual corpus, the first parallel corpus pair may be a Chinese-English corpus pair.

[0087] It should be noted that monolingual corpus can be used to describe words / sentences composed of one language, and the first parallel corpus pair / the second parallel corpus pair is a set of two different languages ​​but with the same / similar meanings.

[0088] Among them, a large number of initial parallel corpus pairs can be obtained through network resource search, manual construction, etc.

[0089] After obtaining a large number of initial parallel corpus pairs, data cleaning may be performed on the large number of initial parallel corpus pairs to unify the initial parallel corpus and obtain the first parallel corpus pairs.

[0090] Among them, data cleaning operations may include: corpus supplementation, corpus deletion, semantic correction, format unification, size alignment and other operations.

[0091] For example, when the first parallel corpus pair is a Chinese-English corpus pair, some of the Chinese monolingual corpora included in the Chinese-English corpus pair do not have paired English monolingual corpora. In this case, manual collection / machine translation and other operations can be used to pair all the Chinese monolingual corpora that have no paired English monolingual corpora to supplement the missing corpora.

[0092] In combination with the above example, after corpus supplementation, each Chinese monolingual corpus in some Chinese monolingual corpora included in the obtained Chinese-English corpus pair has two or more paired English monolingual corpora, then according to the similarity between the Chinese monolingual corpus and each of the two or more paired English monolingual corpora, an English monolingual corpus paired with the Chinese monolingual corpus is determined, such as selecting the English monolingual corpus corresponding to the maximum similarity as the paired corpus of the Chinese monolingual corpus, so as to achieve corpus deletion of duplicate corpora.

[0093] In combination with the above example, after the corpus is deleted, some sentences included in the obtained Chinese-English data pair are semantically incoherent. The sentence can be semantically corrected based on the keywords in the sentence and the context of the sentence to achieve semantic correction of the semantically incorrect sentence.

[0094] Combined with the above example, after semantic correction, some sentence formats included in the obtained Chinese-English material pair are different, such as line spacing, punctuation, paragraph before and after, etc., then the sentence format can be unified using a pre-prepared unified format to achieve the format unification of irregular sentences.

[0095] In combination with the above example, after the format is unified, the sizes of some fonts included in the obtained Chinese-English material pair are different. These partial fonts can be aligned using a pre-prepared unified font to achieve size alignment of all fonts included in the Chinese-English material pair.

[0096] It should be noted that the embodiments of the present disclosure do not specifically limit the order of the above-mentioned multiple cleaning operations in the actual cleaning process.

[0097] Therefore, by performing data cleaning on the obtained initial parallel corpus pair, the corpus quality of the parallel corpus pair can be improved, thereby obtaining a high-quality first parallel corpus pair.

[0098] S120: Determine a target parallel corpus pair according to the first parallel corpus pair.

[0099] The target parallel corpus pair includes: a first parallel corpus pair and / or a second parallel corpus pair.

[0100] The target parallel corpus pair may include at least one parallel corpus pair, such as a first parallel corpus pair, or a second parallel corpus pair, or a first parallel corpus pair and a second parallel corpus pair.

[0101] It should be noted that the first parallel corpus pair may be a corpus pair combining two monolingual languages, such as a corpus pair obtained by matching a first monolingual corpus with a second monolingual corpus, or a corpus pair obtained by matching a second monolingual corpus with a first monolingual corpus.

[0102] The first monolingual corpus may be English, Chinese, Mongolian, Korean, etc., and the second monolingual corpus may be Chinese, Mongolian, Korean, or English, etc.

[0103] It should be noted that the first monolingual corpus is different from the second monolingual corpus. Accordingly, when the first monolingual corpus is English, the second monolingual corpus may be Chinese, or Mongolian, Korean, etc.; or, when the first monolingual corpus is Chinese, the second monolingual corpus may be English, or Mongolian, Korean, etc. The present disclosure does not limit the specific languages ​​corresponding to the first monolingual corpus and the second monolingual corpus.

[0104] The first parallel corpus pair may be a Chinese-English parallel corpus pair, or an English-Chinese parallel corpus pair, or a Mongolian-Chinese parallel corpus pair, or a Chinese-Mongolian parallel corpus pair, or a Chinese-Korean parallel corpus pair, or a Korean-Chinese parallel corpus pair.

[0105] The second parallel corpus pair may be a pseudo-parallel corpus pair of the first parallel corpus pair, that is, the correspondence between the monolingual corpora in the second parallel corpus pair is the same as the correspondence between the monolingual corpora in the first parallel corpus pair.

[0106] For example, when the first parallel corpus pair is a Chinese-English parallel corpus pair, the second parallel corpus pair is also a Chinese-English parallel corpus pair; or, when the first parallel corpus pair is an English-Chinese parallel corpus pair / Mongolian-Chinese parallel corpus pair / Chinese-Mongolian parallel corpus pair / Chinese-Korean parallel corpus pair / Korean-Chinese parallel corpus pair, the corresponding second parallel corpus pair is also an English-Chinese parallel corpus pair / Mongolian-Chinese parallel corpus pair / Chinese-Mongolian parallel corpus pair / Chinese-Korean parallel corpus pair / Korean-Chinese parallel corpus pair.

[0107] S130: training the initial translation model according to the target parallel corpus pair to obtain a target translation model.

[0108] The initial translation model may be a machine model, such as a neural network model.

[0109] Specifically, the target parallel corpus pair may be used as a training sample pair to train the initial translation model to obtain the target translation model.

[0110] The translation model training method provided by the present disclosure obtains a first parallel corpus pair, wherein the first parallel corpus pair includes: a corpus pair of a first monolingual corpus matching a second monolingual corpus, or a corpus pair of a second monolingual corpus matching a first monolingual corpus, and determines a target parallel corpus pair according to the first parallel corpus pair, wherein the target parallel corpus pair may include: the first parallel corpus pair and / or the second parallel corpus pair, thereby expanding the training sample of the translation model, and training the initial translation model according to the target parallel corpus pair to obtain the target translation model, thereby effectively improving the training efficiency of the translation model.

[0111] Figure 2 This is a flow chart of another translation model training method provided by this embodiment. This embodiment is based on the above embodiment. When the target parallel corpus pair includes a first parallel corpus pair and a second parallel corpus pair, a possible implementation of S130 is as follows:

[0112] S1301. Determine the frequency of training cycles.

[0113] When the target parallel corpus pair includes two parallel corpus pairs, that is, the target parallel corpus pair includes a first parallel corpus pair and a second parallel corpus pair, the training cycle may be the sum of the number of training times of the first parallel corpus pair and the number of training times of the second parallel corpus pair.

[0114] For example, when the frequency of the training cycle is 8, it means that the model training can be performed 8 times in one training cycle, the training number of the first parallel corpus pair can be 5, and the training number of the second parallel corpus pair can be 3. That is, the initial translation model is trained 5 times using the first parallel corpus pair, and then the initial translation model is trained 3 times using the second parallel corpus pair. At this point, one training cycle can be completed.

[0115] S1302: Determine a training batch of the first parallel corpus pair and a training batch of the second parallel corpus pair within a training cycle frequency.

[0116] The training batch includes: the number of training times and the training sequence number.

[0117] The training sequence number can effectively represent the training order of the parallel corpus pairs to be trained. When training the initial translation model, the parallel corpus pairs within the same sequence number range can be used at one time to continuously train the initial translation model.

[0118] In combination with the above example, the training times of the first parallel corpus pair is 5, and the corresponding training sequence number can be 1; the training times of the second parallel corpus pair is 3, and the corresponding training sequence number can be 2. This means that in a complete training cycle, the training sequence of the first parallel corpus pair is earlier than the training sequence of the second parallel corpus pair.

[0119] Optionally, determining the training batch of the first parallel corpus pair and the training batch of the second parallel corpus pair includes:

[0120] Based on the weight of the first parallel corpus pair and the weight of the second parallel corpus pair, a training batch of the first parallel corpus pair and a training batch of the second parallel corpus pair are determined.

[0121] The weight of the first parallel corpus pair and the weight of the second parallel corpus pair can be measured according to the source / credibility / precision / accuracy of the corpus in the first parallel corpus pair and the second parallel corpus pair.

[0122] Taking the source of the corpus as an example, the weight division of the first parallel corpus pair and the second parallel corpus pair is assumed to be database A, and the source of the second parallel corpus pair is database B, wherein the update frequency of the data in database A is higher than the update frequency of the data in database B, which can indicate that the data in database A is more real-time and accurate than the data in database B. Then, the weight of the first parallel corpus pair may be greater than the weight of the second parallel corpus pair, such as setting the weight of the first parallel corpus pair to 0.7 and the weight of the second parallel corpus pair to 0.3. The specific weights can be set based on training requirements, and the present disclosure does not make specific limitations on this.

[0123] Among them, when the training cycle frequency is 10, it can be determined that the training times of the first parallel corpus pair is 7, the training sequence number of the training corresponds to 1, the training times of the second parallel corpus pair is 3, and the training sequence number of the training corresponds to 2.

[0124] Therefore, by taking the weight of the first parallel corpus pair and the weight of the second parallel corpus pair as reference, the training batch of the first parallel corpus pair and the training batch of the second parallel corpus pair are constant, so that the training batch of the first parallel corpus pair and the training batch of the second parallel corpus pair can be accurately and effectively determined.

[0125] S1303: Based on the training batches of the first parallel corpus pair and the training batches of the second parallel corpus pair, the initial translation model is trained according to the first parallel corpus pair and the second parallel corpus pair to obtain a target translation model.

[0126] For example, taking the initial translation model as an English-Chinese neural network model, assuming that the first parallel corpus pair and the second parallel corpus pair are both English-Chinese corpus pairs, the English corpus is input into the English-Chinese neural network model, and the target Chinese corpus is output. The target Chinese corpus is compared with the Chinese corpus in the English-Chinese pair. When the difference between the target Chinese corpus and the Chinese corpus in the English-Chinese pair is less than a preset difference threshold, the model training is considered successful, and the target translation model is obtained through training.

[0127] Among them, the first parallel corpus pair may include a first Chinese monolingual corpus and a first English monolingual corpus, and the second parallel corpus pair may include a second Chinese monolingual corpus and a second English monolingual corpus. When training the initial translation model, the first Chinese monolingual corpus and the second Chinese monolingual corpus may be input into the initial translation model respectively, or the first Chinese monolingual corpus and the second Chinese monolingual corpus may be input into the initial translation model at the same time, and the initial translation model is trained to obtain a target translation model. The present disclosure does not specifically limit the order / input method of inputting the first Chinese monolingual corpus pair and the second Chinese monolingual corpus pair into the initial translation model.

[0128] For example, the first Chinese monolingual corpus and the second Chinese monolingual corpus are respectively input into the initial translation model, the initial translation model is trained, and the target translation model is obtained. The first Chinese monolingual corpus is input into the initial translation model, and the error comparison is performed between the output result of the initial translation model and the first English monolingual corpus corresponding to the first Chinese monolingual corpus to optimize the training accuracy. The second Chinese monolingual corpus is then input into the initial translation model, and the error comparison is performed between the output result of the initial translation model and the second English monolingual corpus corresponding to the second Chinese monolingual corpus to optimize the training accuracy until the model converges and the target translation model (such as a Chinese-English translation model) is obtained.

[0129] Among them, the model parameters in the initial translation model can be adjusted according to the result of error comparison between the output result of the initial translation model and the second English monolingual corpus corresponding to the second Chinese monolingual corpus, and the second Chinese monolingual corpus can be translated using the adjusted model parameters until the error between the output English corpus and the second English corpus is within a preset error range, and it is determined that the model convergence is satisfied.

[0130] Alternatively, an error comparison result can be performed based on the output result of the initial translation model and the first English monolingual corpus corresponding to the first Chinese monolingual corpus, the model parameters in the initial translation model can be adjusted, and the first Chinese monolingual corpus can be translated using the new model parameters until the error between the output English corpus and the first English corpus is within a preset error range, thereby determining that the model convergence is satisfied.

[0131] Among them, the number of training times in the training batch of the first parallel corpus pair / the second parallel corpus pair can reflect the number of interactions between the first parallel corpus pair / the second parallel corpus pair and the initial translation model, and the training sequence number in the training batch of the first parallel corpus pair / the second parallel corpus pair can reflect the interaction order of the first parallel corpus pair / the second parallel corpus pair in the initial translation model.

[0132] In combination with the above example, the training cycle frequency is 10, the training times of the first parallel corpus pair is 7, and the training sequence number of the training is 1; the training times of the second parallel corpus pair is 3, and the training sequence number of the training is 2. The smaller the number corresponding to the training sequence number, the earlier the training order of the parallel corpus pair corresponding to the training sequence number in a complete training cycle.

[0133] When the first parallel corpus pair is the first group of Chinese-English parallel corpus pairs, and the second parallel corpus pair is the second group of Chinese-English parallel corpus pairs, based on the training batches of the first parallel corpus pair and the training batches of the second parallel corpus pair, the initial translation model is trained according to the first parallel corpus pair and the second parallel corpus pair to obtain the target translation model. For example, at the beginning of the training cycle, the initial translation model is trained 7 times using the first group of Chinese-English parallel corpus pairs, and after the training is completed, the initial translation model is trained 3 times using the second group of Chinese-English parallel corpus pairs, and when it is determined that the error between the output monolingual corpus and the matching corpus corresponding to the input monolingual corpus meets the preset threshold, it is determined that the model convergence is met, and a trained Chinese-English translation model can be obtained.

[0134] Therefore, based on the training batches of the first parallel corpus pair and the training batches of the second parallel corpus pair, the initial translation model can be alternately trained using the first parallel corpus pair and the second parallel corpus pair to obtain a target translation model with higher accuracy.

[0135] Figure 3 This is a flow chart of another translation model training method provided by this embodiment. This embodiment is based on the above embodiment. When the target parallel corpus pair includes a first parallel corpus pair and a second parallel corpus pair, a possible implementation of S120 is as follows:

[0136] S1201. Determine a second parallel corpus pair according to the first parallel corpus pair.

[0137] Among them, the second parallel corpus pair can be a pseudo-parallel corpus pair of the first parallel corpus pair. The second parallel corpus pair determined on the basis of the first parallel corpus pair can effectively ensure the stickiness with the first parallel corpus pair, thereby facilitating the improvement of the stability of the training model.

[0138] Optionally, determining the second parallel corpus pair according to the first parallel corpus pair includes:

[0139] Training the initial translation model according to the first parallel corpus pair to obtain a first translation model;

[0140] A second parallel corpus pair is determined according to the low-frequency dictionary library of the first translation model.

[0141] When the first parallel corpus pair is a Chinese-English corpus pair, the initial translation model may be a neural network model, and the first translation model obtained by training the initial translation model may be a Chinese-English translation model.

[0142] The first translation model may include multiple dictionaries, such as a high-frequency dictionary library, a low-frequency dictionary library, etc. The low-frequency dictionary library may store some monolingual corpora with low frequency in the training samples of the first translation model.

[0143] Among them, determining the second parallel corpus pair according to the low-frequency dictionary library of the first translation model may include: determining a plurality of monolingual corpora according to the low-frequency dictionary library of the first translation model, and then inputting the plurality of monolingual corpora into the initial translation model respectively to obtain matching monolingual corpora corresponding to the plurality of monolingual corpora, thereby obtaining the second parallel corpus pair.

[0144] Therefore, by determining the second parallel corpus pair through the low-frequency dictionary library, the determined second parallel corpus pair can expand the corpus in the first parallel corpus pair, avoid the problem of missing low-frequency words in the model training samples affecting the model training accuracy, and improve the translation accuracy of the trained translation model.

[0145] Before determining the second parallel corpus pair according to the low-frequency dictionary library of the first translation model, the method further includes:

[0146] determining a low-frequency dictionary library of a first translation model;

[0147] According to the low-frequency dictionary library of the first translation model, a second parallel corpus pair is determined, including:

[0148] Determining a target monolingual corpus from a low-frequency dictionary library of a first translation model;

[0149] Determining a paired monolingual corpus of the target monolingual corpus according to the target monolingual corpus and the first translation model;

[0150] A second parallel corpus pair is determined according to the target monolingual corpus and the paired monolingual corpus.

[0151] According to training requirements, a preset number of target monolingual corpora can be determined from the low-frequency dictionary library of the first translation model, and the target monolingual corpora are respectively input into the first translation model to obtain paired monolingual corpora that match them.

[0152] For example, when the first translation model is a Chinese-English translation model, if the number of second parallel corpus pairs required is 500, 500 Chinese monolingual corpora can be determined from the low-frequency dictionary library of the Chinese-English translation model, and these Chinese monolingual corpora are respectively input into the Chinese-English model to obtain 500 English monolingual corpora corresponding to the Chinese monolingual corpora, so as to obtain 500 groups of Chinese-English parallel corpus pairs (such as the second parallel corpus pairs).

[0153] It should be noted that the first translation model corresponds to the target monolingual corpus and the paired monolingual corpus, that is, the corpus type of the input sample of the first translation model is the same as the corpus type of the target monolingual corpus, and the corpus type of the output sample is the same as the corpus type of the paired monolingual corpus.

[0154] For example, when the first translation model is a Chinese-English translation model, the target monolingual corpus may be a Chinese monolingual corpus, and the paired monolingual corpus matching the target monolingual corpus may be an English monolingual corpus.

[0155] Thus, some low-frequency words are determined as target monolingual corpus from the low-frequency dictionary library, and through the first translation model, paired monolingual corpus corresponding to the target monolingual corpus is obtained to obtain a second parallel corpus pair composed of low-frequency vocabulary, thereby expanding the comprehensiveness of the training samples of the translation model.

[0156] It should be noted that after determining the target monolingual corpus from the low-frequency dictionary of the first translation model, the target monolingual corpus may be updated before determining the paired monolingual corpus of the target monolingual corpus according to the target monolingual corpus and the first translation model.

[0157] Optionally, determining a low-frequency dictionary library of the first translation model includes:

[0158] A low-frequency dictionary is constructed based on candidate monolingual corpora in the first parallel corpus pair whose occurrence frequency is greater than a first preset threshold and less than a second preset threshold.

[0159] The low-frequency dictionary library may be determined from the input samples of the first translation model.

[0160] For example, when the initial translation model is trained using the first parallel corpus pair, multiple Chinese monolingual corpora can be input, and the first translation model is obtained after the training is completed, that is, the input samples of the first translation model include multiple Chinese monolingual corpora, and the low-frequency dictionary library can be composed of low-frequency corpora in the multiple Chinese monolingual corpora.

[0161] Among them, the first preset threshold can be set to 100, and the second preset threshold can be set to 300.

[0162] For example, the input sample of the first translation model includes 50,000 monolingual corpora, wherein the preset low-frequency threshold range may be 100 (such as the first preset threshold)-300 (such as the second preset threshold) (times), and the low-frequency word range can effectively select low-frequency monolingual corpora from a large number of monolingual corpora. For example, if the occurrence frequency of a part of the 50,000 monolingual corpora is in the range of 100-300 (times), these parts of the monolingual corpora and the paired corpora that match them can be added to the low-frequency dictionary library.

[0163] It should be noted that when the monolingual corpus has an appearance frequency lower than 100, it can be discarded and not included in the dictionary library of the first translation model.

[0164] Therefore, based on the set first preset threshold and the second preset threshold, appropriate monolingual corpus is selected to construct a low-frequency dictionary library with complete and stable corpus data.

[0165] Optionally, updating of the target monolingual corpus may include the following implementation methods.

[0166] Get random monolingual corpus;

[0167] Update the target monolingual corpus according to the weight of the candidate monolingual corpus and the weight of the random monolingual corpus.

[0168] The random monolingual corpus may be a new monolingual corpus different from the target monolingual corpus. Specifically, the random monolingual corpus may be determined by screening out corpus that is not in common words from a low-frequency dictionary library, and may include high-frequency monolingual corpus and / or low-frequency monolingual corpus, or may be obtained from other databases other than the low-frequency dictionary library of the first translation model. The random monolingual corpus may include high-frequency monolingual corpus and / or low-frequency monolingual corpus in other databases.

[0169] The same / different weights may be set for the candidate monolingual corpora and the random monolingual corpora to select an appropriate number of monolingual corpora to update the target monolingual corpora.

[0170] Among them, since the candidate monolingual corpora included in the low-frequency dictionary library are low-frequency corpora, the weight of the candidate monolingual corpora can be set to be larger than the weight of the random monolingual corpora to ensure that the target monolingual corpora are biased towards low-frequency corpora, so that the determined second parallel corpus pair can balance the monolingual corpora in the first parallel corpus pair.

[0171] For example, the weight of the candidate monolingual corpus may be set to 0.7, and the weight of the random monolingual corpus may be set to 0.3.

[0172] Before updating the target monolingual corpus according to the weights of the candidate monolingual corpus and the weights of the random monolingual corpus, data cleaning may be performed on the candidate monolingual corpus and the random monolingual corpus to ensure the integrity of the corpus.

[0173] Among them, data cleaning operations may include: corpus deletion, semantic correction, format unification, size alignment and other operations.

[0174] For example, when the candidate monolingual corpus and the random monolingual corpus are Chinese monolingual corpus, part of the Chinese monolingual corpus included therein may have repeated / redundant sentences, and the corresponding part of the repeated / redundant sentences may be deleted to achieve corpus deletion.

[0175] Combined with the above example, after the corpus is deleted, some of the Chinese monolingual corpus included in it may not have coherent sentences. The sentence can be semantically corrected based on the keywords in the sentence and the context of the sentence to achieve semantic correction.

[0176] Combined with the above examples, after semantic correction, some of the Chinese monolingual corpus included may have different sentence formats, such as line spacing, punctuation, and the beginning and end of paragraphs. In this case, a pre-prepared unified format can be used to unify the sentence format to achieve format unification.

[0177] In combination with the above example, after the format is unified, some Chinese monolingual corpus included therein may have different font sizes. These fonts can be aligned using a pre-prepared unified font to achieve size alignment.

[0178] It should be noted that the embodiments of the present disclosure do not specifically limit the order of the above-mentioned multiple cleaning operations in the actual cleaning process.

[0179] Among them, the corpus quality of the candidate monolingual corpus and the random monolingual corpus can be improved by performing data cleaning on the obtained candidate monolingual corpus and the random monolingual corpus.

[0180] Therefore, data cleaning of the candidate monolingual corpus and the random monolingual corpus can effectively ensure the corpus quality of the determined target monolingual corpus, and further improve the corpus quality of the second parallel corpus pair determined based on the target monolingual corpus.

[0181] S1202: Determine a target parallel corpus pair according to the second parallel corpus pair and the first parallel corpus pair.

[0182] In combination with the above example, when the first parallel corpus pair and the second parallel corpus pair are both Chinese-English corpus pairs, assuming that the first parallel corpus pair includes a first Chinese corpus and a second English corpus matching the first Chinese corpus, and the second parallel corpus pair includes a third Chinese corpus and a fourth English corpus matching the third Chinese corpus, then based on the matching relationship between the first Chinese corpus and the second English corpus, and the matching relationship between the third Chinese corpus and the fourth English corpus, the first Chinese corpus and the third Chinese corpus can be combined to obtain a combined Chinese corpus, and the second English corpus and the fourth English corpus can be combined to obtain a combined English corpus, then the corpus order in the combined Chinese corpus can be matched one by one with the corpus order in the combined English corpus to obtain the target parallel corpus pair.

[0183] For example, the first Chinese corpus includes: A1, A2 and A3, the second English corpus includes: B1 corresponding to A1, B2 corresponding to A2, and B3 corresponding to A3, the third Chinese corpus includes: C1, C2 and C3, and the fourth English corpus includes: D1 corresponding to C1, D2 corresponding to C2, and D3 corresponding to C3, then the obtained target parallel corpus pairs include: A1-B1, A2-B2, A3-B3, C1-D1, C2-D2 and C3-D3.

[0184] Among them, the second parallel corpus pair focuses on low-frequency corpus, which can effectively balance the corpus frequency in the first parallel corpus pair. Therefore, the corpus included in the determined target parallel corpus pair has both high-frequency corpus and low-frequency corpus, which can effectively improve the multi-faceted coverage of the target parallel corpus.

[0185] In addition, the second parallel corpus may be determined as the target parallel corpus pair, or the first parallel corpus pair may be determined as the target parallel corpus pair, thereby saving the processing time of the training samples.

[0186] This embodiment also provides a complete process diagram of the translation model training process. For details, please refer to Figure 4 As shown in the example.

[0187] Here, the training of English to Chinese translation model is used as an example.

[0188] S410: Obtain parallel corpora from Chinese to English, and clean them to obtain Chinese-English parallel corpus pairs.

[0189] The acquisition methods may include collecting online resources, manual construction, etc. Specifically, the number of monolingual corpora in each part of the parallel corpus may be 20 million.

[0190] Among them, the cleaning operation can be used to regularize the data for problems such as incomplete corpus, inconsistent punctuation, the need for unified format, and capitalization.

[0191] S420. Using the obtained Chinese-English parallel corpus pair, train a Chinese-English translation model.

[0192] Among them, the existing network model structure can be used to train a Chinese-English translation model.

[0193] Among them, regarding the setting of the model dictionary, the maximum number of Chinese-English parallel corpus pairs in the vocabulary can be 50,008 (the lowest word frequency can be 100, and those below 100 can be discarded), and the word frequencies are sorted from high to low. The words after 50,008 can be saved as a separate dictionary, called a low-frequency word dictionary.

[0194] S430: Use the Chinese-English translation model to decode the collected new monolingual Chinese to obtain the English corresponding to the monolingual Chinese, and obtain a Chinese-English pseudo-parallel corpus pair.

[0195] Among them, the new monolingual Chinese can be the monolingual Chinese in the above-mentioned low-frequency dictionary.

[0196] Among them, for a large number of new monolingual Chinese, a low-frequency dictionary is used to screen the corpus that is not in the common words from the monolingual corpus, and random monolingual Chinese is obtained from the corpus that is not in the common words. The random monolingual Chinese contains high-frequency corpus and low-frequency corpus. The weight of the random monolingual Chinese can be set to 0.3, that is, the number of random monolingual Chinese is 30% of the number of corpus in the Chinese-English pseudo-parallel corpus pair.

[0197] Among them, low-frequency monolingual Chinese in the low-frequency dictionary can be obtained, and the weight of these corpora can be set to 0.7, that is, the number of low-frequency monolingual Chinese is 70% of the number of corpora in the Chinese-English pseudo-parallel corpus pair.

[0198] Among them, the obtained Chinese-English pseudo-parallel corpus pairs can be cleaned to improve data quality.

[0199] S440. Obtain an English-Chinese translation model based on the Chinese-English parallel corpus pair and the Chinese-English pseudo-parallel corpus pair.

[0200] Among them, the training frequency within a cycle can be set to 8; in each cycle, batches 1-5 use Chinese-English parallel corpus pairs for model training, and batches 6-8 use Chinese-English pseudo-parallel corpus pairs for model training, realizing alternating training of parallel corpus and pseudo-parallel corpus.

[0201] It should be noted that during the training process, the ratio of the number of Chinese-English parallel corpus pairs to the number of Chinese-English pseudo-parallel corpus pairs can be 1:3.

[0202] Figure 5 : is a structural diagram of a translation model training device provided in this embodiment; the device is configured in an electronic device and can implement the translation model training method described in any embodiment of this application. The device specifically includes the following:

[0203] The acquisition module 510 is used to acquire a first parallel corpus pair, wherein the first parallel corpus pair includes: a corpus pair of a first monolingual corpus and a second monolingual corpus matching each other, or a corpus pair of a second monolingual corpus and a first monolingual corpus matching each other;

[0204] A determination module 520 is configured to determine a target parallel corpus pair according to the first parallel corpus pair, wherein the target parallel corpus pair includes: the first parallel corpus pair, and / or, a second parallel corpus pair, wherein the correspondence between the monolingual corpora in the second parallel corpus pair is the same as the correspondence between the monolingual corpora in the first parallel corpus pair;

[0205] The training module 530 is used to train the initial translation model according to the target parallel corpus pair to obtain a target translation model.

[0206] In this embodiment, optionally, the target parallel corpus pair includes: a first parallel corpus pair and a second parallel corpus pair;

[0207] The training module 530 includes: a first determining unit, a second determining unit and a training unit;

[0208] A first determining unit, used to determine the frequency of the training cycle;

[0209] A second determining unit is used to determine a training batch of the first parallel corpus pair and a training batch of the second parallel corpus pair within the training cycle frequency, wherein the training batch includes: a training number and a training sequence number;

[0210] A training unit is used to train an initial translation model based on the training batch of the first parallel corpus pair and the training batch of the second parallel corpus pair, according to the first parallel corpus pair and the second parallel corpus pair, to obtain a target translation model.

[0211] In this embodiment, the training unit is optionally used to:

[0212] Based on the weight of the first parallel corpus pair and the weight of the second parallel corpus pair, a training batch of the first parallel corpus pair and a training batch of the second parallel corpus pair are determined.

[0213] In this embodiment, optionally, the determination module 520 includes: a third determination unit and a fourth determination unit;

[0214] A third determining unit, configured to determine a second parallel corpus pair according to the first parallel corpus pair;

[0215] The fourth determining unit is configured to determine a target parallel corpus pair according to the second parallel corpus pair and the first parallel corpus pair.

[0216] In this embodiment, optionally, the third determining unit is specifically configured to:

[0217] Training an initial translation model according to the first parallel corpus pair to obtain a first translation model;

[0218] A second parallel corpus pair is determined according to the low-frequency dictionary library of the first translation model.

[0219] In this embodiment, optionally, the determination module 520 is further configured to determine a low-frequency dictionary library of the first translation model;

[0220] The third determining unit is specifically configured to:

[0221] Determining a target monolingual corpus from a low-frequency dictionary library of the first translation model;

[0222] Determining a paired monolingual corpus of the target monolingual corpus according to the target monolingual corpus and the first translation model;

[0223] A second parallel corpus pair is determined according to the target monolingual corpus and the paired monolingual corpus.

[0224] In this embodiment, optionally, the determination module 520 is specifically configured to:

[0225] A low-frequency dictionary is constructed based on candidate monolingual corpora in the first parallel corpus pair whose occurrence frequency is greater than a first preset threshold and less than a second preset threshold.

[0226] In this embodiment, optionally, the device of this embodiment further includes: an updating module;

[0227] The acquisition module 510 is also used to acquire random monolingual corpus;

[0228] An updating module updates the target monolingual corpus according to the weight of the candidate monolingual corpus and the weight of the random monolingual corpus.

[0229] Through the translation model training device of the embodiment of the present invention, by obtaining a first parallel corpus pair, the first parallel corpus pair includes: a corpus pair of a first monolingual corpus matching with a second monolingual corpus, or a corpus pair of a second monolingual corpus matching with the first monolingual corpus, a target parallel corpus pair is determined according to the first parallel corpus pair, wherein the target parallel corpus pair may include: the first parallel corpus pair and / or the second parallel corpus pair, thereby expanding the training samples of the translation model, and according to the target parallel corpus pair, the initial translation model is trained to obtain the target translation model, thereby effectively improving the training efficiency of the translation model.

[0230] The translation model training device provided in the embodiment of the present invention can execute the translation model training method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0231] Figure 6 is a schematic diagram of the structure of an electronic device provided by this embodiment, such as Figure 6 As shown, the electronic device includes a processor 610, a memory 620, an input device 630, and an output device 640; the number of the processor 610 in the electronic device can be one or more. Figure 6 A processor 610 is taken as an example; the processor 610, the memory 620, the input device 630 and the output device 640 in the electronic device can be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.

[0232] The memory 620, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the translation model training method in the embodiment of the present invention. The processor 610 executes various functional applications and data processing of the electronic device by running the software programs, instructions and modules stored in the memory 620, that is, implements the translation model training method provided in the embodiment of the present invention.

[0233] The memory 620 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 620 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 620 may further include a memory remotely arranged relative to the processor 610, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0234] The input device 630 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the electronic device, and may include a keyboard, a mouse, etc. The output device 640 may include a display device such as a display screen.

[0235] This embodiment also provides a storage medium containing computer executable instructions, which, when executed by a computer processor, are used to implement the translation model training method provided in the embodiment of the present invention.

[0236] Of course, the computer executable instructions of a storage medium containing computer executable instructions provided in an embodiment of the present invention are not limited to the operations of the method described above, and can also execute related operations in the translation model training method provided in any embodiment of the present invention.

[0237] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0238] It is worth noting that in the embodiment of the above-mentioned search device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0239] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0240] The above description is only a specific implementation of the present embodiment, so that those skilled in the art can understand or implement the present embodiment. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present embodiment. Therefore, the present embodiment will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A translation model training method, characterized in that: include: Acquire a first parallel corpus pair, wherein the first parallel corpus pair includes: a corpus pair of a first monolingual corpus and a second monolingual corpus matching each other, or a corpus pair of a second monolingual corpus and a first monolingual corpus matching each other; Determining a target parallel corpus pair according to the first parallel corpus pair, the target parallel corpus pair comprising: the first parallel corpus pair, and / or, a second parallel corpus pair, the correspondence between the monolingual corpora in the second parallel corpus pair being the same as the correspondence between the monolingual corpora in the first parallel corpus pair; Training an initial translation model according to the target parallel corpus pair to obtain a target translation model; In the case where the target parallel corpus pair includes a first parallel corpus pair and a second parallel corpus pair, the second parallel corpus pair is determined based on the first parallel corpus pair, wherein determining the target parallel corpus pair based on the first parallel corpus pair includes: training an initial translation model based on the first parallel corpus pair to obtain a first translation model; determining the second parallel corpus pair based on a low-frequency dictionary library of the first translation model; The step of determining a second parallel corpus pair according to the low-frequency dictionary library of the first translation model comprises: Determining a target monolingual corpus from a low-frequency dictionary library of the first translation model; Determining a paired monolingual corpus of the target monolingual corpus according to the target monolingual corpus and the first translation model; A second parallel corpus pair is determined according to the target monolingual corpus and the paired monolingual corpus.

2. The method according to claim 1, characterized in that The target parallel corpus pair includes: a first parallel corpus pair and a second parallel corpus pair; The step of training the initial translation model according to the target parallel corpus pair to obtain the target translation model comprises: Determine the frequency of training cycles; Determine, within the training cycle frequency, a training batch of the first parallel corpus pair and a training batch of the second parallel corpus pair, wherein the training batch includes: a training number and a training sequence number; Based on the training batch of the first parallel corpus pair and the training batch of the second parallel corpus pair, an initial translation model is trained according to the first parallel corpus pair and the second parallel corpus pair to obtain a target translation model.

3. The method according to claim 2, characterized in that The determining of the training batch of the first parallel corpus pair and the training batch of the second parallel corpus pair includes: Based on the weight of the first parallel corpus pair and the weight of the second parallel corpus pair, a training batch of the first parallel corpus pair and a training batch of the second parallel corpus pair are determined.

4. The method according to claim 2, characterized in that: The determining a target parallel corpus pair according to the first parallel corpus pair comprises: Determine a second parallel corpus pair according to the first parallel corpus pair; A target parallel corpus pair is determined according to the second parallel corpus pair and the first parallel corpus pair.

5. The method according to claim 1, characterized in that Before determining the second parallel corpus pair according to the low-frequency dictionary library of the first translation model, the method further includes: A low-frequency dictionary library of the first translation model is determined.

6. The method according to claim 5, characterized in that The step of determining a low-frequency dictionary library of the first translation model comprises: A low-frequency dictionary is constructed based on candidate monolingual corpora in the first parallel corpus pair whose occurrence frequency is greater than a first preset threshold and less than a second preset threshold.

7. The method according to claim 6, characterized in that Before determining the paired monolingual corpus of the target monolingual corpus according to the target monolingual corpus and the first translation model, the method further includes: Get random monolingual corpus; The target monolingual corpus is updated according to the weight of the candidate monolingual corpus and the weight of the random monolingual corpus.

8. A translation model training device, characterized in that: include: An acquisition module, configured to acquire a first parallel corpus pair, wherein the first parallel corpus pair includes: a corpus pair matching a first monolingual corpus and a second monolingual corpus, or a corpus pair matching a second monolingual corpus and a first monolingual corpus; a determination module, configured to determine a target parallel corpus pair according to the first parallel corpus pair, wherein the target parallel corpus pair includes: the first parallel corpus pair, and / or, a second parallel corpus pair, wherein the correspondence between the monolingual corpora in the second parallel corpus pair is the same as the correspondence between the monolingual corpora in the first parallel corpus pair; A training module, used for training the initial translation model according to the target parallel corpus pair to obtain a target translation model; In the case where the target parallel corpus pair includes a first parallel corpus pair and a second parallel corpus pair, the second parallel corpus pair is determined based on the first parallel corpus pair, wherein the determination module includes: a third determination unit, specifically configured to: train an initial translation model based on the first parallel corpus pair to obtain a first translation model; determine the second parallel corpus pair based on a low-frequency dictionary library of the first translation model; The third determining unit is specifically configured to: Determining a target monolingual corpus from a low-frequency dictionary library of the first translation model; Determining a paired monolingual corpus of the target monolingual corpus according to the target monolingual corpus and the first translation model; A second parallel corpus pair is determined according to the target monolingual corpus and the paired monolingual corpus.

9. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the translation model training method as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the translation model training method as described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Mongolian-Chinese machine translation method of pseudo-parallel corpus fused with transfer learning

    CN113657122A