Skip to main content

NL2Code: A Corpus and Semantic Parser for Natural Language to Code

  • Conference paper
  • First Online:
Advances in Smart Technologies Applications and Case Studies (SmartICT 2019)

Abstract

In this work, we present a new method of semantic analysis and data allowing the automatic generation of source code from specifications and descriptions written in natural languages (NL2Code). Our long-term goal is to allow any user to create an application from a specification describing the need for a complete system. It involves the realization of a study, the design and the implementation of an intelligent system allowing the automatic generation of a computer project by answering the needs of the user (skeleton, configuration, scripts of initialization, ...) expressed in natural language. We are taking a first step in this area by providing a new dataset specific to our Novelis company and putting in place an approach that allows the machine to understand the user’s need, expressed in natural language in a specific area.

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 259.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 329.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 329.99
Price excludes VAT (USA)
  • Durable hardcover 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. Desai, A., Gulwani, S., Hingorani, V., Jain, N., Karkare, A., Marron, M., Roy, S.: Program synthesis using natural language. In: Proceedings of the 38th International Conference on Software Engineering, pp. 345–356. ACM, May 2016

    Google Scholar 

  2. Graves, A., Wayne, G., Danihelka, I.: Neural turing machines. arXiv preprintarXiv:1410.5401 (2014)

  3. Joulin, A., Mikolov, T.: Inferring algorithmic patterns with stack-augmented recurrent nets. In: Advances in Neural Information Processing Systems, pp. 190–198 (2015)

    Google Scholar 

  4. Quirk, C., Mooney, R., Galley, M.: Language to code: learning semantic parsers for if-this-then-that recipes. In: Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing, vol. 1, pp. 878–888 (2015)

    Google Scholar 

  5. Jurafsky, D.: Speech and Language Processing. Pearson Education India (2000)

    Google Scholar 

  6. Shaw, D., Wartout, W., Green, C.: Inferring lisp programs from examples. In: IJCAI, vol. 75, pp. 260–267, September 1975

    Google Scholar 

  7. Parisotto, E., Mohamed, A.R., Singh, R., Li, L., Zhou, D., Kohli, P.: Neuro-symbolic program synthesis. arXiv preprintarXiv:1611.01855 (2016)

  8. Berant, J., Chou, A., Frostig, R., Liang, P.: Semantic parsing on freebase from question-answer pairs. In: Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pp. 1533–1544 (2013)

    Google Scholar 

  9. Mooney, R.J.: Semantic parsing: past, present, and future. In: ACL Workshop on Semantic Parsing. Presentation Slides (2014)

    Google Scholar 

  10. Liu, K., Kim, D., Bissyande, T.F., Kim, T., Kim, K., Le Traon, Y.: Learning to sport and refactor inconsistent method names. In: 41st ACM/IEEE International Conference on Software Engineering (ICSE). IEEE (2019)

    Google Scholar 

  11. Manna, Z., Waldinger, R.: Knowledge and reasoning in program synthesis. Artif. Intell. 6(2), 175–208 (1975)

    Article  MathSciNet  Google Scholar 

  12. Banarescu, L., Bonial, C., Cai, S., Georgescu, M., Griffitt, K., Hermjakob, U., Knight, K., Koehn, P., Palmer, M., Schneider, N.: Abstract meaning representation for sembanking. In: Proceedings of the 7th Linguistic Annotation Workshop and Interoperability with Discourse, pp. 178–186 (2013)

    Google Scholar 

  13. Kaiser, L., Sutskever, I.: Neural GPUs learn algorithms. arXiv preprintarXiv:1511.08228 (2015)

  14. Kushman, N., Barzilay, R.: Using semantic unification to generate regular expressions from natural language. In: Proceedings of the 2013 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 826–836 (2013)

    Google Scholar 

  15. Locascio, N., Narasimhan, K., DeLeon, E., Kushman, N., Barzilay, R.: Neural generation of regular expressions from natural language with minimal domain knowledge. arXiv preprintarXiv:1608.03000 (2016)

  16. Parvez, M.R., Chakraborty, S., Ray, B., Chang, K.W.: Building language models for text with named entities. arXiv preprintarXiv:1805.04836 (2018)

  17. Clark, S., Curran, J.R.: Wide-coverage efficient statistical parsing with CCG and log-linear models. Comput. Linguist. 33(4), 493–552 (2007)

    Article  Google Scholar 

  18. Gao, S., Chen, C., Xing, Z., Ma, Y., Song, W., Lin, S.W.: A neural model for method name generation from functional description. In: 2019 IEEE 26th International Conference on Software Analysis, Evolution and Reengineering (SANER), pp. 414–421. IEEE (2019)

    Google Scholar 

  19. Gulwani, S., Nlyze, M.M.: Interactive programming by natural language for spreadsheet data analysis and manipulation. In: Proceedings of the 2014 ACM SIGMOD International Conference on Management of Data, pp. 803–814. ACM (2014)

    Google Scholar 

  20. Gulwani, S., Polozov, O., Singh, R.: Program synthesis. Found. Trends Program. Lang. 4(1–2), 1–119 (2017)

    Google Scholar 

  21. Iyer, S., Konstas, I., Cheung, A., Zettlemoyer, L.: Summarizing source code using a neural attention model. In: Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, vol. 1, pp. 2073–2083 (2016)

    Google Scholar 

  22. Malik, R.S., Patra, J., Pradel, M.: NL2type: inferring JavaScript function types from natural language information (2019)

    Google Scholar 

  23. Reed, S., De Freitas, N.: Neural programmer-interpreters. arXiv preprintarXiv:1511.06279 (2015)

  24. Summers, P.D.: A methodology for LISP program construction from examples. J. ACM (JACM) 24(1), 161–175 (1977)

    Article  MathSciNet  Google Scholar 

  25. Gvero, T., Kuncak, V.: Synthesizing Java expressions from free-form queries. ACM SIGPLAN Not. 50(10), 416–432 (2015)

    Article  Google Scholar 

  26. Lau, T.: Programming by demonstration: a machine learning approach, Doctoral dissertation (2001)

    Google Scholar 

  27. Alon, U., Zilberstein, M., Levy, O., Yahav, E.: A general path-based representation for predicting program properties. ACM SIGPLAN Not. 53(4), 404–419 (2018)

    Article  Google Scholar 

  28. Alon, U., Zilberstein, M., Levy, O., Yahav, E.: code2vec: learning distributed representations of code. Proc. ACM Program. Lang. 3(POPL), 40 (2019)

    Article  Google Scholar 

  29. Lin, X.V., Wang, C., Pang, D., Vu, K., Zettlemoyer, L., Ernst, M.D.: Program synthesis from natural language using recurrent neural networks. University of Washington Department of Computer Science and Engineering, Seattle, WA, USA, Technical report, UW-CSE-17-03-01 (2017)

    Google Scholar 

  30. Lin, X.V., Wang, C., Zettlemoyer, L., Ernst, M.D.: NL2Bash: a corpus and semantic parser for natural language interface to the Linux operating system. arXiv preprintarXiv:1802.08979 (2018)

  31. Zhong, V., Xiong, C., Socher, R.: Seq2SQL: generating structured queries from natural language using reinforcement learning. arXiv preprintarXiv:1709.00103 (2017)

  32. Ling, W., Grefenstette, E., Hermann, K.M., Kočiský, T., Senior, A., Wang, F., Blunsom, P.: Latent predictor networks for code generation. arXiv preprintarXiv:1603.06744 (2016)

  33. Artzi, Y., Zettlemoyer, L.: Weakly supervised learning of semantic parsers for mapping instructions to actions. Trans. Assoc. Comput. Linguist. 1, 49–62 (2013)

    Article  Google Scholar 

  34. Manna, Z., Waldinger, R.J.: Toward automatic program synthesis. Commun. ACM 14(3), 151–165 (1971)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to El Hassane Ettifouri .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2020 The Editor(s) (if applicable) and The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Ettifouri, E.H., Dahhane, W., Berrajaa, A., Bouchentouf, T., Rahmoun, M. (2020). NL2Code: A Corpus and Semantic Parser for Natural Language to Code. In: El Moussati, A., Kpalma, K., Ghaouth Belkasmi, M., Saber, M., Guégan, S. (eds) Advances in Smart Technologies Applications and Case Studies. SmartICT 2019. Lecture Notes in Electrical Engineering, vol 684. Springer, Cham. https://doi.org/10.1007/978-3-030-53187-4_65

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-53187-4_65

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-53186-7

  • Online ISBN: 978-3-030-53187-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics