Skip to main content

Automatic Generation and Reranking of SQL-Derived Answers to NL Questions

  • Conference paper
Book cover Trustworthy Eternal Systems via Evolving Software, Data and Knowledge (EternalS 2012)

Part of the book series: Communications in Computer and Information Science ((CCIS,volume 379))

Included in the following conference series:

Abstract

In this paper, given a relational database, we automatically translate a natural language question into an SQL query retrieving the correct answer. We exploit the structure of the DB to generate a set of candidate SQL queries, which we rerank with a SVM-ranker based on tree kernels. In particular we use linguistic dependencies in the natural language question and the DB metadata to build a set of plausible SELECT, WHERE and FROM clauses enriched with meaningful joins. Then, we combine all the clauses to get the set of all possible SQL queries, producing candidate queries to answer the question. This approach can be recursively applied to deal with complex questions, requiring nested queries. We sort the candidates in terms of scores of correctness using a weighting scheme applied to the query generation rules. Then, we use a SVM ranker trained with structural kernels to reorder the list of question and query pairs, where both members are represented as syntactic trees. The f-measure of our model on standard benchmarks is in line with the best models (85% on the first question), which use external and expensive hand-crafted resources such as the semantic interpretation. Moreover, we can provide a set of candidate answers with a Recall of the answer of about 92% and 96% on the first 2 and 5 candidates, respectively.

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 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.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

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Charniak, E.: A maximum-entropy-inspired parser. In: Proceedings of NAACL 2000 (2000)

    Google Scholar 

  2. Collins, M., Duffy, N.: New ranking algorithms for parsing and tagging: Kernels over discrete structures, and the voted perceptron. In: Proceedings of ACL 2002 (2002)

    Google Scholar 

  3. Garcia-Molina, H., Ullman, J.D., Widom, J.: Database Systems: The Complete Book, 2nd edn. Prentice Hall Press, Upper Saddle River (2008)

    Google Scholar 

  4. Giordani, A., Moschitti, A.: Corpora for automatically learning to map natural language questions into sql queries. In: Proceedings of LREC 2010, Valletta, Malta. European Language Resources Association (ELRA) (May 2010)

    Google Scholar 

  5. Granberg, J., Minock, M.: A natural language interface over the musicbrainz database. In: Proceedings of the 1st Workshop on Question Answering over Linked Data (QALD-1): Co-located with the 8th Extended Semantic Web Conference, pp. 38–43 (2011), QC 20120413

    Google Scholar 

  6. Joachims, T.: Making large-scale SVM learning practical. In: Schölkopf, B., Burges, C., Smola, A. (eds.) Advances in Kernel Methods (1999)

    Google Scholar 

  7. 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, Sydney, Australia, pp. 913–920. Association for Computational Linguistics (July 2006)

    Google Scholar 

  8. MacCartney, B., de Marneffe, M.-C., Manning, C.D.: Generating typed dependency parses from phrase structure parses. In: Proceedings LREC 2006 (2006)

    Google Scholar 

  9. Minock, M., Olofsson, P., Näslund, A.: Towards building robust natural language interfaces to databases. In: Kapetanios, E., Sugumaran, V., Spiliopoulou, M. (eds.) NLDB 2008. LNCS, vol. 5039, pp. 187–198. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  10. Popescu, A.-M., Etzioni, O.A., Kautz, H.A.: Towards a theory of natural language interfaces to databases. In: Proceedings of the 2003 International Conference on Intelligent User Interfaces, Miami. Association for Computational Linguistics (2003)

    Google Scholar 

  11. Ruwanpura, S.: Sq-hal: Natural language to sql translator

    Google Scholar 

  12. Salton, G.: Recent trends in automatic information retrieval. In: Proceedings of the 9th Annual International ACM SIGIR Conference on Research and Development in Information Retrieval, SIGIR 1986, Pisa, Italy, September 8-10, pp. 1–10. ACM (1986)

    Google Scholar 

  13. Shen, L., Joshi, A.K.: An SVM-based voting algorithm with application to parse reranking. In: Proceedings of the Seventh Conference on Natural Language Learning at HLT-NAACL 2003, pp. 9–16 (2003)

    Google Scholar 

  14. Tang, L.R., Mooney, R.J.: Using multiple clause constructors in inductive logic programming for semantic parsing. In: Flach, P.A., De Raedt, L. (eds.) ECML 2001. LNCS (LNAI), vol. 2167, pp. 466–477. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  15. Zettlemoyer, L.S., Collins, M.: Learning to map sentences to logical form: Structured classification with probabilistic categorial grammars. In: UAI, pp. 658–666 (2005)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2013 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Giordani, A., Moschitti, A. (2013). Automatic Generation and Reranking of SQL-Derived Answers to NL Questions. In: Moschitti, A., Plank, B. (eds) Trustworthy Eternal Systems via Evolving Software, Data and Knowledge. EternalS 2012. Communications in Computer and Information Science, vol 379. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-45260-4_5

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-45260-4_5

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-45259-8

  • Online ISBN: 978-3-642-45260-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics