The embodiment of the specification provides a method and device for training a sequence generation model. According to the method, first, an original training sample is obtained, which includes a first
sentence for querying a target data table through a
natural language,
metadata of the target data table, and a second
sentence as a
data query language. Then, according to a preset probability, a predetermined number of
noise adding operations are applied to the training sample, wherein any one of the
noise adding operations at least includes modifying one of the first
sentence and the second sentence, thereby generating a
noise-added sample including a source sentence, target
metadata and a target sentence. Then, an input sequence is formed based on the source sentence and the target
metadata, the input sequence is processed by using the sequence generation model to obtain an output sequence, and the sequence generation model is updated according to the output sequence and the target sentence.