Skip to main content

GANCoder: An Automatic Natural Language-to-Programming Language Translation Approach Based on GAN

  • Conference paper
  • First Online:
Natural Language Processing and Chinese Computing (NLPCC 2019)

Part of the book series: Lecture Notes in Computer Science ((LNAI,volume 11839))

Abstract

We propose GANCoder, an automatic programming approach based on Generative Adversarial Networks (GAN), which can generate the same functional and logical programming language codes conditioned on the given natural language utterances. The adversarial training between generator and discriminator helps generator learn distribution of dataset and improve code generation quality. Our experimental results show that GANCoder can achieve comparable accuracy with the state-of-the-art methods and is more stable when programming languages.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 84.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Kamath, A., Das, R.: A survey on semantic parsing. CoRR abs/1812.00978 (2018)

    Google Scholar 

  2. Goodfellow, I., Pouget-Abadie, J., Mirza, M., et al.: Generative adversarial nets. In: Proceedings of the 28th Advances in Neural Information Processing Systems (NIPS 2014), pp. 2672–2680 (2014)

    Google Scholar 

  3. Dong, L., Lapata, M.: Language to logical form with neural attention. In: Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, Berlin, Germany, pp. 33–43 (2016)

    Google Scholar 

  4. Woods, W.A.: Progress in natural language understanding: an application to lunar geology. In: Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics of the June 4–8, 1973: National Computer Conference and Exposition, pp. 441–450. ACM (1973)

    Google Scholar 

  5. Quirk, C., Mooney, R.J., Galley, M.: Language to code: learning semantic parsers for if-this-then-that recipes. In: ACL (1), pp. 878–888 (2015)

    Google Scholar 

  6. Lin, X.V., Wang, C., Zettlemoyer, L., et al.: NL2Bash: a corpus and semantic parser for natural language interface to the linux operating system. In: LREC 2018 (2018)

    Google Scholar 

  7. Tai, K.S., Socher, R., Manning, C.D.: Improved semantic representations from tree-structured long short-term memory networks. In: ACL (1), pp. 1556–1566 (2015)

    Google Scholar 

  8. Mou, L., Li, G., Zhang, L., et al.: Convolutional neural networks over tree structures for programming language processing. In: AAAI 2016, pp. 1287–1293 (2016)

    Google Scholar 

  9. Zhang, J., Cui, L., Gouza, F.B.: EgoCoder: intelligent program synthesis with hierarchical sequential neural network model. CoRR abs/1805.08747 (2018)

    Google Scholar 

  10. Yin, P., Neubig, G.: A syntactic neural model for general-purpose code generation. In: ACL (1), pp. 440–450 (2017)

    Google Scholar 

  11. Vinyals, O., Fortunato, M., Jaitly, N.: Pointer networks. In: NIPS 2015, pp. 2692–2700 (2015)

    Google Scholar 

  12. Yu, L., Zhang, W., Wang, J., et al.: SeqGAN: sequence generative adversarial nets with policy gradient. In: AAAI 2017, pp. 2852–2858 (2017)

    Google Scholar 

  13. Liu, X., Kong, X., Liu, L., et al.: TreeGAN: syntax-aware sequence generation with generative adversarial networks. In: ICDM 2018, pp. 1140–1145 (2018)

    Google Scholar 

  14. Chen, L., Zeng, G., Zhang, Q., Chen, X.: Tree-LSTM Guided attention pooling of DCNN for semantic sentence modeling. In: Long, K., Leung, V.C.M., Zhang, H., Feng, Z., Li, Y., Zhang, Z. (eds.) 5GWN 2017. LNICST, vol. 211, pp. 52–59. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-72823-0_6

    Chapter  Google Scholar 

  15. Rabinovich, M., Stern, M., Klein, D.: Abstract syntax networks for code generation and semantic parsing. In: Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics, Vancouver, Canada, pp. 1139–1149 (2017)

    Google Scholar 

  16. Ling, W., Blunsom, P., Grefenstette, E., et al.: Latent predictor networks for code generation. In: Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, Berlin, Germany, pp. 599–609 (2016)

    Google Scholar 

  17. Wong, Y.W., Mooney, R.J.: Learning for semantic parsing with statistical machine translation. In: HLT-NAACL 2006 (2006)

    Google Scholar 

  18. Kate, R.J., Mooney, R.J.: Using string-kernels for learning semantic parsers. In: ACL 2006 (2006)

    Google Scholar 

  19. Radford, A., Metz, L., Chintala, S.: Unsupervised representation learning with deep convolutional generative adversarial networks. ICLR (Poster) (2016)

    Google Scholar 

  20. Arjovsky, M., Chintala, S., Bottou, L.: Wasserstein generative adversarial networks. In: ICML 2017, pp. 214–223 (2017)

    Google Scholar 

  21. Larsen, A.B.L., Snderby, S.K., Larochelle, H., Winther, O.: Autoencoding beyond pixels using a learned similarity metric. In: ICML 2016, pp. 1558–1566 (2016)

    Google Scholar 

  22. Woods, W.A.: Progress in natural language understanding: an application to lunar geology. In: Proceedings of the June 4–8, 1973, National Computer Conference and Exposition, pp. 441–450. ACM (1973)

    Google Scholar 

  23. Pennec, X., Ayache, N.: Uniform distribution, distance and expectation problems for geometric features processing. J. Math. Imaging Vis. 9(1), 49–67 (1998)

    Article  MathSciNet  Google Scholar 

Download references

Acknowledgements

This work was partially supported by National Key R&D Program of China (2018YFB1003404), National Natural Science Foundation of China (61672141), and Fundamental Research Funds for the Central Universities (N181605017).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Yanfeng Zhang .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Zhu, Y., Zhang, Y., Yang, H., Wang, F. (2019). GANCoder: An Automatic Natural Language-to-Programming Language Translation Approach Based on GAN. In: Tang, J., Kan, MY., Zhao, D., Li, S., Zan, H. (eds) Natural Language Processing and Chinese Computing. NLPCC 2019. Lecture Notes in Computer Science(), vol 11839. Springer, Cham. https://doi.org/10.1007/978-3-030-32236-6_48

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-32236-6_48

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-32235-9

  • Online ISBN: 978-3-030-32236-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics