Introduction
Semantic parsing is the task of translating natural language sentences into formal logical forms that can be executed against a database. For instance, converting "How many people live in Seattle?" into a query like count(λx.person(x) ∧ live(x, Seattle)).
A major hurdle in scaling these systems is the ontological mismatch problem. Traditional parsers often rely on a fixed dictionary mapping words directly to database relations. However, natural language is fluid, while database schemas are rigid. A user might ask for a "daughter," but a database like Freebase might only store gender: female and parent relations. Manually mapping every linguistic variation to millions of database entities is unfeasible. This paper presents a two-stage approach that decouples linguistic structure from the target ontology to overcome this bottleneck.
Methodology: A Two-Stage Approach
The authors propose a system that separates how we speak from how data is stored through a domain-independent parsing stage followed by an on-the-fly ontology matching stage.
1. Domain-Independent Parsing
First, the system uses a Combinatory Categorial Grammar (CCG) to construct an "underspecified" logical form ($l_0$). This representation captures the sentence's linguistic structure using generic placeholders rather than specific database constants. By utilizing a domain-independent lexicon and POS tags from Wiktionary, the parser remains portable across different databases.
2. On-the-Fly Ontology Matching
The second stage transforms the generic $l_0$ into a domain-specific logical form ($y$) using a learned model. This transformation is driven by three primary operations:
- Collapse: Merging multiple linguistic concepts into a single database relation.
- Split: Expanding a single word into multiple database relations (e.g., "daughter" $\rightarrow$
female+child). - Constant Replacement: Swapping generic placeholders for actual database entities or relations.
Training and Supervision
The model is trained using weak supervision. Rather than requiring expensive, hand-labeled logical forms, it learns from question-answer pairs. If a generated logical form retrieves the correct answer from the database, it is treated as a positive signal. The ontology matcher leverages lexical cues (string similarity, word stems, Wiktionary definitions) and the database's own structure to identify plausible mappings.
Evaluation and Results
The approach was evaluated on two benchmarks: GeoQuery (880 geography questions) and Freebase QA (917 open-domain questions).
- State-of-the-Art Performance: On Freebase QA, the model achieved 68.0% Recall, a 9-point improvement over previous systems. On GeoQuery, it reached 89.0% accuracy, matching specialized, domain-specific parsers.
- Cross-Domain Robustness: The system demonstrated strong generalization. When trained on one topic (e.g., film) and tested on another (e.g., sports), it maintained a high recall of 67.9%.
- Handling Unseen Vocabulary: Because matching is based on similarity and context rather than fixed lookups, the system can successfully parse questions containing words not encountered during training.
Error Analysis and Future Work
Despite its success, the authors identified three main sources of error:
- Structural Matching (30%): The model occasionally confuses the direction of relations (e.g., confusing "parent of" with "child of").
- Lexical Ambiguity (35%): Vague questions make it difficult to distinguish between similar relations, such as "opening date" versus "closing date."
- Database Incompleteness (10%): Failures occurring when the answer is simply missing from the knowledge base.
Future research may focus on more nuanced definitions of semantic correctness and applying this two-stage logic to other domains, such as robotics or dialogue systems.
Summary updated