Abstract
In early natural language interfaces to databases (NLIDB), the "lexicon bottleneck"—the inability to store every possible database entry in primary memory—posed a significant challenge to system scalability and flexibility. This paper presents a "lazy evaluation" approach to parsing, where unknown terms are treated as wildcards and categorized post-hoc based on grammatical constraints and database metadata. By deferring categorization and utilizing cost-based verification heuristics, the system effectively handles out-of-vocabulary terms in dynamic database environments.
1. Introduction
The development of natural language interfaces in the late 1970s and early 1980s faced a fundamental hurdle: the scale and volatility of database content. For systems querying large-scale datasets, such as merchant shipping records, maintaining a comprehensive "in-core" lexicon was often impossible. Not only were these databases too large for the primary memory of the era, but they were also dynamic; new entries (e.g., a new ship name or a new port) rendered static dictionaries obsolete immediately.
Davidson and Kaplan (1980) proposed a departure from the traditional "fail-fast" parsing model. Instead of requiring every word to be defined before parsing begins, their system adopts a strategy of deferred commitment, allowing the grammatical structure of the query to narrow down the possible identities of unknown terms.
2. The Lexicon Bottleneck
Traditional parsers of the time typically halted when encountering a word not present in their dictionary. In the context of a database query, this meant that every ship name, cargo type, and geographical location had to be manually entered into the system's lexicon. The alternatives were equally problematic: interrupting the user for a definition (disrupting the flow of interaction) or performing exhaustive, computationally expensive searches across every field in the database to find a match. Davidson and Kaplan sought a way to handle these "out-of-vocabulary" terms gracefully and efficiently.
3. The Lazy Evaluation Strategy
The authors implemented their solution within the Knowledge Base Management System (KBMS) project, using the LIFER semantic grammar package. Unlike traditional syntactic grammars that look for broad categories like "nouns," semantic grammars use domain-specific categories like SHIPS, PORTS, or CARGOES. The core of their approach is a three-stage "lazy" process:
3.1 Deferred Decision
When the parser encounters an unknown term, it does not fail. Instead, it treats the term as a "wildcard" that can satisfy any semantic category required by the grammar to complete a valid parse. For example, in a shipping database, an unknown word might be tentatively labeled as a potential SHIP, PORT, or CARGO.
3.2 Syntactic and Semantic Pruning
As the parse progresses, the system uses the surrounding context to eliminate impossible categories. The grammar acts as a filter; if the unknown word appears in a sentence structure that requires a geographical location (e.g., "Is [X] in Italy?"), the system can immediately discard categories like CARGO if they do not lead to a grammatically valid interpretation of the whole sentence.
3.3 Cost-Based Verification
Once the parse is complete and a set of candidate categories remains, the system must verify the word against the actual database. To do this efficiently, the authors proposed a cost-based model:
- Indexed Fields: The system first checks database fields that are indexed or hashed, as these lookups are computationally "cheap."
- Unindexed Fields: If no match is found in indexed fields, the system moves to more expensive linear searches.
- User Clarification: If all database checks fail, the system finally prompts the user for information.
4. Implementation and Heuristics
The KBMS testbed utilized a CODASYL database of merchant shipping data with a core lexicon of approximately 400 words. Crucially, the system uses database metadata to guide its search. If the category SHIPS is indexed but PORTS is not, the system will prioritize checking the SHIPS file.
Furthermore, the system implements a "pre-fetching" optimization. Because the parser identifies the specific database query that would be executed if a guess is correct, it can combine the verification step with the actual retrieval of the answer. This merges the parsing and execution phases, reducing overall latency. Once a term is identified, it is temporarily cached in the in-core lexicon using an empirical aging process (similar to a Least Recently Used cache) to speed up subsequent queries.
5. Qualitative Results: The "Izmir" Case Study
The effectiveness of the system is demonstrated through qualitative examples. Consider the query: "Is Izmir in Italy?"
1. The system identifies Izmir as an unknown term.
2. The grammar suggests Izmir could be a SHIP, PORT, or CARGO.
3. The semantic context rules out CARGO because it doesn't fit the sentence structure.
4. The system checks the SHIPS file (which is indexed) and finds no entry for Izmir.
5. The system then assumes Izmir is a PORT (an unindexed category) and proceeds to query the database, successfully answering the user's question.
6. Limitations and Future Directions
While successful in the KBMS environment, the authors note several limitations:
- Grammar Specificity: The method relies on the high constraints of semantic grammars. In a general-purpose syntactic grammar, the number of possible categories for an unknown word would be significantly higher.
- Orthographic Errors: The system assumes unknown words are valid new entries. Consequently, it cannot easily distinguish between a new ship name and a typo of an existing ship name.
- Semantic Ambiguity: In cases where a term legitimately belongs to multiple categories (e.g., a ship named after a city), the system requires very specific semantic context to disambiguate without user intervention.
7. Conclusion
Davidson and Kaplan’s work represents an early and influential attempt to bridge the gap between natural language processing and database management. By treating the database itself as an extension of the lexicon and using grammatical structure as a search heuristic, they provided a blueprint for more resilient and scalable natural language interfaces.
Summary updated