Structural Mapping between Natural Language Questions and SQL Queries

Giordani, Alessandra (2012) Structural Mapping between Natural Language Questions and SQL Queries. PhD thesis, University of Trento.

[img]
Preview
PDF - Doctoral Thesis
3701Kb

Abstract

A core problem in data mining is to retrieve data in an easy and human friendly way. Automatically translating natural language questions into SQL queries would allow for the design of effective and useful database systems from a user viewpoint. In this thesis, we approach such problem by carrying out a mapping between natural language (NL) and SQL syntactic structures. The mapping is automatically derived by applying machine learning algorithms. In particular, we generate a dataset of pairs of NL questions and SQL queries represented by means of their syntactic trees automatically derived by their respective syntactic parsers. Then, we train a classifier for detecting correct and incorrect pairs of questions and queries using kernel methods along with Support Vector Machines. Experimental results on two different datasets show that our approach is viable to select the correct SQL query for a given natural language questions in two target domains. Given that preliminary results were encouraging we implemented an SQL query generator that creates the set of candidate SQL queries which we rerank with a SVM-ranker based on tree kernels. In particular we exploit linguistic dependencies in the natural language question and the database 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 sub-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 again 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.}

Item Type:Doctoral Thesis (PhD)
Doctoral School:Information and Communication Technology
PhD Cycle:XXII
Subjects:Area 01 - Scienze matematiche e informatiche > INF/01 INFORMATICA
Uncontrolled Keywords:Natural Language Interfaces, Database, Question Answering, Kernel Methods, Tree Kernels
Additional Information:The work compiled in this thesis has been partially supported by the European Community's Seventh Framework Programme (FP7/2007-2013) under the grants #247758: EternalS - Trustworthy Eternal Systems via Evolving Software, Data and Knowledge, and #288024: LiMoSINe - Linguistically Motivated Semantic aggregation engiNes.
Funders:European Community
Repository Staff approval on:09 Nov 2012 11:53

Related URLs:

Repository Staff Only: item control page