Incorporating Noisy Length Constraints into Transformer with Length-aware Positional Encodings

4040

Authors

nan

Abstract

AbstractNeural Machine Translation often suffers from an under-translation problem due to its limited modeling of output sequence lengths. In this work, we propose a novel approach to training a Transformer model using length constraints based on length-aware positional encoding (PE). Since length constraints with exact target sentence lengths degrade translation performance, we add random noise within a certain window size to the length constraints in the PE during the training. In the inference step, we predict the output lengths using input sequences and a BERT-based length prediction model. Experimental results in an ASPEC English-to-Japanese translation showed the proposed method produced translations with lengths close to the reference ones and outperformed a vanilla Transformer (especially in short sentences) by 3.22 points in BLEU. The average translation results using our length prediction model were also better than another baseline method using input lengths for the length constraints. The proposed noise injection improved robustness for length prediction errors, especially within the window size.

Keywords

nan

Full Content

Proceedings of the 28th International Conference on Computational Linguistics, pages 350–356 Barcelona, Spain (Online), December 8-13, 2020 350 SQL Generation via Machine Reading Comprehension Zeyu Yan∗, Jianqiang Ma∗, Yang Zhang, Jianping Shen {yanzeyu751,majianqiang554,zhangyang147,shenjianping324}@pingan.com.cn AI Team, Ping An Life Insurance Company of China, Ltd Abstract Text-to-SQL systems offers natural language interfaces to databases, which can automatically generates SQL queries given natural language questions. On the WikiSQL benchmark, state-of- the-art text-to-SQL systems typically take a slot-filling approach by building several specialized models for each type of slot. Despite being effective, such modularized systems are complex and also fall short in jointly learning for different slots. To solve these problems, this paper proposes a novel approach that formulates the task as a question answering problem, where different slots are predicted by a unified machine reading comprehension (MRC) model. For this purpose, we use a BERT-based MRC model, which can also benefit from intermediate training on other MRC datasets. The proposed method can achieve competitive results on WikiSQL, suggesting it being a promising direction for text-to-SQL. 1 Introduction Text-to-SQL systems generate SQL queries according to given natural language (NL) queries, as shown in example (1), where the headers in the table schema are {PLAYER, COUNTRY, YEAR(S) WON, TOTAL, TO PAR, FINISH}. Text-to-SQL technology is very useful as it can empower humans to naturally interact with relational databases, which serve as foundations for the digital world today. As a subarea of semantic parsing (Berant et al., 2013), text-to-SQL is known to be difficult due to the flexibility in natural language. (1) a. NL Query: Who is the player from the United States with a total less than 293? b. SQL Query: SELECT Player FROM T WHERE Country = ‘United States’ AND Total < 293 Recently, by the development of deep learning, significant advances have been made in text-to-SQL. On the WikiSQL (Zhong et al., 2018) benchmark for multi-domain, single table text-to-SQL task, state-of- the-art systems (Hwang et al., 2019; He et al., 2019) can predict more than 80% of entire SQL queries correctly. Most of such systems take a slot-filling approach (Xu et al., 2018) that builds several (e.g. 6) specialized models, each of which is dedicated to predicting a particular type of slots, such as the column in SELECT, or the filter value in WHERE. For practical applications, however, such methods have two drawbacks: First, it is complex and delicate in architecture to rely on many dedicated modules working together to generate SQLs, which poses challenges in (joint) training, deployment and maintenance. Second, since most slot types are modeled with no or only limited dependencies on other slots, it is difficult for such models to leverage inter-dependencies of SQL slots. To deal with such problems, this paper formulates text-to-SQL as a question answering task (Section 3). In this formulation, we use a unified BERT-based (Devlin et al., 2019) machine reading comprehension (MRC) model to predict each type of SQL slots by answering template-generated questions. Then the SQL query is synthesized in the way as …

Content truncated to 500 words

Labeled Text

AbstractNeural Machine Translation often suffers from an under-translation problem due to its limited modeling of output sequence lengths. In this work, we propose a novel approach to training a Transformer model using length constraints based on length-aware positional encoding (PE). Since length constraints with exact target sentence lengths degrade translation performance, we add random noise within a certain window size to the length constraints in the PE during the training. In the inference step, we predict the output lengths using input sequences and a BERT-based length prediction model. Experimental results in an ASPEC English-to-Japanese translation showed the proposed method produced translations with lengths close to the reference ones and outperformed a vanilla Transformer (especially in short sentences) by 3.22 points in BLEU. The average translation results using our length prediction model were also better than another baseline method using input lengths for the length constraints. The proposed noise injection improved robustness for length prediction errors, especially within the window size.

Publication Details

Paper ID:
4040
Year:
2020
Publication:
TIPSTER
Publication Type:
conf
DOI:
nan