Text2SQLNet: Syntax Type-Aware Tree Networks for Text-to-SQL

  • Youssef MellahEmail author
  • El Hassane EttifouriEmail author
  • Toumi BouchentoufEmail author
  • Mohammed Ghaouth BelkasmiEmail author
Conference paper
Part of the Learning and Analytics in Intelligent Systems book series (LAIS, volume 7)


Building natural language interfaces to relational databases is an important and challenging problem in natural language processing (NLP), it requires a system that is able to understand natural language questions and generate corresponding SQL queries. In this paper, we present our idea of using type information and database content to better understand rare entities and numbers in natural language questions, in order to improve the model SyntaxSQLNet as the state of the art in Text-to-SQL task. We also present the global architecture and techniques that can be used in the implementation of our Neural Network (NN) model Text2SQLNet, with the integration of our idea that consists of using type information to better understand rare entities and numbers in natural language questions. We can also use the database content to better understand the user query if it is not well-formed. The implementation of this idea can further improve performance in the Text-to-SQL task.


NLP SQL NN SyntaxSQLNet Text-to-SQL Text2SQLNet 


  1. 1.
    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)CrossRefGoogle Scholar
  2. 2.
    Maxwell, C.: A Treatise on Electricity and Magnetism, vol. 2, 3rd edn, pp. 68–73. Clarendon, Oxford (1892)Google Scholar
  3. 3.
    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)CrossRefGoogle Scholar
  4. 4.
    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)CrossRefGoogle Scholar
  5. 5.
    Androutsopoulos, I., Ritchie, G.D., Thanisch, P.: Natural language interfaces to databases - an introduction. Natural language engineering 1(1), 29–81 (1995)CrossRefGoogle Scholar
  6. 6.
    Yu, T., Yasunaga, M., Yang, K., et al.: SyntaxSQLNet: syntax tree networks for complex and cross-domaintext-to-SQL task. arXiv preprint. arXiv:1810.05237 (2015)
  7. 7.
    Zelle, J.M., Mooney, R.J.: Learning to parse database queries using inductive logic programming. In: AAAI/IAAI, pp. 1050–1055, Portland, OR. AAAI Press/MIT Press, Cambridge (1996)Google Scholar
  8. 8.
    Zettlemoyer, L.S., Collins, M.: Learning to map sentences to logical form: structured classification with probabilistic categorial grammars. UAI (2005)Google Scholar
  9. 9.
    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)Google Scholar
  10. 10.
    Das, D., Schneider, N., Chen, D., Smith, N.A.: Probabilistic frame-semantic parsing. In: NAACL (2010)Google Scholar
  11. 11.
    Liang, P., Jordan, M.I., Klein, D.: Learning dependency-based compositional semantics. In: Association for Computational Linguistics (ACL), pp. 590–599 (2011)Google Scholar
  12. 12.
    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)Google Scholar
  13. 13.
    Asian Federation of Natural Language Processing, ACL, July 26–31, 2015, Beijing, China, Long Papers, vol. 1, pp. 1470–1480 (2015)Google Scholar
  14. 14.
    Herzig, J., Berant, J.: Decoupling structure and lexicon for zero-shot semantic parsing. In: EMNLP (2018)Google Scholar
  15. 15.
    Warren, D.H., Pereira, F.C.: An efficient easily adaptable system for interpreting natural language queries. Comput. Linguist. 8(3–4), 110–122 (1982)Google Scholar
  16. 16.
    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)Google Scholar
  17. 17.
    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, Berlin (2006)Google Scholar
  18. 18.
    Giordani, A., Moschitti, A.: Translating questions to SQL queries with generative parsers discriminatively reranked. In: COLING (Posters), pp. 401–410 (2012)Google Scholar
  19. 19.
    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)CrossRefGoogle Scholar
  20. 20.
    Li, F., Jagadish, H.V.: Constructing an interactive natural language interface for relational databases. VLDB 8(1), 73–84 (2014)Google Scholar
  21. 21.
    Yaghmazadeh, N., Wang, Y., Dillig, I., Dillig, T.: SQLizer: query synthesis from natural language. Proc. ACM Program. Lang. 1(OOPSLA), 63:1–63:26 (2017)CrossRefGoogle Scholar
  22. 22.
    Zhong, V., Xiong, C., Socher, R.: Seq2SQL: generating structured queries from natural language using reinforcement learning. CoRR. arXiv:1709.00103 (2017)
  23. 23.
    Xu, X., Liu, C., Song, D.: SQLNet: generating structured queries from natural language without reinforcement learning. arXiv preprint. arXiv:1711.04436 (2017)
  24. 24.
    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, vol. 1 (Long Papers), pp. 1339–1349. Association for Computational Linguistics (2018)Google Scholar
  25. 25.
    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, August 7–12, 2016, Berlin, Germany, vol. 1, Long Papers (2016)Google Scholar
  26. 26.
    Yin, P., Neubig, G.: A syntactic neural model for general-purpose code generation. In: ACL, no. 1, pp. 440–450. Association for Computational Linguistics (2017)Google Scholar
  27. 27.
    Rabinovich, M., Stern, M., Klein, D.: Abstract syntax networks for code generation and semantic parsing. In: ACL, no. 1, pp. 1139–1149. Association for Computational Linguistics (2017)Google Scholar
  28. 28.
    Agrawal, R., Srikant, R.: Searching with numbers. IEEE Trans. Knowl. Data Eng. 15(4), 855–870 (2003)CrossRefGoogle Scholar

Copyright information

© Springer Nature Switzerland AG 2020

Authors and Affiliations

  1. 1.NovelisOujdaMorocco
  2. 2.National School of Applied SciencesOujdaMorocco

Personalised recommendations