Introduction
Natural Language Interfaces (NLIs) for databases have significantly lowered the barrier for data exploration, allowing users to query databases using natural language instead of complex SQL. However, novice analysts often face the "blank page" problem, where they lack sufficient knowledge of the database schema to formulate effective follow-up questions. This paper introduces QRec-NLI, a system designed to guide users through multi-table data exploration by recommending semantically relevant "next-step" queries based on their current context and intent.
System Architecture and Methodology
The core of QRec-NLI is a recommendation engine that leverages "crowd knowledge" from existing query logs to suggest relevant analytical paths. By treating large-scale datasets like Spider as a proxy for analytical common sense, the system learns which attributes and operations are typically queried together.
The system operates through several key components:
- Query Analyzer (NL2SQL): Uses SmBop to parse natural language queries into SQL.
- Recommendation Engine: Operates in four stages. It first identifies semantically similar domains in a reference dataset. It then provides initial recommendations based on common starting points. As the user interacts, it employs a contextual similarity measure with a decay factor to prioritize recent queries while maintaining overall exploration coherence.
- SQL2NL Translator: A fine-tuned T5-base model translates recommended SQL back into diverse, human-readable natural language questions.
- Visualization Generator: Uses NL4DV to automatically generate appropriate charts (e.g., bar charts, line graphs) based on the retrieved data.
User Workflow
The interface facilitates a seamless transition from exploration to insight synthesis. Users are not forced into a specific path but are provided with a gallery of options that reduce the cognitive load of remembering table names and column headers.
As shown in the workflow, users can select from recommended queries to explore different facets of the data. The system tracks the session history, allowing users to drag and drop interesting results into a persistent dashboard. This helps organize insights and provides a clear overview of the exploration progress.
Evaluation and Results
A user study involving 12 participants compared QRec-NLI against a standard NLI baseline. The results demonstrated significant improvements across several metrics:
- Efficiency: Task completion time dropped from 10.39 minutes to 6.89 minutes on average.
- Precision: Users reached insights with fewer queries (approx. 9.7 vs 16.6), suggesting more systematic exploration.
- Confidence: User confidence scores increased from 3.50/5 to 4.42/5.
- Relevance: The topical relevance of suggestions was rated highly at 4.55/5.
Conclusion and Future Work
QRec-NLI successfully addresses the "blank page" problem by providing context-aware, semantic query recommendations. While currently limited to basic SQL operations (selection, grouping, aggregation) and English language support, it represents a significant step toward more intuitive data exploration. Future work will focus on expanding the scope of supported SQL operations, such as complex filters and arithmetic, and improving robustness against noisy database schemas.
Summary updated