Natural Language Query Construction via Knowledge Graph Schema Wiring

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing methods for constructing Structured Query Language (SQL) statements from natural language questions are limited in handling non-semantically tractable questions and suffer from issues like order dependency in sequence-to-sequence models, and SQL sketch-based approaches can only construct basic SQL statements.

Innovation Solution

A knowledge graph-based approach that employs a domain knowledge graph model and a database schema 'wiring' model to construct SQL statements from natural language questions, allowing for the inference of implied knowledge and leveraging conversational context to understand questions without requiring explicit mention of all knowledge facets.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If sequence-to-sequence models are used to construct SQL statements from natural language questions, then the system can handle diverse natural language inputs, but the model performance deteriorates due to constraint ordering dependency

Engineering Contradiction:
Improvehandling diverse natural language inputsVSAvoidmodel performance stability
Core Design Contradiction:
Adaptability or versatilityVSReliability

Solution Approach 1:

The system performs preliminary actions by using reinforcement learning to learn optimal constraint ordering strategies before actual SQL generation. The model is pre-trained on synthetic data with varied constraint orderings, enabling it to handle different natural language input structures without performance degradation during inference.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system changes parameters by dynamically adjusting the ordering of constraints in the SQL statement based on the natural language question structure. Instead of fixing constraint order, the model learns to optimize the sequence of WHERE clause conditions, JOIN operations, and other constraints to match the semantic structure of the input question.

Inventive Principle:
Principle #35Parameter changes

2Ease of manufacture

If SQL sketch-based approaches are used to construct SQL statements, then the construction process is simplified, but the system can only generate basic SQL statements with limited functionality

Engineering Contradiction:
ImproveSQL statement construction simplicityVSAvoidSQL statement functionality
Core Design Contradiction:
Ease of manufactureVSAdaptability or versatility

Solution Approach 1:

The system segments the SQL generation process into distinct components: schema linking, constraint identification, and statement assembly. By breaking down complex SQL generation into manageable segments, the system maintains simplicity while handling advanced SQL constructs including multiple JOINs, subqueries, aggregate functions, and complex WHERE clauses.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system uses nested structures to build SQL statements from inner to outer layers. Basic SELECT-FROM-WHERE templates serve as the core structure, with additional clauses like JOINs, subqueries, and aggregate functions nested within or around the base structure, enabling progressive complexity while maintaining generation simplicity.

Inventive Principle:
Principle #7Nested doll (Nesting)

3Reliability

If early max-flow graph match approaches are used to construct SQL statements, then the system can answer semantically tractable questions, but it fails to handle non-semantically tractable questions containing words absent from predetermined lexicon

Engineering Contradiction:
Improveanswer accuracy for tractable questionsVSAvoidhandling non-tractable questions
Core Design Contradiction:
ReliabilityVSAdaptability or versatility

Solution Approach 1:

The system employs self-service mechanisms through automatic schema linking and entity resolution. Instead of relying on predetermined lexicons, the model automatically connects natural language entities to database schema elements using reinforcement learning, enabling it to handle questions with novel or domain-specific terminology without manual lexicon updates.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The system changes the approach from fixed lexicon matching to dynamic entity resolution. The reinforcement learning model learns to map natural language terms to schema elements based on contextual cues and semantic relationships, allowing flexible handling of varied terminology while maintaining accurate SQL generation for both tractable and non-tractable questions.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS10872083B2Constructing structured database query language statements from natural language questions
Publication Date: 2020.12.22 MICROSOFT TECHNOLOGY LICENSING LLC
  • US10872083B2 patent drawing
  • US10872083B2 patent drawing
  • US10872083B2 patent drawing

AI summary

Computer-implemented techniques for constructing structured database query language statements from natural language questions are disclosed. In some embodiments, a knowledge graph-based approach is employed to construct a structured database query language statement such as, for example, a Structure Query Language (SQL) statement, from a natural language question. The approach encompasses a domain knowledge graph model and a database schema wiring model. The domain knowledge graph model represents domain-specific knowledge about the underlying database data in the form of a graph having nodes and directed edges between the nodes. The database schema wiring model maps routes in the domain knowledge graph to database schema elements. The techniques allow a natural language interface system to accurately translate domain-specific natural language questions posed by users to structured database query language statements that can be executed against a structured database to answer the natural language question.