Introduction
The Web of Linked Data, including repositories like DBpedia, Freebase, and Yago, contains billions of semantically rich facts. However, extracting information from these sources typically requires writing complex SPARQL queries, creating a significant barrier for non-expert users. While keyword search is sufficient for simple lookups, it fails when users need to join multiple facts, such as asking, "Which female actor played in Casablanca and is married to a writer who was born in Rome?"
To bridge this gap, the DEANNA system was developed to automatically translate natural language questions into executable SPARQL queries. Unlike template-based systems, DEANNA treats the mapping of words to database entities, classes, and relations as a joint Integer Linear Programming (ILP) problem, leveraging the inherent structure of knowledge bases to resolve ambiguity.
The DEANNA Framework
The core architecture of DEANNA follows a multi-stage pipeline designed to transform a raw text question into a structured query. This process moves from initial phrase detection to the generation of semantic triple patterns.
- Phrase Detection & Mapping: The system identifies phrases using dependency parsing and maps them to candidate semantic items (entities, classes, or relations) in the knowledge base.
- Q-Unit Generation: Phrases are grouped into "triploids"—structures consisting of a relation and its two arguments—based on grammatical dependencies.
- Joint Disambiguation: This is the system's primary novelty, where all possible mappings are evaluated simultaneously to find the most coherent interpretation.
- Query Generation: The final disambiguated items are converted into standard SPARQL triple patterns.
Joint Disambiguation via ILP
The most significant challenge in natural language translation is ambiguity. For example, the phrase "Casablanca" could refer to the city in Morocco or the classic film. Similarly, "played in" might refer to an acting role or a sports performance.
DEANNA addresses this by building a "candidate graph" that contains all potential mappings for the identified phrases.
Instead of resolving these ambiguities in isolation, the system uses an Integer Linear Program (ILP) to find the optimal subgraph. The ILP is guided by two main factors:
- Type Constraints: The system uses the knowledge base's schema to prune impossible mappings. For instance, if the relation
actedInis selected, the subject must be a Person and the object must be a Movie. - Semantic Coherence: The objective function maximizes the similarity between phrases and database labels, as well as the relatedness between chosen items (calculated using Wikipedia inlink statistics).
Evaluation and Key Insights
The system was evaluated on the QALD-1 (Question Answering over Linked Data) benchmark and the NAGA collection (focused on movie data).
Key Results
- High Precision: The ILP approach proved highly effective, achieving a macro precision of 1.000 during the disambiguation step on the QALD-1 dataset.
- End-to-End Performance: On QALD-1, the system generated queries for 20 out of 27 questions, providing satisfactory answers for 10. On the NAGA dataset, it generated queries for 41 out of 44 questions, with 15 returning satisfactory results.
- Efficiency: Despite the NP-hard nature of ILP, the tight constraints provided by the knowledge base schema allowed the Gurobi solver to resolve graphs in just a few seconds.
Insights
The research highlights that joint optimization prevents the cascading errors common in traditional pipelines. Furthermore, the rich type signatures found in modern knowledge bases are not just data storage formats but powerful tools for natural language processing.
Limitations and Future Work
Currently, DEANNA is limited to select-project-join queries and cannot handle complex operations like aggregations (e.g., "How many...") or negations. Additionally, the system's performance is often bottlenecked by the incompleteness of the underlying knowledge bases. Future work aims to develop hybrid approaches that combine strict structured queries with looser keyword-based matching to improve recall when exact database matches are missing.
Summary updated