Code generation maps a program description to executable source code in a programming language. Existing approaches mainly rely on a recurrent neural network (RNN) as the decoder. However, we find that a program contains significantly more tokens than a natural language sentence, and thus it may be inappropriate for RNN to capture such a long sequence. In this paper, we propose a grammar-based structural convolutional neural network (CNN) for code generation. Our model generates a program by predicting the grammar rules of the programming language; we design several CNN modules, including the tree-based convolution and pre-order convolution, whose information is further aggregated by dedicated attentive pooling layers. Experimental results on the HearthStone benchmark dataset show that our CNN code generator significantly outperforms the previous state-of-the-art method by 5 percentage points; additional experiments on several semantic parsing tasks demonstrate the robustness of our model. We also conduct in-depth ablation test to better understand each component of our model.
Early studies on code generation mostly focus on domain specific languages @cite_22 @cite_25 @cite_18 . They are largely based on rules and human defined features, and thus are highly restricted. Recently, researchers introduce neural networks to generate code in a general-purpose programming language. adopt a sequence-to-sequence model, but enhance it with multiple predictors. Other studies generate programs along abstract syntax trees @cite_21 @cite_2 @cite_20 . However, their decoders are all based on RNNs, which are shown improper for code generation in our experiments. CNNs are origianlly used in classification tasks @cite_17 @cite_0 . propose a tree-based CNN to capture structural information. Such idea can be extended to general graphs, e.g., molecule analysis @cite_6 . Recently, researchers develop deep CNNs for decoders @cite_24 @cite_15 . In our paper, we incorporate the idea of structure-sensitive CNN and CNN for generation, and design a grammar-based structural CNN for code generation.
@cite_18 @cite_22 @cite_21 @cite_6 @cite_0 @cite_24 @cite_2 @cite_15 @cite_25 @cite_20 @cite_17
2612675303 2090985198 2122514299 1714639292
Attentional, RNN-based encoder-decoder models for abstractive summarization have achieved good performance on short input and output sequences. For longer documents and summaries however these models often include repetitive and incoherent phrases. We introduce a neural network model with a novel intra-attention that attends over the input and continuously generated output separately, and a new training method that combines standard supervised word prediction and reinforcement learning (RL). Models trained only with supervised learning often exhibit "exposure bias" - they assume ground truth is provided at each step during training. However, when standard word prediction is combined with the global sequence prediction training of RL the resulting summaries become more readable. We evaluate this model on the CNN Daily Mail and New York Times datasets. Our model obtains a 41.16 ROUGE-1 score on the CNN Daily Mail dataset, an improvement over previous state-of-the-art models. Human evaluation also shows that our model produces higher quality summaries. Rapid movement generation models are described in the literature as an efficient tool to apprehend the handwriting behavior. Fields of application are diverse, including handwriting description, regeneration, and more recently OCR. In this paper, we propose a grapheme-based approach to offline Arabic writer identification and verification. Rather than extracting naturel graphemes from a training corpus using segmentation and clustering, it synthesizes its own graphemes based on the beta-elliptic model. Originality lies in the independence of the grapheme codebook from any training process, and the use of a model instead. One full and four partial codebooks are generated and tested. Using feature selection, raw codebooks are reduced in size with respect to FDR, FDR and cross-correlation, and random subsampling criteria. A total of 60 feature vectors are extracted using template matching, and evaluated with 411 individual writers from the IFN ENIT database. The results presented in this study demonstrated the wide representativity and the good generalization capability of synthetic codebooks. We obtained a top1 rate=90.02 and a top5 rate=96.35 for writer identification, and an EER=2.1 for writer verification. Our approach showed better properties than most of the surveyed techniques in terms of supported corpus size and identification rates. To the best of our knowledge, this study is among the first to exploit the concept of model-based synthetic codebooks in writer identification and verification. HighlightsUniversal synthetic codebooks are used for writer identification and verification.The beta-elliptic handwriting generation model is used to create the codebooks.Neither corpus-driven training nor prior segmentation is needed in this approach.Synthetic codebook demonstrated good generalization capabilities for Arabic. Most previous work on trainable language generation has focused on two paradigms: (a) using a generation decisions of an existing generator. Both approaches rely on the existence of a handcrafted generation component, which is likely to limit their scalability to new domains. The first contribution of this article is to present Bagel, a fully data-driven generation method that treats the language generation task as a search for the most likely sequence of semantic concepts and realization phrases, according to Factored Language Models (FLMs). As domain utterances are not readily available for most natural language generation tasks, a large creative effort is required to produce the data necessary to represent human linguistic variation for nontrivial domains. This article is based on the assumption that learning to produce paraphrases can be facilitated by collecting data from a large sample of untrained annotators using crowdsourcing—rather than a few domain experts—by relying on a coarse meaning representation. A second contribution of this article is to use crowdsourced data to show how dialogue naturalness can be improved by learning to vary the output utterances generated for a given semantic input. Two data-driven methods for generating paraphrases in dialogue are presented: (a) by sampling from the n-best list of realizations produced by Bagel's FLM reranker; and (b) by learning a structured perceptron predicting whether candidate realizations are valid paraphrases. We train Bagel on a set of 1,956 utterances produced by 137 annotators, which covers 10 types of dialogue acts and 128 semantic concepts in a tourist information system for Cambridge. An automated evaluation shows that Bagel outperforms utterance class LM baselines on this domain. A human evaluation of 600 resynthesized dialogue extracts shows that Bagel's FLM output produces utterances comparable to a handcrafted baseline, whereas the perceptron classifier performs worse. Interestingly, human judges find the system sampling from the n-best list to be more natural than a system always returning the first-best utterance. The judges are also more willing to interact with the n-best system in the future. These results suggest that capturing the large variation found in human language using data-driven methods is beneficial for dialogue interaction. Generating natural language descriptions for in-the-wild videos is a challenging task. Most state-of-the-art methods for solving this problem borrow existing deep convolutional neural network (CNN) architectures (AlexNet, GoogLeNet) to extract a visual representation of the input video. However, these deep CNN architectures are designed for single-label centered-positioned object classification. While they generate strong semantic features, they have no inherent structure allowing them to detect multiple objects of different sizes and locations in the frame. Our paper tries to solve this problem by integrating the base CNN into several fully convolutional neural networks (FCNs) to form a multi-scale network that handles multiple receptive field sizes in the original image. FCNs, previously applied to image segmentation, can generate class heat-maps efficiently compared to sliding window mechanisms, and can easily handle multiple scales. To further handle the ambiguity over multiple objects and locations, we incorporate the Multiple Instance Learning mechanism (MIL) to consider objects in different positions and at different scales simultaneously. We integrate our multi-scale multi-instance architecture with a sequence-to-sequence recurrent neural network to generate sentence descriptions based on the visual representation. Ours is the first end-to-end trainable architecture that is capable of multi-scale region processing. Evaluation on a Youtube video dataset shows the advantage of our approach compared to the original single-scale whole frame CNN model. Our flexible and efficient architecture can potentially be extended to support other video processing tasks.