Neural Network Translation of Natural Language Queries to SQL

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional methods for accessing data in relational databases either provide ease of expression using natural language queries or the power of SQL, but not both, leading to inefficiencies and incorrect information retrieval.

Innovation Solution

A deep neural network-based system translates natural language queries into SQL queries by using aggregation classifiers, result column predictors, and condition clause predictors, leveraging the structure of SQL to reduce the output space and improve performance.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Ease of operation

If natural language queries are used to access data, then ease of expression is improved, but the power of expression and retrieval precision deteriorate

Engineering Contradiction:
Improveease of expressionVSAvoidretrieval precision
Core Design Contradiction:
Ease of operationVSMeasurement precision

Solution Approach 1:

The patent introduces a natural language processing system as an intermediary between the user and the database query system. This intermediary translates natural language queries into structured database queries, preserving both the ease of natural language input and the precision of structured query execution. The system acts as a mediator that converts informal language into formal query structures without losing the user's intent.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The system dynamically adjusts the level of language formality and structure based on the query requirements. It transforms the parameter of language structure from casual natural language to formal database query syntax, while maintaining the semantic meaning. This parameter transformation enables the system to accept easy-to-type natural language while generating precise executable queries.

Inventive Principle:
Principle #35Parameter changes

2Adaptability or versatility

If database query languages such as SQL are used, then the power of expression is improved, but ease of operation deteriorates due to the difficulty of learning

Engineering Contradiction:
Improvepower of expressionVSAvoidease of operation
Core Design Contradiction:
Adaptability or versatilityVSEase of operation

Solution Approach 1:

The natural language processing system serves as an intermediary that shields users from the complexity of SQL syntax. Users interact with the system using simple natural language, while the intermediary handles the transformation into powerful SQL queries. This eliminates the need for users to learn complex query languages while still accessing their full expressive power.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The system creates a simplified copy or representation of database query capabilities in natural language. Instead of requiring users to master formal query syntax, the system allows them to express queries using everyday language that mirrors their intent, then translates this natural language copy into the formal query structure needed for execution.

Inventive Principle:
Principle #26Copying

3Adaptability or versatility

If natural language queries are interpreted in multiple ways, then adaptability is improved, but retrieval precision and efficiency deteriorate

Engineering Contradiction:
Improveinterpretation flexibilityVSAvoidretrieval precision
Core Design Contradiction:
Adaptability or versatilityVSMeasurement precision

Solution Approach 1:

The system employs feedback mechanisms to clarify ambiguous natural language queries. When a query can be interpreted in multiple ways, the system provides feedback to the user asking for clarification or presents the possible interpretations and requests confirmation. This feedback loop ensures that the final query executed precisely matches the user's intent, resolving ambiguity while maintaining adaptability.

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The system performs preliminary analysis of the natural language query to identify potential ambiguities before executing the query. By detecting ambiguous interpretations in advance, the system can proactively seek clarification from the user or select the most likely interpretation based on context, preventing incorrect query execution while preserving the flexibility to handle multiple meanings.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS11526507B2Neural network based translation of natural language queries to database queries
Publication Date: 2022.12.13 SALESFORCE INC
  • US11526507B2 patent drawing
  • US11526507B2 patent drawing
  • US11526507B2 patent drawing

AI summary

A computing system uses neural networks to translate natural language queries to database queries. The computing system uses a plurality of machine learning based models, each machine learning model for generating a portion of the database query. The machine learning models use an input representation generated based on terms of the input natural language query, a set of columns of the database schema, and the vocabulary of a database query language, for example, structured query language SQL. The plurality of machine learning based models may include an aggregation classifier model for determining an aggregation operator in the database query, a result column predictor model for determining the result columns of the database query, and a condition clause predictor model for determining the condition clause of the database query. The condition clause predictor is based on reinforcement learning.