Compare sequence to sequence data selector

By training the neural translation model on noisy data, using comparison scores to determine data quality and dynamically scheduling training data, the problem of inaccurate translation caused by noisy data is solved, and more accurate and efficient translation model training is achieved.

CN112602098BActive Publication Date: 2024-09-06GOOGLE LLC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201980046281.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2018-05-08
Filing Date
2019-04-05
Publication Date
2024-09-06
Estimated Expiration
2039-04-05

AI Technical Summary

Technical Problem

When the neural translation model is trained on noisy parallel data, the learned distribution is inaccurate, resulting in inaccurate translation, and large-scale high-quality data that is clean and matches the test domain is rare, which may be possible when automatic data miners process parallel data. Introducing serious noise, it is difficult for existing technology to effectively solve this problem.

Method used

By using data processing hardware, first generate the base model on the first data set, then generate the adaptive model on the second data set, use the comparison score to determine the quality probability of the data pair, and train the target model on the third data set, dynamically Schedule high-quality data to improve training results.

Benefits of technology

Through this method, more accurate translation models can be generated, the impact of noisy data can be reduced, translation quality can be improved, computing resources can be saved, and training efficiency can be improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112602098B_ABST
    Figure CN112602098B_ABST
Patent Text Reader

Abstract

A method (1000) for training a sequence-to-sequence data selector includes generating a base model (134) by training with a first data set (132) of data pairs (133), generating an adapted model (144) by training the base model on a second data set (142) of data pairs (143). The method also includes determining a contrast score (154) for each data pair (153) of a third data set (152) of data pairs using the base model and the adapted model. The contrast score indicates a quality probability of the corresponding data pair. The method also includes training a target model (230) using the data pairs of the third data set and the contrast score.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to a contrastive sequence-to-sequence data selector for training a neural translation model on noisy data. Background Art

[0002] Neural translation models learn to distribute probability masses over translations. Model trainers typically train the model on parallel data so that more confident translations are given higher probabilities than less confident translations. If trained on noisy parallel data, the learned distribution will be inaccurate, resulting in imprecise translations.

[0003] However, large-scale high-quality data that is clean and matches the test domain is rare. Automatic data miners usually generate parallel data, and sentence aligners process the parallel data. The processing of parallel data may introduce severe noise to the parallel data. Usually, the trainer solves this problem as a classification problem by training a convolutional network to classify good or bad data with a small amount of clean data (or in-domain data). The trainer then uses the selected data to train a system with a different architecture from the selector. Therefore, the data identified as good data by the selector is not necessarily good data for the final model. Summary of the invention

[0004] One aspect of the present disclosure provides a method for training a target model. The method includes: generating a base model by training with a first data set of a data pair by data processing hardware, and generating an adaptation model by training the base model on a second data set of the data pair by data processing hardware. The method also includes, by the data processing hardware, determining a comparison score for each data pair of a third data set of the data pair using the base model and the adaptation model. The comparison score indicates the quality probability of the corresponding data pair. The method also includes training the target model using the data pairs and the comparison score of the third data set by the data processing hardware.

[0005] Implementations of the present disclosure may include one or more of the following optional features. In some embodiments, training the target model also includes using data pairs of the third data set that meet a threshold comparison score. In some examples, the method also includes: determining, by data processing hardware, that the target model is the same size as the base model; and replacing the base model with an adaptation model by the data processing hardware; replacing the adaptation model with the target model by the data processing hardware; determining, by the data processing hardware, a comparison score for each data pair of a fourth data set of data pairs using the base model and the replaced adaptation model; and training subsequent target models using the data pairs and comparison scores of the fourth data set by the data processing hardware. In other examples, the target model is larger than the base model.

[0006] The first data set may include random data. Here, when the first data set includes random data, the second data set may include cleaner data than the random data of the first data set. Additionally or alternatively, the contrast score may include Kullback-Leibler (KL) divergence and / or each data set may include sentence language pairs.

[0007] In some embodiments, the method further includes sorting the data pairs of the third data set by the data processing hardware based on the respective contrast scores. In these examples, training the target model may further include generating multiple data batches and using each data batch to train the target model. Here, each data batch includes at least one data pair, and wherein the probability of including the selected data pair in the selected data batch is based on the respective contrast scores of the selected data pair, and wherein the probability increases as the respective contrast scores increase. In addition, in these examples, generating multiple data batches may include: determining a selection rate for each data batch; determining a batch size for each data batch based on the selection rate and the number of data pairs in the third data set; selecting the number of data pairs corresponding to the determined batch size from the third data set; sorting the selected data pairs based on their respective contrast scores; removing the selected data pairs with the lowest contrast score from the data batch. The removal rate includes the inverse of the selection rate. The selection rate may decrease over training time. In this case, the batch size may be equal to a fixed batch size divided by the selection rate.

[0008] Another aspect of the present disclosure provides a system for training a target model. The system includes data processing hardware and memory hardware that communicates with the data processing hardware and stores instructions, which, when executed by the data processing hardware, cause the data processing hardware to perform operations. These operations include training to generate a base model using a first data set of data pairs, and generating an adaptation model by training the base model on a second data set of data pairs. These operations also include determining a comparison score for each data pair of a third data set of data pairs using the base model and the adaptation model. The comparison score indicates the quality probability of the corresponding data pair. These operations also include training the target model using the data pairs and the comparison score of the third data set.

[0009] This aspect may include one or more of the following optional features. In some embodiments, training the target model further includes using data pairs of the third data set that meet a threshold contrast score. In some examples, the operation also includes: determining that the target model is the same size as the base model; and replacing the base model with the adapted model; replacing the adapted model with the target model; using the base model and the replaced adapted model, determining a contrast score for each data pair of a fourth data set of data pairs; and training a subsequent target model using the data pairs and contrast scores of the fourth data set. In other examples, the target model is larger than the base model.

[0010] The first data set may include random data. Here, when the first data set includes random data, the second data set may include cleaner data than the random data of the first data set. Additionally or alternatively, the contrast score may include Kullback-Leibler (KL) divergence and / or each data set may include sentence language pairs.

[0011] In some embodiments, the operation further includes sorting the data pairs of the third data set based on their respective contrast scores. In these examples, training the target model may further include generating multiple data batches and using each data batch to train the target model. Here, each data batch includes at least one data pair, and wherein the probability of selecting a data pair to be included in the selected data batch is based on the corresponding contrast score of the selected data pair, and wherein the probability increases as the corresponding contrast score increases. In addition, in these examples, generating multiple data batches may include: determining a selection rate for each data batch; determining a batch size for each data batch based on the selection rate and the number of data pairs in the third data set; selecting the number of data pairs corresponding to the determined batch size from the third data set; sorting the selected data pairs based on their respective contrast scores; removing the selected data pairs from the data batch with the lowest contrast score. The removal rate includes the inverse of the selection rate. The selection rate may decrease over training time. In this case, the batch size may be equal to a fixed batch size divided by the selection rate. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 is a schematic diagram of an example system for comparing sequence to sequence data selectors.

[0013] Figure 2 yes Figure 1 A diagram of example components of a target model trainer for .

[0014] Figure 3 yes Figure 2 Schematic diagram of an example data batch generator for .

[0015] Figure 4 is an example graph of selectivity decreasing over time.

[0016] Figure 5 is an example graph of data batch size increasing over time.

[0017] Figure 6 is an example diagram of dynamic data scheduling.

[0018] Figure 7 Is used for Figure 1 An example flowchart of an example system training a target model.

[0019] Fig. 8A and8B yes Figure 1 Example graph of the system's ratings compared to human ratings.

[0020] Fig. 9 Is used for Figure 1 Another example flowchart of an example system for training a target model.

[0021] Fig.10 is a flowchart of an example method for iteratively training a target model.

[0022] Fig.11 is a schematic diagram of an example computing device that can be used to implement the systems and methods described herein.

[0023] In the various drawings, the same reference symbols represent the same elements. DETAILED DESCRIPTION

[0024] Embodiments of the present invention are directed to a model trainer configured to generate a small sequence-to-sequence base model (e.g., for a neural network) by training a base model with a first dataset of noisy data pairs. Noise data is defined as unclean or parallel data, or data that does not fully match a test domain. Such noisy data can result in an inaccurate probability distribution over examples. The model trainer then generates a small sequence-to-sequence adaptation model by training the base model with a second dataset of data pairs. The second dataset includes data of higher quality than the first dataset. The model trainer generates a target model by determining a contrast score for each data pair of a third dataset, sorting the third dataset according to the contrast score, and selecting the best quality portion from the sorted dataset to train the target model.

[0025] refer to Figure 1 In some implementations, the example system 100 includes a computing system 110 that executes a model trainer 120. The computing system 110 may correspond to a remote system or computing device, such as a desktop workstation or a laptop workstation. The remote system 110 may be a single computer, multiple computers, or a distributed system (e.g., a cloud environment) with scalable / elastic computing resources 112 (e.g., data processing hardware) and / or storage resources 114 (e.g., storage hardware).

[0026] In some examples, the data processing hardware 112 of the computing system 110 executes a model trainer 120, which includes a base model generator 130, an adaptation model generator 140, a score determiner 150, and a target model trainer 200. The base model generator 130 receives a first data set 132 of sentence data pairs 133, 133a-n for training a sequence-to-sequence base model 134 until convergence. Each sentence data pair 133 includes a first sentence in a first language and a second sentence, the second sentence being a potential translation of the first sentence into a second language. The first data set 132 typically includes random noise data.

[0027] The adaptation model generator 140 uses the sequence-to-sequence base model 134 generated by the base model generator 130 based on the first data set 132 of sentence data pairs 133 and the second data set 142 of sentence pairs 143, 143a-n to gradually train the sequence-to-sequence adaptation model 144. Similar to the first data set 132, each sentence data pair 143a-n of the second data set 142 includes a first sentence in a first language and a second sentence, which is a potential translation of the first sentence into the second language. The second data set 142 may include cleaner data than the random data of the first data set 132. For example, the second data set 142 may include a relatively small amount (compared to the first data set 132) of artificially organized high-quality data. This enables the adaptation model 144 to transform the probability mass from poor parallel (or noisy) data to better parallel (cleaner) data. The transformation allows the use of contrast information to determine the quality associated with the data pairs evaluated by the base model 134 and the adaptation model 144.

[0028] Typically, given a dataset S of sentence pairs, S = {s0,…,s i ,…}, where s i is the i-th sentence pair, the score determiner 150 executing the data selection method is usually based on the score function For i A score 154 is assigned. The score reflects the desired quality. For example, the higher the score, the cleaner the data (or the better match to the domain, or the more difficult it is for curriculum learning, or the more uncertain it is for active learning). The trainer 120 can use the score 154 to generate hard data filtering, for example, based on or meeting a threshold comparison score. Alternatively, the trainer 120 uses the score 154 softly, for example, for weighting.

[0029] The selection method also defines a strategy for scheduling data based on the score 154. Using the static selection strategy, data is selected offline and used in a random order during training. On the other hand, the dynamic selection strategy attempts to schedule data in order based on the score function during ongoing training. The static version is a specific implementation of the dynamic selection. The dynamic scheduling by the dynamic selection strategy produces a dynamic example sampling effect that can achieve example weighting.

[0030] Still reference Figure 1 , the score determiner 150 is configured to receive a third data set 152 having sentence pairs 153, 153a-n (e.g., data pairs 153, 153a-n), a sequence-to-sequence base model 134, and a sequence-to-sequence adaptation model 144, for determining a corresponding contrast score 154, 154a-n for each sentence pair 153 in the third data set 152. Each contrast score 154 indicates a probability of quality or cleanliness associated with the corresponding data pair 153. Optionally, the contrast score 154 includes a Kullback-Leibler (KL) divergence. The KL divergence (also known as relative entropy) is a measure of the deviation between a probability distribution and a second expected probability distribution. Specifically, the adaptation model 144, p(S i )=p(t i |s i ) and the basic model 134,q(S i )=q(t i |s i ) can be used to determine the sentence pair S according to the following equation i =(s i ,t i ) with a comparison score of 154 (or quality metric):

[0031]

[0032] Since distribution p is a cleaner model, distribution p shifts the probability mass from the worse data to the better data. Therefore, if p(S i ) is greater than q(S i ), then S i will likely provide good information gain. However, even with information gain, S i Still, there may be rare examples or usages, and p(S i ) is used to determine this. Because the score determiner 150 uses the probability between the sequence-to-sequence basis 134 and the adaptation model 144, no separate measure of data quality or cleanliness or domain is required. Because data quality relates to the probability mass distribution, high-quality data (e.g., clean or matching data) enables the model to produce a more accurate distribution. Therefore, equation (1) can represent a unified measure for data quality.

[0033] As discussed in more detail below, the target model trainer 200 receives and uses the contrast scores 154 and the third data set 152 to train the target model 230. In some examples, the target model trainer 200 sorts the data pairs 153 of the third data set 152 based on the corresponding contrast scores 154. Based on the correlation between training time and the resulting model size, the target model 230 can be larger than both the adaptation model 144 and the base model 134. Therefore, generating a small base model 134 and an equally small adaptation model 144 will significantly reduce computational overhead and train much faster than the larger target model 230, thereby saving a lot of time. Optimally, the base model 134 and the adaptation model 144 share a similar architecture (e.g., sequence to sequence) with the target model 230, because the similarity between the models 134, 144, 230 will enable the selector (base model 134 and adaptation model 144) to select the best sentence pair for the target model 230.

[0034] Reference now Figure 2 In some embodiments, the target model trainer 200 includes a data batch generator 300 that generates data batches 210, 210a-n of statement pairs 153 using the third data set 152 and the contrast scores 154. That is, the data batch 210 is a subset of the statement pairs 153 of the third data set 152. The data batch generator 300 generates a plurality of data batches 210, each data batch 210 having a different number of data pairs 153 and subsets of data pairs 153. The contrast scores 154 of the selected statement pairs 153 determine the probability that the data pairs 153 are included in the selected data batch 210. For example, an increased contrast score 154 may reflect a correspondingly increased probability of including the data pair 153 in the data batch 210. The trainer 600 trains the target model 230 using the data batches 210.

[0035] The contrast score 154 can be used to rank the statement pairs 153 to select and use the static top x% of data to train the target model 230, and discard 1-x% of the statement pairs 153. However, when the training data is small, this static offline selection is problematic because discarding some (e.g., 1-x%) of the total data means reducing the size of the training data. In addition, when the training data is mostly lower quality data (e.g., non-parallel or mostly out of domain), a smaller x% is beneficial so that the selected data has a good enough quality. In both cases, the selected training data may not be sufficient to train the target model 230, but a larger x% will make the selected training data noisy again, thereby compromising the effect of data selection.

[0036] The dynamic data scheduling method allows the model trainer 120 to train the target model 230 on the entire data set, but also to benefit from the quality of the data selection. The model trainer 120, via the target model trainer 200, achieves the above purpose by training the target model 230 on unselected data at the beginning of training, but gradually selecting high-quality data until the end of training. In other words, dynamic data scheduling allows the target model trainer 200 to take advantage of training data of different qualities that increase from lower quality training data to higher quality training data.

[0037] Typically, a model trainer uses random data to train a model with data batches of a fixed batch size b (e.g., b=256). For example, for each data batch, a typical trainer may randomly select 256 data pairs from the dataset for each data batch. However, with dynamic data selection, the data batch size b(t) increases over time, and in order to maintain a fixed batch size, data selection is used to select higher quality data. Now refer to Figure 3 , in order to generate the data batches 210, the data batch generator 300 of the target model trainer 200 may include a selection rate determiner 310 to determine the selection rate 312, 312a-n of each data batch 210. For example, the selection rate r(t) 312 may be defined as a global step (time) function as follows:

[0038]

[0039] refer to Figure 4 , the example graph 400 shows that the selection rate r(t) 312 decreases exponentially over time, such that it is halved every T steps until it reaches a determined lower limit value R (e.g., R=0.2). That is, with each generated data batch 210, the selection rate r(t) 312 decreases. The determined lower limit value R ensures that r(t) does not become too small and introduce selection bias. Referring again to Figure 3 The data batch generator 300, the batch size determiner 320 can determine the corresponding batch size 322, 322a-n for each data batch 210. The data batch size 322 can be based on the selection rate r(t) 312 and the fixed batch size b 324. For example, the data batch size b(t) 322 can be defined as follows:

[0040]

[0041] Figure 5 An example graph 500 is shown, which depicts the data batch size b(t) 322 as a function of Figure 4 The selection rate r(t)

[0042] 312 decreases until the data batch size b(t) 322 reaches a maximum value b / R and remains there until the training is completed. Figure 4 ) may decrease with training time. Figure 3 , after the batch size determiner 320 determines the data batch size 322, the data pair selector 330 selects a plurality of data pairs 342 associated with the determined batch size b(t) 322 from the third data set 152. The selection is typically random, but other selection methods may be used. After the selection, the data pair sorter 340 sorts the selected data pairs 342 based on the corresponding contrast score 154 of each selected data pair. The data pair remover 350 then removes the scored and sorted data pairs with the lowest contrast score 154 from the data batch 210 at a removal rate. The removal rate is equal to the inverse of the selection rate, i.e., 1-r(t). For example, when r(t)=0.5, 50% of the selected data pairs 342 (50% with the lowest contrast score 154) will be removed from the data batch 210. Thus, the effective batch size for training the target model 230 remains the same as for typical training, but the data batch 210 contains the top selection rate r(t) 312 of the selected data pairs 153, so that the quality improves as training progresses (or as t increases). For example, for b=256 and r(t)=0.5, b(t) will be equal to 512, where the top (comparative score) 50% will be selected for the final batch size of 256 (because r(t)=0.5).

[0043] Reference now Figure 6 , as the training time t passes, the trainer 600 of the target model training 200 receives data batches 210 with increasingly higher quality (i.e., less noise and cleaner), although this is achieved on each data batch rather than on all data globally. This reflects cross-batch example weighting. Typical examples are weighted in data batches 210, so the model trainer can assign weights to examples based on the quality of the examples. Even if the intra-batch weighting reduces the weight of low-quality examples, the selector will still mix in low-quality examples and pollute the data with noise. Cross-batch examples increase the weight of good examples by using them more frequently in different, later data batches. In the example shown, the trainer 600 selects the darkest shaded (best) example three times in three time steps, and only selects the lightest shaded (worst) example once. Low-quality examples disappear from later data batches to reduce the weight of low-quality examples, thereby improving the data quality of these batches. The target model 230 trained with data from higher-quality data batches 210 in consecutive steps can generally improve the translation quality of the target model 230.

[0044] Figure 7A flowchart 700 for training the target model 230 using dynamic contrast data selection is shown. Figure 1-3 Describe the decision diagram 700. The score determiner 150 receives a third data set 152 having statement pairs 153, 153a-n, a sequence-to-sequence base model 134, and a sequence-to-sequence adaptation model 144, for determining a corresponding contrast score 154, 154a-n for each statement pair 153 in the third data set 152. In particular, the score determiner 150 scores b(t) random examples and feeds the selected examples to the target model trainer 200 to obtain a loss. When training a neural network, the loss reflects the error made by the neural network relative to the best or most reliable model (e.g., a gold standard) available at one time in training. The target model trainer 200 trains the parameters in the target model 230 only when the parameters of the base model 134 and the adaptation model 144 are frozen. As previously described, the contrast model can be much smaller than the target model 230 to reduce computational overhead. Importantly, the contrast score 154 is related to the quality of the data. Here, the model trainer 120 determines that the size of the target model 230 (e.g., 8x1024) is larger than the size of the base model 134 (e.g., 3x512) and the size of the adapted model 144 (e.g., 3x512).

[0045] Reference now Fig. 8A and 8B , the human cleanliness scores of two thousand (2,000) sentence pairs are plotted against the corresponding human cleanliness scores and the associated contrast scores 154. Fig. 8A In , the English to Spanish translation and the English to Chinese translation are averaged and plotted against the oracle (human) scores in Figure 800a. Figure 8B In , the English to Bengali translation and the English to Hindi translation are averaged and plotted against the oracle score in Figure 800b. These graphs 800a, 800b show that as the comparison score 154 decreases, the data quality decreases accordingly.

[0046] Reference now Fig. 9900, in some embodiments, the model trainer 120 determines that the target model 230 has the same size (e.g., 3×512) as the base model 134 and the adaptation model 144. For example, if the target model 230 is determined to be the same size as the base model 134 and the adaptation model 144, the model trainer 120 replaces the base model 134 with the adaptation model 144, and replaces the adaptation model 144 with the target model 230. The model trainer 120 then uses the new base model 134 and the new adaptation model 144 to determine the contrast score 154 for each data pair of the fourth data set 910 of the data pairs 911. The model trainer 120 then trains subsequent target models 230 using the data pairs of the fourth data set 910. This process may continue indefinitely. In this way, the target model 230 can be gradually improved. If the size of target model 230 is different from the size of adapted model 144 and base model 134, model trainer 120 may derive a modified target model of the same size as adapted model 144 and base model 134 from target model 230. After the training iterations are completed, the modified target model may be used to update or regenerate the target model 230 of the original size.

[0047] Fig.10 1 is a flow chart of an example method 1000 for training a contrast sequence to sequence data selector. The flow chart begins at operation 1002, generating a base model 134 by training on a first data set 132 of a data pair 133 on data processing hardware 112. In some examples, the first data set 132 includes random data. At operation 1004, the method 1000 includes generating an adapted model 144 by training the base model 134 on a second data set 142 of a data pair 143 by the data processing hardware 112. Optionally, the second data set 142 may include data that is cleaner (e.g., organized by a human) than the random data of the first data set 132. At operation 1006, the method 1000 includes determining, by the data processing hardware 112, a contrast score 154 for each data pair 153 of a third data set 152 of data pairs 153, 153a-n using the base model 134 and the adapted model 144. The contrast score 154 may include a KL divergence. At operation 1008, the method 1000 further includes training the target model 230 using the data pairs 153 and the contrast scores 154 of the third data set 152 by the data processing hardware 112. In some embodiments, the method 1000 includes training the target model 230 using the data pairs 153 of the third data set 152 that meet the threshold contrast score 154. Each data set 132, 142, 152 can include sentence language pairs. In addition, the target model 230 can be larger than the base model 134 and the adaptation model 144.

[0048] In some examples, the method 1000 also includes sorting, by the data processing hardware 112, the data pairs 153 of the third data set 152 based on the corresponding contrast scores 154. Optionally, the method 1000 includes generating a plurality of data batches 210, wherein each data batch 210 includes at least one data pair 153, and wherein the probability of selecting the data pair 153a to be included in the selected data batch 210a is based on the corresponding contrast score 154a of the selected data pair 153a. As the corresponding contrast score 154a increases, the probability of including the selected data pair 153a increases. Then, the method 1000 includes using each data batch 210 to train the target model 230. Generating the plurality of data batches 210 may include determining a selection rate 312 for each data batch 210 and determining a batch size 322 for each data batch 210, wherein the batch size 322 is based on the selection rate 312 and the fixed batch size 324. In addition, generating a plurality of data batches 210 also includes selecting a plurality of data pairs 153 corresponding to the determined batch size 322 from the third data set 152, sorting the selected data pairs 342 based on the corresponding contrast scores 154, and removing the selected pairs 342 with the lowest contrast scores 154 from the data batch 210. Optionally, the selection rate 312 decreases with the training time. The batch size 322 can be equal to the fixed batch size 324 divided by the selection rate 312.

[0049] Alternatively, the method 1000 includes: determining, by the data processing hardware 112, that the target model 230 has the same size as the base model 134, and replacing the base model 134 with the adapted model 144 by the data processing hardware 112. When the size of the target model 230 is the same as the size of the base model 134, the method 1000 also includes, by the data processing hardware 112, replacing the base model 134 with the adapted model 144, and replacing the adapted model 144 with the target model 230 by the data processing hardware 112. Then, the method 1000 includes determining, by the data processing hardware 112, a comparison score 154 for each data pair of the fourth data set 910 of the data pairs 911 using the base model 134 and the replaced adapted model 144, and training a subsequent target model 230 using the data pairs and the comparison scores 154 of the fourth data set 910 by the data processing hardware 112.

[0050] Fig.11 1 is a schematic diagram of an example computing device 1100 that can be used to implement the systems and methods described in this document. Computing device 1100 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The components shown herein, their connections and relationships, and their functions are intended to be examples only and are not intended to limit implementations of the inventions described and / or claimed in this document.

[0051] The computing device 1100 includes a processor 1110 (e.g., data processing hardware), a memory 1120, a storage device 1130, a high-speed interface / controller 1140 connected to the memory 1120 and a high-speed expansion port 1150, and a low-speed interface / controller 1160 connected to a low-speed bus 1170 and the storage device 1130. Each component 1110, 1120, 1130, 1140, 1150, and 1160 is connected to each other by using different buses, and each of the above components can be installed on a common motherboard or installed in other ways as needed. The processor 1110 can process instructions executed within the computing device 1100, including instructions stored in the memory 1120 or on the storage device 1130 to display graphical information of a graphical user interface (GUI) on an external input / output device, such as a display 1180 coupled to the high-speed interface 1140. In other embodiments, multiple processors and / or multiple buses may be used with multiple memories and multiple types of memories if desired. Similarly, multiple computing devices 1100 may be connected, with each device providing a portion of the necessary operations (e.g., as a server array, a group of blade servers, or a multi-processor system).

[0052] The memory 1120 stores information non-temporarily within the computing device 1100. The memory 1120 may be a computer-readable medium, a volatile memory unit(s), or a non-volatile memory unit(s). The non-volatile memory 1120 may be a physical device for storing programs (e.g., sequences of instructions) or data (program state information) for use by the computing device 1100 on a temporary or permanent basis. Examples of non-volatile memory include, but are not limited to, flash memory and read-only memory (ROM) / programmable read-only memory (PROM) / erasable programmable read-only memory (EPROM) / electrically erasable programmable read-only memory (EEPROM) (e.g., commonly used for firmware such as boot programs). Examples of volatile memory include, but are not limited to, random access memory (RAM), dynamic random access memory (DRAM), static random access memory (SRAM), phase change memory (PCM), and optical disks or magnetic tapes.

[0053] The storage device 1130 can provide mass storage for the computing device 1100. In some embodiments, the storage device 1130 is a computer-readable medium. In various embodiments, the storage device 1130 can be a floppy disk device, a hard disk device, an optical disk device, or a tape device, a flash memory or other similar solid-state memory device, or a device array, including: a device in a storage area network or other configuration. In additional embodiments, the computer program product is tangibly embodied as an information carrier. The computer program product contains instructions that, when executed, perform one or more methods, such as the methods described above. The information carrier is a computer-readable medium or a machine-readable medium, such as a memory 1120, a storage device 1130, or a memory on a processor 1110.

[0054] The high-speed controller 1140 manages bandwidth-intensive operations of the computing device 1100, while the low-speed controller 1160 manages lower bandwidth intensive operations. This allocation of functions is merely exemplary. In some embodiments, the high-speed controller 1140 is coupled to the memory 1120, the display 1180 (e.g., through a graphics processor or accelerator), and is coupled to the high-speed expansion port 1150, which can accept various expansion cards (not shown). In some embodiments, the low-speed controller 1160 is coupled to the storage device 1130 and the low-speed expansion port 1190. The low-speed expansion port 1190 can include various communication ports (e.g., USB, Bluetooth, Ethernet, and wireless Ethernet) and can be coupled to one or more input / output devices, such as a keyboard, a pointing device, a scanner, or a network device such as a switch or router, for example, through a network adapter.

[0055] As shown, computing device 1100 may be implemented in a variety of forms. For example, computing device 1100 may be implemented as a standard server 1100a, or multiple times in a group of such servers 1100a, or as a laptop computer 1100b, or as part of a rack-mounted server system 1100c.

[0056] Various implementations of the systems and techniques described herein can be implemented in digital electronic and / or optical circuit systems, integrated circuit systems, dedicated ASICs (application specific integrated circuits), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that can be executed and / or interpreted on a programmable system that includes at least one programmable processor that can be either special or general purpose and can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0057] A software application (i.e., software resource) may refer to computer software that enables a computing device to perform tasks. In some examples, a software application may be referred to as an "application," "application program," or "program." Example applications include:

[0058] but are not limited to, system diagnostic applications, system management applications, system maintenance applications, word processing applications, spreadsheet applications, messaging applications, media streaming applications, social networking applications, and gaming applications.

[0059] These computer programs (also referred to as programs, software, software applications, or code) include machine instructions for programmable processors, and these computer programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, non-transitory computer-readable medium, device, and / or device (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.

[0060] The process and logic flow described in this specification can be performed by one or more programmable processors, which execute one or more computer programs to perform functions by operating input data and generating outputs. The process and logic flow can also be performed by a dedicated logic circuit such as an FPGA (field programmable gate array) or an ASIC (application-specific integrated circuit). Processors suitable for executing computer programs include: for example, general-purpose microprocessors, special-purpose microprocessors, and any one or more processors of any type of digital computer. In general, the processor will receive instructions and data from a read-only memory or a random access memory or both. The necessary elements of a computer are: a processor for executing instructions, and one or more memory devices for storing instructions and data. In general, a computer will also include one or more mass storage devices for storing data, or a computer can be operatively coupled to receive data from the one or more mass storage devices or transfer data to the one or more mass storage devices or perform both, and the mass storage device is, for example, a magnetic disk, a magneto-optical disk, or an optical disk. However, a computer does not have to have such a device. Computer readable media suitable for storing computer program instructions and data include all forms of nonvolatile memory, media and storage devices, including, for example, semiconductor memory devices (such as EPROM, EEPROM and flash memory devices), magnetic disks (such as internal hard disks or removable disks), magneto-optical disks, and CD ROM and DVD-ROM disks. The processor and memory may be supplemented by or incorporated in special purpose logic circuitry.

[0061] To provide interaction with a user, one or more aspects of the present disclosure may be implemented on a computer having: a display device for displaying information to the user, such as a CRT (cathode ray tube) or LCD (liquid crystal display) monitor, or a touch screen, and optionally a keyboard and a pointing device (e.g., a mouse or trackball), through which the user can provide input to the computer. Other types of devices may be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback, such as visual feedback, auditory feedback, or tactile feedback; and input from the user may be received in any form including acoustic input, voice input, or tactile input. In addition, the computer may interact with the user by sending documents to the device used by the user and receiving documents from the device, such as by sending a web page to a web browser on a user's client device in response to a request received from the web browser.

[0062] A number of embodiments have been described. However, it will be appreciated that various modifications may be made without departing from the spirit and scope of the present disclosure. Accordingly, other embodiments are within the scope of the following claims.

Claims

1. A method (1000) for training a sequence-to-sequence data selector, characterized in that: include: Generating a base model (134) by training the data processing hardware (112) using a first data set (132) of data pairs (133); Generating an adapted model (144) by the data processing hardware (112) by training the base model (134) on a second data set (142) of the data pairs (143); For each corresponding data pair in the third data set of data pairs: Determining, by the data processing hardware (112) using the base model (134), a first probability distribution for the corresponding data pairs; Determining, by the data processing hardware (112) using the adapted model (144), a second probability distribution for the corresponding data pairs; determining, by the data processing hardware (112), a measure of divergence between the first probability distribution and the second probability distribution; as well as Determining, by the data processing hardware (112), a corresponding contrast score (154) for the corresponding data pair using the determined measure of the divergence, the corresponding contrast score (154) representing a quality probability of the corresponding data pair; as well as The data pairs (153) and the corresponding contrast scores (154) of the third data set (152) are used by the data processing hardware (112) to train a target model (230); wherein Each data set (132, 142, 152) includes a sentence language pair (133, 143, 153).

2. The method (1000) according to claim 1, characterized in that: Training the target model (230) also includes using data pairs (153) of the third data set (152) that meet a threshold contrast score (154).

3. The method (1000) according to claim 1 or 2, characterized in that: Also includes: The data pairs (153) of the third data set (152) are sorted by the data processing hardware (112) based on the corresponding comparison scores (154).

4. The method (1000) according to claim 3, characterized in that: Training the target model (230) further includes: generating a plurality of data batches (210), wherein each data batch (210) includes at least one data pair, and wherein a probability of a selected data pair being included in the selected data batch (210) is based on the corresponding contrast score (154) of the selected data pair, and wherein the probability increases as the corresponding contrast score (154) increases; and Each data batch (210) is used to train the target model (230).

5. The method (1000) according to claim 4, characterized in that: Generating the plurality of data batches (210) includes: determining a selection rate (312) of each data batch (210); determining a batch size (322) for each data batch (210), wherein the batch size (322) is based on the selection rate (312) and the number of data pairs (153) in the third data set (152); Selecting a number of data pairs (153) corresponding to the determined batch size (322) from the third data set (152); sorting the selected data pairs (342) based on the corresponding comparison scores (154); and A removal rate of the selected data pairs (342) having the lowest comparison score (154) is removed from the data batch (210), the removal rate comprising the inverse of the selection rate (312).

6. The method (1000) according to claim 5, characterized in that: The selection rate (312) decreases with training time.

7. The method (1000) according to claim 6, characterized in that: The batch size (322) is equal to the fixed batch size (324) divided by the selection rate (312).

8. The method (1000) according to any one of claims 1, 2, 4-7, characterized in that: The target model (230) is larger than the base model (134).

9. The method (1000) according to any one of claims 1, 2, 4-7, characterized in that: Also includes: Determining, by the data processing hardware (112), that the size of the target model (230) is the same as the size of the base model (134); and When the size of the target model (230) is the same as the size of the base model (134): Replacing the base model (134) with the adapted model (144) by the data processing hardware (112); Replacing the adaptation model (144) with the target model (230) by the data processing hardware (112); Determining, by the data processing hardware (112), the comparison score (154) for each data pair (911) of a fourth data set (910) of data pairs (911) using the base model (134) and the replaced adapted model (144); and The data processing hardware (112) uses the data pairs (911) and the contrast scores (154) of the fourth data set (910) to train a subsequent target model (230).

10. The method (1000) according to any one of claims 1, 2, 4-7, characterized in that: The first data set (132) includes random data.

11. The method (1000) according to claim 10, characterized in that: The second data set (142) includes cleaner data than the random data of the first data set (132).

12. The method (1000) according to any one of claims 1, 2, 4-7, 11, characterized in that: The contrast score (154) includes the Kullback-Leibler (KL) divergence.

13. A system (100) for comparing sequences to sequence data selectors, characterized in that include: Data processing hardware (112); and Storage hardware in communication with the data processing hardware (112), the storage hardware storing instructions that, when executed on the data processing hardware (112), cause the data processing hardware (112) to perform the following operations: Generating a base model (134) by training a first data set (132) using data pairs (133); An adapted model (144) is generated by training the base model (134) on a second data set (142) of data pairs (143); for each corresponding data pair in a third data set of data pairs: Determining, by the data processing hardware (112) using the base model (134), a first probability distribution for the corresponding data pairs; Determining, by the data processing hardware (112) using the adapted model (144), a second probability distribution for the corresponding data pairs; determining, by the data processing hardware (112), a measure of divergence between the first probability distribution and the second probability distribution; as well as determining, by the data processing hardware (112), a corresponding contrast score (154) for the corresponding data pair using the determined measure of the divergence, the corresponding contrast score (154) representing a quality probability of the corresponding data pair; and training a target model (230) using the data pairs (153) and the corresponding contrast scores (154) of the third data set (152); and Each data set (132, 142, 152) includes a sentence language pair (133, 143, 153).

14. The system (100) according to claim 13, characterized in that Training the target model (230) includes using data pairs (153) in the third data set (152) that meet a threshold contrast score (154).

15. The system (100) according to claim 13 or 14, characterized in that The operations also include sorting, by the data processing hardware (112), the data pairs (153) of the third data set (152) based on the corresponding comparison scores (154).

16. The system (100) according to claim 15, characterized in that Training the target model (230) further includes: generating a plurality of data batches (210), wherein each data batch (210) includes at least one data pair, and wherein a probability of a selected data pair being included in the selected data batch (210) is based on the corresponding contrast score (154) of the selected data pair, and wherein the probability increases as the corresponding contrast score (154) increases; and Each data batch (210) is used to train the target model (230).

17. The system (100) according to claim 16, characterized in that Generating the plurality of data batches (210) includes: determining a selection rate (312) of each data batch (210); determining a batch size (322) for each data batch (210), wherein the batch size (322) is based on the selection rate (312) and the number of data pairs (153) in the third data set (152); Selecting a number of data pairs (153) corresponding to the determined batch size (322) from the third data set (152); sorting the selected data pairs (342) based on the corresponding comparison scores (154); and A removal rate of the selected data pairs (342) having the lowest comparison score (154) is removed from the data batch (210), the removal rate comprising the inverse of the selection rate (312).

18. The system (100) according to claim 17, characterized in that The selection rate (312) decreases with training time.

19. The system (100) according to claim 18, characterized in that The batch size (322) is equal to the fixed batch size (324) divided by the selection rate (312).

20. The system (100) according to any one of claims 13, 14, 16-19, characterized in that: The target model (230) is larger than the base model (134).

21. The system (100) according to any one of claims 13, 14, 16-19, characterized in that: The operations also include: Determining that the target model (230) is the same size as the base model (134); and When the target model (230) and the base model (134) are the same size: Replacing the base model (134) with the adapted model (144); replacing the adaptation model (144) with the target model (230); Determining the contrast score (154) for each data pair (911) of a fourth data set (910) of data pairs (911) using the base model (134) and the replaced adapted model (144); and The subsequent target model (230) is trained using data pairs (911) in the fourth data set (910) that meet the threshold contrast score (154).

22. The system (100) according to any one of claims 13, 14, 16-19, characterized in that: The first data set (132) includes random data.

23. The system (100) according to claim 22, characterized in that The second data set (142) includes cleaner data than the random data of the first data set (132).

24. The system (100) according to any one of claims 13, 14, 16-19, 23, characterized in that: The contrast score includes the Kullback-Leibler (KL) divergence.

25. The system (100) according to any one of claims 13, 14, 16-19, 23, characterized in that: Each data set (132, 142, 152) includes a sentence language pair (133, 143, 153).