Generating SQL Queries Using Natural Language Syntactic Dependencies and Metadata
This research concerns with translating natural language questions into SQL queries by exploiting the MySQL framework for both hypothesis construction and thesis verification in the task of question answering. We use linguistic dependencies and metadata to build sets of possible SELECT and WHERE clauses. Then we exploit again the metadata to build FROM clauses enriched with meaningful joins. Finally, we combine all the clauses to get the set of all possible SQL queries, producing an answer to the question. Our algorithm can be recursively applied to deal with complex questions, requiring nested SELECT instructions. Additionally, it proposes a weighting scheme to order all the generated queries in terms of probability of correctness.
Our preliminary results are encouraging as they show that our system generates the right SQL query among the first five in the 92% of the cases. This result can be greatly improved by re-ranking the queries with a machine learning methods.
KeywordsNatural Language Processing Question Answering Metadata Information Schema SQL
Unable to display preview. Download preview PDF.
- 1.Marie-Catherine de Marneffe, B.M., Manning, C.D.: Generating typed dependency parses from phrase structure parses. In: Proceedings LREC 2006 (2006)Google Scholar
- 2.Porter, M.: Porter stemmer, http://tartarus.org/~martin/PorterStemmer/
- 3.Kate, R.J., Mooney, R.J.: Using string-kernels for learning semantic parsers. In: Proceedings of the 21st ICCL and 44th Annual Meeting of the ACL, pp. 913–920. Association for Computational Linguistics, Sydney (2006)Google Scholar
- 4.Popescu, A.M., Etzioni, O., Kautz, H.: Towards a theory of natural language interfaces to databases. In: Proceedings of the 2003 International Conference on Intelligent User Interfaces. Association for Computational Linguistics, Miami (2003)Google Scholar
- 5.Giordani, A., Moschitti, A.: Corpora for automatically learning to map natural language questions into sql queries. In: Proceedings of LREC 2010. European Language Resources Association (ELRA), Valletta (2010)Google Scholar
- 7.Ruwanpura, S.: Sq-hal: Natural language to sql translator, http://www.csse.monash.edu.au/hons/projects/2000/Supun.Ruwanpura