--- abstract: 'Automatic machine translation is super efficient to produce translations yet their quality is not guaranteed. This technique report introduces TranSmart, a practical human-machine interactive translation system that is able to trade off translation quality and efficiency. Compared to existing publicly available interactive translation systems, TranSmart supports three key features, word-level autocompletion, sentence-level autocompletion and translation memory. By word-level and sentence-level autocompletion, TranSmart allows users to interactively translate words in their own manners rather than the strict manner from left to right. In addition, TranSmart has the potential to avoid similar translation mistakes by using translated sentences in history as its memory. This report presents major functions of TranSmart, algorithms for achieving these functions, how to use the TranSmart APIs, and evaluation results of some key functions. TranSmart is publicly available at its homepage [^1].' author: - | Guoping Huang, Lemao Liu, Xing Wang, Longyue Wang,\ **Huayang Li, Zhaopeng Tu, Chengyan Huang and Shuming Shi**\ \ Tencent AI Lab\ `{transmart,donkeyhuang,redmondliu,zptu,fgarcia@example.org` bibliography: - 'main.bib' title: 'TranSmart: A Practical Interactive Machine Translation System' --- <span>UTF8</span><span>gbsn</span> Introduction ============ Recent years have witnessed a breakthrough in automatic machine translation, thanks to the advances in neural machine translation (NMT) @Vaswani:2017:NeurIPS [@gehring2017convolutional]. The key idea in NMT is an encoder-decoder framework where a source sentence is represented by an encoder network and a target sentence is generate by an decoder network @sutskever2014sequence [@bahdanau2014neural]. By using a large-scale bilingual corpus, both encoder and decoder networks consisting of massive parameters can be trained sufficiently enough to yield excellent generalization ability on unseen sentences. As a result, NMT delivers state of the art performance in many machine translation benchmarks @ondrej2017findings [@barrault2019findings; @wu2020tencent]. ![Autocompletion comparison between conventional IMT (a & c) and TranSmart (b & d). For conventional IMT, autocompletion at sentence level (a) or word level (c) performs with the left-to-right direction; while TranSmart enables any directions as users enjoy for both sentence level (b) and word level autocompletion (d). Red words denotes those validated by users while gray words are automatically completed.<span data-label="fig:overview"></span>](tranSmart-tr.pdf){width="50.00000%"} To the date, however, even a state-of-the-art NMT system is incapable of meeting the strict requirements in some translation scenarios, where human translation is still intensively involved even if it is inefficient and costly @peris2017interactive [@weng2019correct; @zhao+:2020:balancing]. Therefore, interactive machine translation (IMT) @plitt2010productivity [@green2014predictive], which is believed to better trade off translation quality and efficiency, has drawn increasing attention @knowles2016neural [@grangier+auli:2018; @wang+:2020:touch]: At each time a user corrects a translation, the machine automatically generates a new translation based on the human corrections until the translation process is finished @foster1997target. Compared to automatic machine translation, an interactive machine translation system includes more components and it is more complicated in essence. During the past decade, there were a few IMT systems available, for instance, TransType @langlais2000transtype, CASMACAT @alabau2014casmacat, and LILT [^2] which are either on top of statistical machine translation @koehn-etal-2003-statistical [@chiang2005hierarchical; @koehn2009statistical] or the advanced NMT. All these systems share a common characteristic: they perform translation in an incremental manner from left to right and naturally require human translators to follow this strict manner, as shown in Figure 1 (a & c), no matter what translation manner of translators is. In this report, we describe a new human-machine interactive translation system, TranSmart, which was first made publicly accessible in 2018. Compared with other IMT systems, one advantage of TranSmart is its flexibility in the sense that users can employ any translation manners to interact with the machine rather than the incremental manner from left to right. Therefore, if some users prefer to translate difficult words first and then easy words, TranSmart is able to conduct interactive translation in their own manners, as shown in Figure 1 (b & d). Moreover, TranSmart includes an NMT engine augmented with translation memory, and it is very helpful to translate a document where similar translation errors may occur for an automatic machine translation engine. To the best of our knowledge, TranSmart is the first interactive neural machine translation (INMT) system which makes use of translation memory. Specifically, TranSmart provides three key features as follows: - Word-level autocompletion: At word level, in order to input a correct word, users do not need to type all characters of this word from scratch but a few characters instead, and then the system can automatically complete this word. Unlike other INMT systems, the corrected word is not necessary to be adjacent to the translation prefix. - Sentence-level autocompletion: At sentence level, users do not need to translate all words from scratch but provide some of them (for instance, some difficult words), and then the system can automatically complete the translation based on user provided words. Different from other INMT systems, user provided words can be discontinuous. - Translation-memory-augmented NMT: The system is able to re-use translation results from users through translation memory and offers better translation. As there may be several similar sentences in a document to be translated, the system can efficiently avoid the occurrence of similar translation errors thanks to the knowledge from translation memory. By repeatedly leveraging these key features, TranSmart is able to interactively collaborate human and a machine to generate a high-quality translation in an efficient way. In addition, TranSmart provides some extended features, including terminology translation, bilingual sentence examples, document translation, tag-preserving translation, and image translation. In the remaining part of this report, we first present our implementation of the key modules of TranSmart. Then the TranSmart API is briefly introduced. Finally, the effectiveness of some functions is demonstrated through empirical experiments. System Features =============== At high level, TranSmart contains three key features as well as several extended features as shown in the left side of Figure \[fig:overview\]. This section describes the basic ideas of these features, whose detailed implementations will be given in the next section. ![Overview of the TranSmart system.<span data-label="fig:overview"></span>](figs/system.pdf){width="70.00000%"} Key Features ------------ #### Word Level Autocompletion Given a source sentence, a translation context consisting of translation pieces, and a human-typed character sequence, word level autocompletion aims to predict a target word which is compatible with the typed sequence. With the help of this feature, if a user is expected to type a target word to correct a translation, it is not necessary to manually type all the characters but only some of them. This feature is inspired from recent advances @chen2000new in input methods from monolingual scenario which are designed to improve the efficiency of human input. #### Sentence Level Autocompletion Given a source sentence and a translation context, sentence-level autocompletion aims to generate a complete translation for the source sentence on top of the context. The translation context can be human typed words (with or without word level autocompletion), or human-edited translation pieces from a translation generated by the system. With this feature, a user does not need to manually translate all words from scratch but some of them which are usually difficult to the system, and then the system tries to complete the translation by generating the remaining words automatically. #### Memory-Aware Machine Translation Memory-Aware Machine Translation aims to generate high-quality translation by making use of translation memory. Users can provide their own domain-specific translation data to our system as the memory or we can use our bilingual training corpus as the memory. In addition, after users finish translating a sentence, we have a mechanism to accumulate their translation history into the memory. In this way, our system has the ability to avoid the same translation errors occurring multiple times, and this feature is useful in translating a document where there are similar sentences. The above three key features can be used as atomic operations, which can be applied multiple times to interact between the user and machine for a translation task. For example, by repeatedly leveraging word level autocompletion and sentence level autocompletion, TranSmart can generate a complete translation for a source sentence with high-quality, by using the memory-aware translation engine where translation memory is accumulated from translation history of users. It is worth noting that the translation pieces in the translation context may be discontinuous, and thus our word level and sentence level autocompletion is more general and flexible than those in existing INMT systems. Extended Features ----------------- #### Document Translation This feature is used to translate a formatted document in a source language to a corresponding formatted document in a target language. It supports many popular formats including `TXT, HTML, XML, MARKDOWN, PDF, DOCX, PPTX` and `XLSX`. To this end, it generally performs two steps as follows. First, it parses the input formatted document into a text document consisting of sentences with several tags. Each tag may indicate some structural information such as a paragraph or a font. For example, a sentence in the formatted document may be "`<style text-fill=red>Forrest Gump</style> is a 1994 American drama film`", where "`<style text-fill=red>Forrest Gump</style>`" indicates the phrase `Forrest Gump` is with red color as its format. Second, it translates each tagged sentence by the automatic translation engine with a specially designed technique, which is named tag translation. Tag translation is crucial to document translation and we will present its challenges and our solution in the next section. #### Image Translation This feature aims to translate text contained in an image file in a source language to a text document in a target language. It supports many popular image formats such as *JPG* and *PDF*. Generally, it is implemented by a pipeline procedure consisting of two steps as follows. First, it employs an external OCR toolkit to extract a text document where any content beyond text is ignored. Second, it uses our translation engine to translate all sentences in the text document one by one. The first step, which is called text extraction from image, is critical to image translation and we will present its challenge and the technique to address in next section. #### Terminology Translation We collect more than 3 million of Chinese-English terminologies from websites. However, this corpus contains a large amount of noises, including non-terminology, unaligned, inconsistent format. We filter non-terminology words by considering the word frequency due to the long-tail property of terminology. More specifically, we built a phrase table from a large-scale parallel data and then extract high-frequency phrase pairs as a non-terminology list. Finally, we filter noises by comparing the stop list and collected data @wang2014systematic. Furthermore, we employ our in-house filtering scripts @wang2014combining to filter unaligned terms according to various features such as length ratio and language identification. As a result, we obtained a clean version of terminology corpus that contains around 2 million terms. #### Bilingual Examples The input sentence is used to retrieve bilingual examples from the corresponding retrieval repository. We selected and used more than 200M bilingual sentences to build the retrieval repository. The three most similar bilingual examples are displayed to help users to translate the input sentence. Implemented Techniques ====================== Generic Translation Model ------------------------- #### Translation Model We implemented the generic translation model on top of the Transformer architecture @Vaswani:2017:NeurIPS. To balance the translation performance and inference efficiency, we used a 24-layer encoder and a 6-layer decoder, whose hidden size is 1024. We trained the translation model on our in-house data after the following data manipulation methods, which consists of 200 millions of Chinese-English sentence pairs. We followed @Ott:2018:WMT to train models with batches of approximately 460k tokens, using Adam @kingma2015adam with $\beta_{1}=0.9$, $\beta_{2}=0.98$ and $\epsilon=10^{-8}$. \[h\] ![image](figs/framework.pdf){width="70.00000%"} #### Data Rejuvenation Large-scale parallel datasets lie at the core of the recent success of NMT models. However, the complex patterns and potential noises in the large-scale data make training NMT models difficult. We introduce *data rejuvenation* to improve the training of NMT models on large-scale datasets by exploiting inactive examples @Jiao:2020:EMNLP. The proposed framework consists of three phases, as shown in Figure \[fig:data-rejuvenation\]. First, we train an <span>*identification model*</span> on the original training data to distinguish inactive examples and active examples by their sentence-level output probabilities. Then, we train a <span>*rejuvenation model*</span> on the active examples to re-label the inactive examples with forward-translation. Finally, we combined the rejuvenated examples and the active examples as the final bilingual data. #### Data Augmentation Although we have large-scale parallel data, there are limited amount parallel data for some specific domains. Data augmentation methods (e.g. self-training and back-translation) are a promising way to alleviate this problem by augmenting model training with synthetic parallel data. The common practice is to construct synthetic data based on a randomly sampled subset of large-scale monolingual data, which we empirically show is sub-optimal. In response to this problem, we improve the sampling procedure by selecting the most informative monolingual sentences to complement the parallel data. To this end, we compute the uncertainty of monolingual sentences using the bilingual dictionary extracted from the parallel data. Intuitively, monolingual sentences with lower uncertainty generally correspond to easy-to-translate patterns which may not provide additional gains. Accordingly, we design an uncertainty-based sampling strategy @Jiao:2021:ACL to efficiently exploit the monolingual data for self-training, in which monolingual sentences with higher uncertainty would be sampled with higher probability. #### Inference Speedup The inference speed of machine translation is a significant issue for practical applications. Although NMT has achieved promising results, it suffers from slow translation speed. There are different ways to optimize inference speed without sacrificing too much translation quality, including beam search @zhang2018speeding, network pruning @wang2020sparsity, and better hyper-parameter @wang2019learning, and even novel architecture @gu2017non. We mainly focus on the last two research lines to speed up our NMT systems. About hyper-parameter, we employed shallow-deep Transformer to optimize the decoding speed. Furthermore, we exploited non-autoregressive translation (NAT) architecture as future techniques for improving our system @ding2020context [@ding2020understanding; @ding2021rejuvenating; @ding2021progressive]. General Word-level Autocompletion --------------------------------- \[t\] ![image](./model_pure.pdf){width="0.65\columnwidth"} #### Task Definition Word-level autocompletion aims to complete the target word based on human typed characters for a given a source sentence and translation context. Previous studies have explored word-level autocompletion task, but they either do not take into account translation context @huang2015new or they require the target word to be the next word of the translation prefix @langlais2000transtype [@santy-etal-2019-inmt], which limit its applications in real-world scenarios such as post-editing @vasconcellos1985spanam. To this end, we propose a general word-level autocompletion task which can be applied to more general scenarios. Suppose ${\boldsymbol{x}}$=$(x_1, x_2, \dots, x_m)$ is a source sequence, ${\boldsymbol{s}}$=$(s_1, s_2, \dots, s_k)$ is a sequence of human typed characters, and translation context is denoted by ${\boldsymbol{c}}$=$({\boldsymbol{c}}_l, {\boldsymbol{c}}_r)$, where ${\boldsymbol{c}}_l$=$(c_{l,1}, c_{l,2}, \dots, c_{l,i})$ and ${\boldsymbol{c}}_r$=$(c_{r,1}, c_{r,2}, \dots, c_{r,j})$. The translation pieces ${\boldsymbol{c}}_l$ and ${\boldsymbol{c}}_r$ are on the left and right hand side of ${\boldsymbol{s}}$, respectively. Formally, given a source sequence ${\boldsymbol{x}}$, typed character sequence ${\boldsymbol{s}}$ and a context ${\boldsymbol{c}}$, the *general word-level autocompletion* (GWLAN) task aims to predict a target word $w$ which is to be placed in the middle between ${\boldsymbol{c}}_l$ and ${\boldsymbol{c}}_r$ to constitute a partial translation. Note that ${\boldsymbol{c}}_l$ or ${\boldsymbol{c}}_r$ may be empty in some scenarios. #### Methodology Given a tuple $({\boldsymbol{x}}, {\boldsymbol{c}}, {\boldsymbol{s}})$, our approach decomposes the whole word autocompletion process into two parts: model the distribution of the target word $w$ based on the source sequence ${\boldsymbol{x}}$ and the translation context ${\boldsymbol{c}}$, and find the most possible word $w$ based on the distribution and human typed sequence ${\boldsymbol{s}}$. In the first part, we propose a word prediction model (WPM) to define the distribution $p(w|{\boldsymbol{x}}, {\boldsymbol{c}})$ of the target word $w$. We use a single placeholder `[MASK]` to represent the unknown target word $w$, and use the representation of `[MASK]` learned from WPM to predict it. Formally, given the source sequence ${\boldsymbol{x}}$, and the translation context ${\boldsymbol{c}}=({\boldsymbol{c}}_l$, ${\boldsymbol{c}}_r)$, the possibility of the target word $w$ is: $$\label{eq:objective} P(w|{\boldsymbol{x}}, {\boldsymbol{c}}_l, {\boldsymbol{c}}_r;\theta) = \mathrm{softmax} \left(\phi (h) \right)[w]$$ where $h$ is the hidden representation of decoding state with respect to `[MASK]`, $\phi$ is a linear network that projects the hidden representation $h$ to a vector with dimension of target vocabulary size, and $\mathrm{softmax}(d)[w]$ takes the component regarding to $w$ after the softmax operation. Our model has a source encoder and a cross-lingual encoder. The source encoder of WPM is the same as the Transformer encoder, which is used to encode the source sequence ${\boldsymbol{x}}$. The output of source encoder is passed to the cross-lingual encoder later. The cross-lingual encoder is similar to the Transformer decoder, while the only difference is that we replace the auto-regressive attention layer by a bidirectional masked attention (BMA) module, which is shown in Figure \[fig:attention\]. Suppose ${\boldsymbol{s}}$ denotes a human typed sequence of characters, in the second part, we predict the best word according to the constrained optimization: $${\operatorname*{argmax}}_{w \in \mathcal{V}({\boldsymbol{s}})} P(w\mid {\boldsymbol{x}}, {\boldsymbol{c}}; \theta)$$ where $\mathcal{V}({\boldsymbol{s}})$ denotes a set of target words, whose element satisfies the sequences of ${\boldsymbol{s}}$, for example, ${\boldsymbol{c}}$ is a prefix of $w$. More details can be found in @li2021gwlan. #### Data Generation For training and evaluating GWLAN models above, firstly we should create a large scale dataset including tuples of $({\boldsymbol{x}}, {\boldsymbol{s}}, {\boldsymbol{c}}, w )$. Ideally, we may hire professional translators to manually annotate such a dataset, but it is too costly in practice. We instead propose to automatically construct the dataset from parallel datasets. Assume we are given a parallel dataset $ \{({\boldsymbol{x}}^i, {\boldsymbol{y}}^i)\}$, where ${\boldsymbol{y}}^i$ is the reference translation of ${\boldsymbol{x}}^i$. We automatically construct the data ${\boldsymbol{c}}^i$ and ${\boldsymbol{s}}^i$ by randomly sampling from ${\boldsymbol{y}}^i$. Specifically, we first sample a word $w={\boldsymbol{y}}^i_k$, and sample two spans $[a_l, b_l]$ and $[a_r, b_r]$ such that $0\le a_l \le b_l \le k$ and $k+1\le a_r \le b_r \le |{\boldsymbol{y}}^i|$, leading to ${\boldsymbol{c}}_l = \langle y^i_{a_l}, \cdots, y^i_{b_l-1}\rangle$ and ${\boldsymbol{c}}_r = \langle y^i_{a_r}, \cdots, y^i_{b_r-1}\rangle$. It is worth mentioning that ${\boldsymbol{c}}_l$ or ${\boldsymbol{c}}_r$ may not be adjacent to $y^i_k$. In addition, we randomly sample a character sequence as ${\boldsymbol{s}}^i_k$ for $y^i_k$ as follows: for languages like English and German, ${\boldsymbol{s}}^i_k$ is a character prefix of $y^i_k$; for languages like Chinese, ${\boldsymbol{s}}^i_k$ consists of the first phonetic symbol of each character in $y^i_k$. In this way, we can obtain a collection of $\{({\boldsymbol{x}}^i, {\boldsymbol{c}}_l, {\boldsymbol{c}}_r, {\boldsymbol{s}}^i_k, y^i_k)\mid \forall i, \forall k\}$, which can be divided into training, validation and test datasets for the GWLAN task. Sentence-level Autocompletion by Lexical Constraints ---------------------------------------------------- In our human-machine interactive translation scenario, human translators may pre-specify some constraint words (or lexical constraints) and our system requires to output a high-quality translation with knowledge from these pre-specified constraints. For example, the constraints can be typed by human translators through word level autocompletion in Section 3.2, and they can be a translation prefix corrected by translators, or a post-edited partial translation. It is worth noting that the constraints are not necessary to be continuous @cheng2016primt, unlike @wuebker2016models [@knowles2016neural]. In TranSmart, we implement two different approaches to incorporate these constraints into NMT. The first one relies on constrained decoding which requires the output translation to include constraints in a hard manner; whereas the second one makes use of them in a soft manner, i.e., the output translation may not include some of constraints. #### Constrained Decoding Constrained decoding is essentially a constrained optimization problem, and it aims to search the translation which satisfies some constraints and is with the best model score. Formally, suppose $P({\boldsymbol{y}}\mid {\boldsymbol{x}})$ is a translation model, and ${\boldsymbol{c}}$ denotes a set of constraint words. $$\operatorname*{argmax}_{{\boldsymbol{y}}\in \mathcal{Y}({\boldsymbol{c}})} P({\boldsymbol{y}}\mid {\boldsymbol{x}})$$ where $\mathcal{Y}({\boldsymbol{c}})$ denotes a set of translation hypotheses which include all constraint words in ${\boldsymbol{c}}$. To address this constrained optimization problem, @hokamp2017lexically proposed a grid beam search algorithm (GBS). This algorithm maintains a beam along two dimensions, where one is the length of the hypotheses and the other is the number words in all constraints. Thus, its complexity is linear to the number of the constraint words, which is inefficient in our interactive scenario. @post2018fast presented an improved algorithm by dynamic beam allocation (DBA) which allows hypotheses in a beam to contain different number of constraint words. In our experiments, this improved algorithm is indeed more efficient in decoding speed but its translation quality is worse than grid beam search. To this end, we propose a variant of grid beam search algorithm to achieve a trade-off between quality and efficiency. In our interactive scenario, we observe that constraint words in ${\boldsymbol{c}}$ exhibit two characteristics: some of constraints in ${\boldsymbol{c}}$ are consecutive to form a translation piece, especially when the size of ${\boldsymbol{c}}$ is very large; and ${\boldsymbol{c}}$ provided by human translators is placed in a fixed order such that the output translation should contain ${\boldsymbol{c}}$ in the same order. Based on the observation, we organize a beam along the length of hypotheses and the number of constraint pieces rather than constraint words. Thanks to the fixed order of pieces, any translations with the same number of pieces will naturally contain the same number of constraint words and thereby they can be fairly pruned in terms of model scores, similar to the grid beam search algorithm. Consequently, the complexity of this algorithm is linear to the number of pieces rather than the number of constraints, which leads to substantial speedup in practice because constraint pieces usually are long enough. #### NMT with Soft Constraints Unlike constrained decoding, we propose a new approach to make use of pre-specified constraints in a soft manner. The key is to treat the constraints as an external memory, integrate the memory into the standard Seq2Seq decoder @sutskever2014sequence [@bahdanau2014neural] and then train the memory-augmented NMT from a dataset such that it learns to constrain the output. Specifically, given ${\boldsymbol{x}}$, ${\boldsymbol{c}}$ and a translation prefix ${\boldsymbol{y}}_{<t}$, we generate a target word ${\boldsymbol{y}}_t$ according to $P\left( {y}_t \mid {\boldsymbol{x}}, {\boldsymbol{y}}_{<t}, {\boldsymbol{c}}; \theta \right)$. Our model includes three components: the encoder of vanilla NMT model which encodes ${\boldsymbol{x}}$ into a sequence of hidden vectors; the Constraint Memory Encoder (CME) that encodes the constraints ${\boldsymbol{c}}$ into another sequence of hidden vectors $E({\boldsymbol{c}})$, i.e., the constraint memory; and the Constraint Memory Integrator (CMI), which integrates the constraint memories into the decoder network to generate the next token $y_t$. To train the memory-augmented model, we create a dataset from available bilingual corpus. We randomly sample some rare words from the reference $\mathbf{r}$ as constraints, since rare words are more difficult to translate than other words @grangier+auli:2018. In inference, our decoding is an unconstrained optimization problem: $$\operatorname*{argmax}_{{\boldsymbol{y}}} P({\boldsymbol{y}}\mid {\boldsymbol{x}}, {\boldsymbol{c}}; \theta)$$ To approximately solve the above optimization problem, we employ the standard beam search algorithm which is similar to the decoding in our baseline model. Although we need additional overheads to handle the constraint memories, this is negligible to the time consuming of the decoding in NMT. Thus, its search is as efficient as the search algorithm of the standard NMT. In addition, unlike constrained decoding, the method does not force a feasible ${\boldsymbol{y}}$ to include all constraints in ${\boldsymbol{c}}$. Hence, if the constraints in ${\boldsymbol{c}}$ include some noises (i.e., spelling mistakes), it has the potential to avoid copying these noises. More details about this function can be found in @li+:2020:neural. Graph based Translation Memory ------------------------------ The basic idea of translation memory based MT is to translate an input source sentence by using the translations of the source sentences which are similar to the input one, which is related to domain adaptation @chu2017empirical [@wang2017instance; @chu-wang-2018-survey]. Suppose we are given a translation memory (TM) for a source sentence which is a list of bilingual sentence pairs. Generally, there are two ways to improve translation models with translation memory: training model parameters with augmented data (i.e., memory) @liu+:2012:locally [@li2016one; @farajian2017multi] and summarizing knowledge from translation memory to augment MT decoder @gu+:2018 [@zhang+:2018; @he+:2019:word]. For the latter idea, a typical solution to represent a TM is to encode each word in both the source and target sides by a neural memory@gu+:2018. Unfortunately, since a word even a phrase may appear repeatedly in a TM, redundant words are encoded multiple times, leading to a large memory network as well as considerable computation. To address this issue, we propose an effective approach to representing a TM with a compact graph structure, which is further used to enhance the translation model. The model structure is illustrated in Figure \[fig:topdown\] and its more details can be found in @xia+:2019:graph. #### Graph Representation of TM It is observed that most source words in the TM also appear in the input sentence and have already been represented by the encoder. In addition, we believe that those words in the TM yet beyond the source side may not be informative to translate the input sentence itself. Therefore, in our proposed model, we directly ignore the source sentences of the TM and only represent the target side. In addition, instead of sequentially encoding target sentences in a TM, we pack them into a compact graph such that some words in different sentences may correspond to the same node in the graph, which is inspired by the notion of lattice or hypergraph in statistical machine translation @koehn:2009:book [@dyer2010cdec]. To this end, we convert the target side in a TM into a confusion network by using the algorithm proposed by @mangu+:1999 and @mangu+:2000. \[t!\] ![image](model_arch.pdf){width="1.\textwidth"} \[fig:topdown\] #### NMT with Graph based TM The graph based TM is further used to enhance the Transformer architecture. Generally, the enhanced Transformer shares the similar architecture as Transformer but with two major differences in encoding and decoding phases. In the encoding phrase, besides encoding the input sequence, the proposed model also encodes the graph by using $L$ layers of networks in a similar fashion to the encoding of the input. Specifically, we firstly use a multi-head attention to encode each node in the TM graph where the query is the corresponding node, and key-value pairs are obtained from its first-order neighborhood nodes inspired by graph attention @velivckovic+:2018. Then we apply other sub-layers to the resulting vector obtained by the multi-head attention layer, which contain a residual layer, a feed-forward layer and a layer normalization. In this way, we can represent the graph into a list of vectors whose size is the same as the number of nodes in the graph. In the decoding phase, similar to Transformer, the proposed model employs $L$ layers of networks but each layer includes sub-layers (i.e., multi-head attention, residual layer and layer normalization) to incorporate the list of vectors obtained from graph encoding, besides other six sub-layers. We place the extra three sub-layers nearest to the output of the decoder network in order to let the graph encoding fully influence the decoding process. Others ------ #### Word Alignment Word alignment plays an important role in document translation for TranSmart. Since NMT is a blackbox model with massive parameters, previous work has made numerous efforts to induce word alignment from attention in NMT @liu+:2016:neural [@li+:2018:target; @chen+:2020:accurate] or other explanation methods @li+:2019:on [@ding2019saliency; @li+:2020:evaluating]. Other work improves alignment quality by building a word alignment model whose architecture is similar to NMT @chen2020maskalign. Despite its success, statistical aligners @och2003systematic [@dyer2013simple] are still respectful counterparts because of their training efficiency and alignment quality. Therefore, we employ statistical aligners to obtain word alignment. As TranSmart involves billion scale of bilingual sentences as its training data, the popular aligner GIZA++ can not train successfully due to memory consumption. Instead, we re-implement an aligner based on HMM @vogel1996hmm with an adaptive strategy to prune the word translation table: for each high-frequency word we allow more words to be its translations whereas we allow less for each low-frequency word. #### Tag Translation Tag translation aims to translate a source language with tags into a target language with tags, and it serves as the key step for document translation. Since the standard translation engine are trained on top of bilingual sentences without tags, standard translation engines can not perform well on translating tagged sentences. In addition, there are no sufficient tagged bilingual sentences to train a customized tag translation engine. Therefore, we propose a simple post-processing approach based on word alignment as follows. First, we delete all tags from a tagged source sentence to obtain a tag-free sentence and then translate it into a target sentence by our default translation engine. Then we run our word aligner on both the tag-free sentence and its translation to obtain word level alignments. Second, we insert the corresponding tags from the source sentence into its translation. However, the second step is not straightforward because one tagged piece (or phrase) within the tagged source sentence may align to multiple pieces in the target side due to the essence of word alignment. We propose an algorithm based on dynamic programming to extract a piece-to-piece alignment: the piece-to-piece alignment is a one-to-one map between pieces in the source and target sides such that it makes the minimal violations according to the word alignment results. By using the piece-to-piece alignment, it is trivial to insert the tags from the source sentence into its target sentence. #### Text Extraction from Image Text Extraction from Image aims to extract the text content from an image file to form a text document in a source language while ignoring other content. Generally, this task is challenging due to two reasons. First, a sentence in an image file may not explicitly contain a special symbol to indicate its end and several such sentences may actually constitute one sentence. More importantly, OCR may recognize many blocks of text content from an image file to some extent, but it is difficult to organize these text blocks into a text document which preserves the same sequential structure of text blocks as in the original image file. To tackle the first challenge, we develop a language model to detect the end symbol for a sentence without an end symbol. In addition, we design another model to detect whether several sentences without an end symbol should be combined to one sentence. To address the second challenge, we employ the position information of each block from the OCR toolkit and uses it as a signal to decide the sequential order of all blocks, which is critical to form the final text document. #### Discourse-Aware Translation Existing translation models usually translate a text by considering isolated sentences based on a strict assumption that the sentences in a text are independent of one another. However, disregarding dependencies across sentences will harm translation quality especially in terms of coherence, cohesion, and consistency @longyue2019discourse. To response this problem, we adapt document-level NMT @wang2017exploiting to document-level training. Specifically, we add bilingual documents and paragraphs to our training data, which can helps models to learn discourse knowledge from larger contexts @wang2016automatic [@wang2020tencent]. This works well with the <span>*Document Translation Feature*</span> as stated in Section 2.2. Chinese is a pro-drop language, where pronouns are usually omitted when they can be inferable from the context. This leads to serious problems for Chinese-to-English translation models in terms of completeness and correctness. Thus, we recover missing pronouns in the informal domain of training data (e.g. conversations and movie subtitles) by leveraging our approaches @wang2016novel [@wang2018translating; @wang2018learning]. System Usage ============ Two ways are available to use TranSmart. One way is to visit the website of TranSmart[^3], which has a friendly interactive user-interface (UI). Another way is calling the TranSmart HTTP APIs. The HTTP APIs can be accessed by sending a JSON request to the service[^4] via POST method. The major fields of the JSON request of the translation APIs are shown in Table \[tab:api\_fields\]. In this section, we will focus more on the latter way and introduce the usage of some selected features. <span>|l|l|l|X|</span> Field & Field Type & Req/Opt & Description\ header & JSON & Required & Information of API calls, including function name, token, and user name[^5].\ reference & JSON & Optional & Information of references, which includes two fields "term\_lib" and "sentence\_lib".\ type & String & Optional & The format of the given source sentence. The value should be one of plain, xml, html, and markdown. The default value is "plain".\ model\_category & String & Optional & The model served for translation. The value should be one of slow, normal, and fast. The default value is "normal". Note that different models may have different translation speeds and qualities.\ source & JSON & Required & Information of the source text, including a "text\_list" filed that contains a list of source sentences.\ target & JSON & Required & Information of the target sentence.\ limit & JSON & Optional & Control the returns in the JSON response, such as the number of suggestions.\ reference\_list & JSON & Optional & Information of translation memory. The translation memory has two types: "term" and "sent".\ Word And Sentence Level Autocompletion -------------------------------------- \[\] ![image](figs/dynamic_suggestion_ime.pdf){width="1.\textwidth"} \[\] ![image](figs/dynamic_suggestion_lcd.pdf){width="1.\textwidth"} One important API is the "`dynamic_suggestion`" function, aiming to save the effort of human translators when correcting the translation generated by AI. This API is capable of providing autocompletion at both word-level and sentence-level, which will be introduced one by one. First, the word-level autocompletion is able to complete the unfinished word input by human translators. As shown in Figure \[fig:dynamic\_suggestion\_ime\], when the a character sequence "`th`" is tagged by "`editing`" in the "`segment_list`" field, TranSmart will return its autocompletion in the "`ime_suggestion`" field in response. Second, the sentence-level suggestion can complete the whole translation based on the user-specified spans. As shown in Figure \[fig:dynamic\_suggestion\_lcd\], the span with the "`prefix`" type is promised to be the prefix of the re-generated translation in response, and spans with "`std`" are forced to be included in re-generated translation. The result of sentence-level autocompletion is in the "`sentence_suggestion`" field in response. Memory-Aware Machine Translation -------------------------------- \[\] ![image](figs/auto_translation.pdf){width="1.\textwidth"} As shown in Figure \[fig:auto\_translation\], when users provide the information of translation memory in the "`reference_list`" field, TranSmart will be able to leverage those existing and relevant translations in history to improve the translation quality. The translation results are in the "`auto_translation`" field in response. Note that users can also disable this feature by removing the "`reference_list`" field, then TranSmart will translate only based on the source text, i.e., the setting of traditional automatic translation. Extended Features ----------------- \[\] ![image](figs/static_suggestion.pdf){width="1.\textwidth"} \[\] ![image](figs/slection_suggestion.pdf){width="1.\textwidth"} TranSmart also has two APIs that may be helpful for human translators. First, it provides a `static_suggestion` function to retrieve relevant information from our pre-constructed terminology and bilingual example databases. As shown in Figure \[fig:static\_suggestion\], the "`static_suggestion`" function returns the most relevant terminology translations and bilingual examples in the "`term_list`" and "`sentence_example_list`" field in response, respectively. Second, our "`selection_suggestion`" is designed to translate specified spans in a source sentence. As shown in Figure \[fig:selection\_suggestion\], only spans with "`selection`" status in the "`segment_list`" field will be translated. The results of selection suggestions are placed in the "`segment_suggestion`" field in response. System Evaluation ================= Generic Translation ------------------- #### Datasets We conducted experiments on the widely used WMT14 English$\Rightarrow$German (En$\Rightarrow$De) and English$\Rightarrow$French (En$\Rightarrow$Fr) datasets, which consist of about $4.5$M and $35.5$M sentence pairs, respectively. [^6] We applied BPE @sennrich+:2016 with 32K merge operations for both language pairs. The experimental results were reported in case-sensitive BLEU score @papineni2002bleu. #### Systems We validated our approach on a couple of representative NMT architectures: - <span style="font-variant:small-caps;">Lstm</span> @domhan2018much that is implemented in the <span style="font-variant:small-caps;">Transformer</span> framework. - <span style="font-variant:small-caps;">Transformer</span> @Vaswani:2017:NIPS that is based solely on attention mechanisms. - <span style="font-variant:small-caps;">DynamicConv</span> @wu2019pay that is implemented with lightweight and dynamic convolutions, which can perform competitively to the best reported <span style="font-variant:small-caps;">Transformer</span> results. We adopted the open-source toolkit Fairseq @ott:2019:naacl to implement the above NMT models. We followed the settings in the original works to train the models. In brief, we trained the <span style="font-variant:small-caps;">Lstm</span> model for 100K steps with 32K ($4096\times8$) tokens per batch. For <span style="font-variant:small-caps;">Transformer</span>, we trained 100K and 300K steps with 32K tokens per batch for the <span style="font-variant:small-caps;">Base</span> and <span style="font-variant:small-caps;">Big</span> models respectively. We trained the <span style="font-variant:small-caps;">DynamicConv</span> model for 30K steps with 459K ($3584\times128$) tokens per batch. We selected the model with the best perplexity on the validation set as the final model. \[t\] <span>c l ll ll</span> & & &\ (lr)<span>3-4</span> (lr)<span>5-6</span> & & BLEU & $\bigtriangleup$ & BLEU & $\bigtriangleup$\ \ @domhan2018much & <span style="font-variant:small-caps;">Lstm</span> & 26.7 & – & – & –\ & <span style="font-variant:small-caps;">Transformer-Base</span> & 27.3 & – & 38.1 & –\ & <span style="font-variant:small-caps;">Transformer-Big</span> & 28.4 & – & 41.0 & –\ @ott2018scaling & + Large Batch & 29.3 & – & 43.2 & –\ @wu2019pay & <span style="font-variant:small-caps;">DynamicConv</span> & 29.7 & – & 43.2 & –\ \ & <span style="font-variant:small-caps;">Lstm</span> & 26.5 & – & 40.6 & –\ & + Data Rejuvenation & 27.0$^\uparrow$ & +0.5 & 41.1$^\uparrow$ & +0.5\ & <span style="font-variant:small-caps;">Transformer-Base</span> & 27.5 & – & 40.2 & –\ & + Data Rejuvenation & 28.3$^\Uparrow$ & +0.8 & 41.0$^\Uparrow$ & +0.8\ & <span style="font-variant:small-caps;">Transformer-Big</span> & 28.4 & – & 42.4 & –\ & + Data Rejuvenation & 29.2$^\Uparrow$ & +0.8 & 43.0$^\uparrow$ & +0.6\ & + Large Batch & 29.6 & – & 43.5 & –\ & + Data Rejuvenation & 30.3$^\Uparrow$ & +0.7 & 44.0$^\uparrow$ & +0.5\ & <span style="font-variant:small-caps;">DynamicConv</span> & 29.7 & – & 43.3 & –\ & + Data Rejuvenation & 30.2$^\uparrow$ & +0.5 & 43.9$^\uparrow$ & +0.6\ #### Results Table \[tab:main\] lists the results across model architectures and language pairs. Our <span style="font-variant:small-caps;">Transformer</span> models achieve better results than that reported in previous work @Vaswani:2017:NIPS, especially on the large-scale En$\Rightarrow$Fr dataset (e.g., more than 1.0 BLEU points). @ott2018scaling showed that models of larger capacity benefit from training with large batches. Analogous to <span style="font-variant:small-caps;">DynamicConv</span>, we trained another <span style="font-variant:small-caps;">Transformer-Big</span> model with 459K tokens per batch ("+ Large Batch" in Table \[tab:main\]) as a strong baseline. We tested statistical significance with paired bootstrap resampling @Koehn2004:emnlp using `compare-mt`[^7] @neubig2019:naacl. Clearly, our data rejuvenation consistently and significantly improves translation performance in all cases, demonstrating the effectiveness and universality of the proposed data rejuvenation approach. It's worth noting that our approach achieves significant improvements without introducing any additional data and model modification. It makes the approach robustly applicable to most existing NMT systems. Word Level Autocompletion ------------------------- #### Datasets We carry out experiments on four GWLAN tasks including bidirectional Chinese–English tasks and German–English tasks. The training set for two directional Chinese–English tasks consists of 1.25M bilingual sentence pairs from LDC corpora. As discussed in §3.2, the training data for GWLAN is extracted from 1.25M sentence pairs. The validation data for GWLAN is extracted from NIST02 and the test datasets for GWLAN are constructed from NIST05 and NIST06. For two German–English tasks, we use the WMT14 dataset standard preprocessed by Stanford [^8]. The validation and test sets for our tasks are based on newstest13 and newstest14 respectively. All the sample operations in the data construction process are based on the uniform distribution. For each dataset, the models are tuned and selected based on the validation set. #### Systems In the experiments, we evaluate and compare the performance of our proposed approach (<span style="font-variant:small-caps;">WPM</span>) and a few baselines, which are illustrated below: - <span style="font-variant:small-caps;">TransTable</span>: We train an alignment model [^9] on the training set and build a word-level translation table. While testing, we can find the translations of all source words based on this table, and select out valid translations based on the human input. The word with highest frequency among all candidates is regarded as the prediction. This baseline is inspired by @huang2015new [@huang2018input]. - <span style="font-variant:small-caps;">Trans-PE</span>: We train a vanilla NMT model using the Transformer-base model. During the inference process, we use the context on the left hand side of human input as the model input, and return the most possible words based on the probability of valid words selected out by the human input. This baseline is inspired by @langlais2000transtype [@santy-etal-2019-inmt]. - <span style="font-variant:small-caps;">Trans-NPE</span>: As another baseline, we also train an NMT model based on Transformer, but without position encoding on the target side. While testing, we use the averaged hidden vectors of all the target words outputted by the last decoder layer to predict the potential candidates. #### Evaluation Metric To evaluate the performance of the well-trained models, we choose accuracy as the evaluation metric: $$\mathrm{Acc} = \frac{N_{match}}{N_{all}},$$ where $N_{match}$ is the number of words that are correctly predicted and $N_{all}$ is the number of testing examples. \[t\] #### Results Table \[tab:all\] shows the main results of our method and three baselines on the test sets of Chinese-English and German-English datasets. The method <span style="font-variant:small-caps;">Trans-PE</span>, which assumes the human input is the next word of the given context, behaves poorly under the more general setting. As the results of <span style="font-variant:small-caps;">Trans-NPE</span> show, when we use the same model as <span style="font-variant:small-caps;">Trans-PE</span> and relax the constraint of position by removing the position encoding, the accuracy of the model improves. One interesting finding is that the <span style="font-variant:small-caps;">TransTable</span> method, which is only capable of leveraging the zero-context, achieves good results on the Chinese-English task when the target language is English. However, when the target language is Chinese, the performance of <span style="font-variant:small-caps;">TransTable</span> drops significantly. It is clear from the results that our method <span style="font-variant:small-caps;">WPM</span> significantly outperforms the three baseline methods. Sentence Level Autocompletion ----------------------------- #### Datasets We conduct experiments on the Zh$\Rightarrow$En, Fr$\Rightarrow$En, <span>De$\Rightarrow$En</span>, and translation tasks. The Zh$\Rightarrow$En bilingual corpus includes news articles collected from several online news websites. After the standard preprocessing procedure as in @koehn2007moses, we obtain about 2 million bilingual sentences in total. Then we randomly select 2000 sentences as the development and test datasets, respectively, and leave other sentences as the training dataset. The Fr$\Rightarrow$En bilingual corpus is from JRC-Acquis datasets @steinberger2006jrc and it is preprocessed following @gu+:2018. This dataset is a collection of the parallel legislative text of European Union Law applicable in the EU member states and thus it is a highly related corpus focusing on a specific domain. <span>We also evaluate our methods on the WMT 2018 English-German news translation task, which is composed of Europarl and news commentary fgarcia@example.org. We use the WMT *newstest2013* and *newstest2014* as the development and test set respectively.</span> <span>In addition, in our experiments, we use the subword technique @sennrich+:2016 to ensure that there are no unknown tokens in our input, even if a constraint word is not included in the training set. Therefore, if a human translator provides an unknown word as a constraint word, our system tokenizes it into several BPE tokens which are considered as several constraints accordingly.</span> Since there are no real constraints available provided by human for all these datasets, we simulate this effect by randomly picking some words from the reference side as the constraints following @hokamp2017lexically [@song-etal-2019-code]. #### Systems As presented in section 3.3, we implement two methods: constrained decoding with ordered constraints denoted by <span style="font-variant:small-caps;">O-Gbs</span> and NMT with soft constraints denoted by <span style="font-variant:small-caps;">SC</span>. We compare both of our methods against three baselines: - <span style="font-variant:small-caps;">Transformer</span>: It is the standard Transformer, which is an in-house implementation using Pytorch following @klein2017opennmt. - <span style="font-variant:small-caps;">Gbs</span>: It is the Grid Beam Search in @hokamp2017lexically built on top of the in-house <span style="font-variant:small-caps;">Transformer</span>. - <span style="font-variant:small-caps;">Dba</span>: It is the lexically constrained decoding with Dynamic Beam Allocation (an improved approach for @hokamp2017lexically) in @post2018fast . To ensure the translation quality, we set the default beam size for <span style="font-variant:small-caps;">Gbs</span> and <span style="font-variant:small-caps;">Dba</span> as suggested by @hokamp2017lexically and @post2018fast. <span>The hyper-parameters for all the systems are following those of <span style="font-variant:small-caps;">Transformer</span> base model@Vaswani:2017:NeurIPS</span>. We train all the models with Adam optimization algorithm @kingma2015adam and tune the number of iteration based on the performance of the development set. <span>Systems</span> Fr$\Rightarrow$En <span>De$\Rightarrow$En</span> Zh$\Rightarrow$En Runtime ----------------------------------------------------------- ------------------- -------------------------------- ------------------- --------- <span style="font-variant:small-caps;">Transformer</span> 67.13 <span>26.46</span> 36.22 0.256 + <span style="font-variant:small-caps;">Gbs</span> 70.99$^{\dagger}$ <span>30.67</span>$^{\dagger}$ 42.17$^{\dagger}$ 5.692 + <span style="font-variant:small-caps;">Dba</span> 67.35$^{\dagger}$ <span>29.04</span>$^{\dagger}$ 41.23$^{\dagger}$ 1.531 + <span style="font-variant:small-caps;">O-Gbs</span> 70.99$^{\dagger}$ <span>30.67</span>$^{\dagger}$ 42.17$^{\dagger}$ 1.959 + <span style="font-variant:small-caps;">SC</span> 71.10$^{\dagger}$ <span>30.25$^{\dagger}$</span> 42.96$^{\dagger}$ 0.262 : \[table:zh-sc2\] BLEU and runtime comparisons on perfect constraints for the Zh$\Rightarrow$En, Fr$\Rightarrow$En, and <span>De$\Rightarrow$En</span> tasks. The runtime is measured by the time consumed by decoding one sentence on the Zh$\Rightarrow$En task. <span>$\dagger$ indicates the comparison over <span style="font-variant:small-caps;">Transformer</span> is significant with p &lt; 0.05.</span> #### Results As shown in Table \[table:zh-sc2\], although the <span style="font-variant:small-caps;">Dba</span> method would reduce the computational overhead compared to <span style="font-variant:small-caps;">Gbs</span>, its translation quality slightly sacrifices accordingly, which is similar to the finding in @post2018fast. Thanks to the ordered constraints, the <span style="font-variant:small-caps;">O-Gbs</span> is faster than <span style="font-variant:small-caps;">Gbs</span> in running speed and delivers the same performance as <span style="font-variant:small-caps;">Gbs</span>. The advantage of these three lexically decoding algorithm is that they do not need to retrain a translation model. Moreover, <span style="font-variant:small-caps;">SC</span> performs better than <span style="font-variant:small-caps;">Gbs</span> on the Fr$\Rightarrow$En and Zh$\Rightarrow$En tasks and outperforms <span style="font-variant:small-caps;">Dba</span> on all the three tasks, in terms of translation quality. This observation indicates that our model <span style="font-variant:small-caps;">SC</span> is able to learn how to integrate the lexical constraints correctly. Moreover, there is an additional advantage that the decoding speed of our model is comparable with that of the <span style="font-variant:small-caps;">Transformer</span> model and is much faster than lexically constrained decoding. Translation Memory ------------------ Since there is no translation history provided by human translators, we simply use the training set as the memory for simulation. For each sentence, we retrieve 100 translation pairs from the training set by using Apache Lucene @bialecki2012apache. We score the source side of each retrieved pair against the source sentence with fuzzy matching score and select top $N=5$ translation sentence pairs as a translation memory for the sentence to be translated, following @gu+:2018 [@zhang+:2018; @he+:2019:word]. Sentences from the target side in the translation memory are used to form a graph, with each word represented as a node and the connection between adjacent words in a sentence represented as an undirected edge. #### Datasets Following the previous works incorporating TM into NMT models, we use the JRC-Acquis corpus for training and evaluating our proposed model. The JRC-Acquis corpus is a collection of parallel legislative text of European union Law applicable in the EU member states. The highly related text in the corpus is suitable for us to make evaluations. To fully explore the effectiveness of our proposed model, we conduct translation experiments on three language pair bidirectionally, namely, en-fr, en-es, and en-de. We manage to obtain preprocessed datasets from @gu+:2018. For each language pair, we randomly select 3000 samples to form a development and a test set respectively. The rest of the pairs are used as the training set. Sentences longer than 80 and 100 are removed from the training and development/test set. The technique of Byte-pair Encoding @sennrich+:2016 is applied and the vocabulary size is set to be 20K for all the experiments. #### Systems The proposed graph based TM model is built on transformer @Vaswani:2017:NeurIPS, and it is denoted by <span>**G-TFM**</span>. We compare the proposed model against the following baselines:[^10] - <span>**TFM**</span>: It is a natural baseline as the proposed model is directly built upon the Transformer architecture. - <span>**P-RNN**</span>: It is an in-house implementation of @zhang+:2018 on top of RNN-search. - <span>**P-TFM**</span>: It similar to P-RNN but it is on top of Transformer rather than RNN-search as @zhang+:2018. - <span>**SEG-TFM**</span>: It implements the idea of @gu+:2018 on top of Transformer. Due to the architecture divergence between RNN-based NMT and Transformer, it only differs from the RNN-based counterpart in that two quantities $c_t$ and $z_t$ in @gu+:2018 are replaced by the hidden units obtained from the multi-head attention over the encoding units and the decoding hidden state units before the softmax operator. - <span>**SEQ-TFM**</span>: It sequentially encodes all target sentences in a TM as one of the baseline models. Specifically, each target sentence in TM goes through a multi-head mechanism and an immediate residual connection plus layer normalization in $l_{th}$ layer. The derived representations for these sentences are then concatenated to form the representation of the translation memory, which can be utilized flexibly in $l_{th}$ decoding layer. For training all systems, we maintain the same hyper-parameters for fair comparison. Besides, we adopt the same training algorithm to learn the models as follows. We use a customized leaning rate decay paradigm following Tensor2Tensor@vaswani2018tensor2tensor package. The learning rate increases linearly on early stages for a certain number of steps, known as warm-up steps, and decay exponentially later on. We set the warm-up step to be 5 epochs and we early stop the model after training 20 epochs, typically the time when the development performance varies insignificantly. Furthermore, since there is a hyperparameter in the system P-TFM of @zhang+:2018 which is sensitive to the specific translation task, we tune it carefully on the development set for all translation tasks. Its optimized value is 0.7 for es and de tasks while it is 0.8 for fr task. [^11] #### Results \[t!\] RNN P-RNN TFM P-TFM SEG-TFM SEQ-TFM G-TFM ------ ------- ------- ------- ------- --------- --------- ----------- Dev 57.74 60.87 62.78 63.97 63.16 64.81 **66.37** Test 58.06 61.52 62.68 64.30 62.94 65.16 **66.21** Table \[table:res:es-en\] shows the experiment results of all the systems on the es-en task in terms of BLEU. Several observations can be made from the results. First, the baseline TFM achieves substantial gains over RNN and even outperforms P-RNN by around 1 BLEU point on the test set. Compared with the strongest baseline P-TFM, the proposed SEQ-TFM and G-TFM are able to obtain some gains up to 1.9 BLEU points on the test set. This result verifies that our compact representation of TM is able to guide the decoding of the state-of-the-art model. \[t!\] ------------------------------------------------------------------------------- TFM SEG-TFM SEQ-TFM G-TFM --------------------------- ------- --------- --------- ----------------------- Train (s) 4579 44238 21920 8692 Test (s) 0.20
{'source': 'arXiv_out/2105'}