Abstract
Databases store a vast amount of today’s data and information, and to access that data users are required to have command over SQL or equivalent interface language. Hence, using a system that can convert a natural language to equivalent SQL query would make the data more accessible. In this sense, building natural language interfaces to relational databases is an important and challenging problem in natural language processing (NLP) and a widely studied field, and found recently momentum again due to the introduction of large-scale Datasets. In this paper, we present our approach based on word embedding and Recurrent Neural Networks (RNN), precisely on Long Short-Term Memory (LSTM) and Gated Recurrent Units (GRU) cells. We present also the DataSet used for training and testing our models, based on WikiSQL, and finally we show where we arrived in terms of accuracy.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Hillestad, R., Bigelow, J., Bower, A., Girosi, F., Meili, R., Scoville, R., Taylor, R.: Can electronic medical record systems transform health care? potential health benefits, savings, and costs. Health Aff. 24(5), 1103–1117 (2005)
Beck, T., Demirgüç-Kunt, A., Levine, R.: A new database on the structure and development of the financial sector. World Bank Econ. Rev. 14(3), 597–605 (2000)
Ngai, E.W.T., Xiu, L., Chau, D.C.K.: Application of data mining techniques in customer relationship management: a literature review and classification. Expert Syst. Appl. 36(2), 2592–2602 (2009)
Androutsopoulos, I., Ritchie, G.D., Thanisch, P.: Natural language interfaces to databases–an introduction. Nat. Lang. Eng.(1995)
Popescu, A.-M., Etzioni, O., Kautz, H.: Towards a theory of natural language interfaces to databases. In: Proceedings of the 8th International Conference on Intelligent User Interfaces, pp. 149–157 (2003)
Bakliwal, A., Arora, P., Patil, A., et al.: Towards enhanced opinion classification using NLP techniques. In: Proceedings of the Workshop on Sentiment Analysis where AI Meets Psychology (SAAIP 2011), pp. 101–107 (2011)
Mikolov, T., Karafiát, M., Burget, L., et al.: Recurrent neural network based language model. In: Eleventh Annual Conference of the International Speech Communication Association (2010)
Sundermeyer, M., Schlüter, R., Ney, H.: LSTM neural networks for language modeling. In: Thirteenth Annual Conference of the International Speech Communication Association (2012)
Dey, R., Salemt, F.M.: Gate-variants of gated recurrent unit (GRU) neural networks. In: 2017 IEEE 60th International Midwest Symposium on Circuits and Systems (MWSCAS), pp. 1597–1600. IEEE (2017)
Xu, X., Liu, C., Song, D.: SQLNET: generating structured queries from natural language without reinforcement learning. arXiv preprint arXiv:1711.04436 (2017)
Alur, R., Bodik, R., Juniwal, G., et al.: Syntax-guided synthesis. In: 2013 Formal Methods in Computer-Aided Design, pp. 1–8. IEEE (2013)
Solar-Lezama, A., Tancau, L., Bodik, R., et al.: Combinatorial sketching for finite programs. ACM Sigplan Not. 41(11), 404–415 (2006)
Zelle, J.M., Mooney, R.J.: Learning to parse database queries using inductive logic programming. In: AAAI/IAAI, Portland, OR, pp. 1050–1055. AAAI Press/MIT Press (1996)
Zettlemoyer, L.S., Collins, M.: Learning to map sentences to logical form: structured classification with probabilistic categorial grammars. UAI (2005)
Wong, Y.W., Mooney, R.J.: Learning synchronous grammars for semantic parsing with lambda calculus. In: Proceedings of the 45th Annual Meeting of the Association for Computational Linguistics (ACL-2007), Prague, Czech Republic (2007)
Das, D., Schneider, N., Chen, D., Smith, N.A.: Probabilistic frame-semantic parsing. In: NAACL (2010)
Liang, P., Jordan, M.I., Klein, D.: Learning dependency-based compositional semantics. In: Association for Computational Linguistics (ACL), pp. 590–599 (2011)
Banarescu, L., Bonial, C., Cai, S., et al.: Abstract meaning representation for sembanking. In: Proceedings of the 7th Linguistic Annotation Workshop and Interoperability with Discourse, pp. 178–186 (2013)
Asian Federation of Natural Language Processing, Volume 1: Long Papers, Beijing, China, 26–31 July 2015, pp. 1470–1480. ACL (2015)
Herzig, J., Berant, J.: Decoupling structure and lexicon for zero-shot semantic parsing. EMNLP (2018)
Warren, D.H.D., Pereira, F.C.N.: An efficient easily adaptable system for interpreting natural language queries. Comput. Linguist. 8(3–4), 110–122 (1982)
Li, Y., Yang, H., Jagadish, H.V.: Constructing a generic natural language interface for an xml database. In: EDBT, vol. 3896, pp. 737–754. Springer (2006)
Giordani, A., Moschitti, A.: Translating questions to SQL queries with generative parsers discriminatively reranked. In: COLING (Posters), pp. 401–410 (2012)
Wang, C., Cheung, A., Bodik, R.: Synthesizing highly expressive SQL queries from input-output examples. In: Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 452–466 (2017)
Li, F., Jagadish, H.V.: Constructing an interactive natural language interface for relational databases. In: VLDB (2014)
Yaghmazadeh, N., Wang, Y., Dillig, I., Dillig, T.: SQLizer: query synthesis from natural language. In: Proceedings of the ACM Programming Languages, 1(OOPSLA), pp. 63:1–63:26 (2017)
Popescu, A.-M., Etzioni, O., Kautz, H.: Towards a theory of natural language interfaces to databases. In: Proceedings of the 8th International Conference on Intelligent User Interfaces, pp. 149–157. ACM (2003)
Giordani, A., Moschitti, A.: Translating questions to SQL queries with generative parsers discriminatively reranked. In: COLING (2012)
Iyer, S., Konstas, I., Cheung, A., Krishnamurthy, J., Zettlemoyer, L.: Learning a neural semantic parser from user feedback. In: ACL (2017)
Zhong, V., Xiong, C., Socher, R.: Seq2SQL: generating structured queries from natural language using reinforcement learning. CoRR, abs/1709.00103 (2017)
Cai, R., Xu, B., Yang, X., et al.: An encoder-decoder framework translating natural language to database queries. arXiv preprint arXiv:1711.06061 (2017)
Castano, A., Casacuberta, F.: A connectionist approach to machine translation. In: Fifth European Conference on Speech Communication and Technology (1997)
Suhr, A., Iyer, S., Artzi, Y.: Learning to map context-dependent sentences to executable formal queries. In: Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pp. 2238–2249. Association for Computational Linguistics (2018)
Gur, I., Yavuz, S., Su, Y., Yan, X.: DialSQL: dialogue based structured query generation. In: Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1339–1349. Association for Computational Linguistics (2018)
Dong, L., Lapata, M.: Language to logical form with neural attention. In: Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, ACL 2016, Volume 1: Long Papers, Berlin, Germany, 7–12 August 2016 (2016)
Yin, P., Neubig, G.: A syntactic neural model for general-purpose code generation. In: ACL (1), pp. 440–450. Association for Computational Linguistics (2017)
Zhong, V., Xiong, C., Socher, R.: Seq2SQL: generating structured queries from natural language using reinforcement learning. arXiv preprint arXiv:1709.00103 (2017)
Pennington, J., Socher, R., Manning, C.D.: GloVe: Global vectors for word representation. In: EMNLP, pp. 1532–1543. ACL (2014)
Kingma, D.P., Ba, J.: Adam: a method for stochastic optimization. In: The 3rd International Conference for Learning Representations, San Diego (2015)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2021 Springer Nature Switzerland AG
About this paper
Cite this paper
Mellah, Y., Ettifouri, E.H., Rhouati, A., Dahhane, W., Bouchentouf, T., Belkasmi, M.G. (2021). SQL Generation from Natural Language Using Supervised Learning and Recurrent Neural Networks. In: Masrour, T., El Hassani, I., Cherrafi, A. (eds) Artificial Intelligence and Industrial Applications. A2IA 2020. Lecture Notes in Networks and Systems, vol 144. Springer, Cham. https://doi.org/10.1007/978-3-030-53970-2_17
Download citation
DOI: https://doi.org/10.1007/978-3-030-53970-2_17
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-53969-6
Online ISBN: 978-3-030-53970-2
eBook Packages: Intelligent Technologies and RoboticsIntelligent Technologies and Robotics (R0)