Constraint-Guided Database Query Generation From Natural Language
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Machine learning algorithms (MLAs) often output predictions that are incompatible with known conditions or each other, leading to problematic outputs, and users face difficulties in writing database queries, especially those unfamiliar with computer programming.
Innovation Solution
A method and system that utilize a pipeline of MLAs trained to predict classes, applying constraints to their outputs to generate accurate database queries from natural language inputs, allowing users to refine queries based on user feedback and constraints.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If MLAs are used to generate database queries from natural language input, then ease of operation is improved, but reliability deteriorates due to incompatible predictions
Solution Approach 1:
The patent introduces constraints as intermediary elements that mediate between MLA predictions and final query generation. These constraints encode domain knowledge and business rules, filtering and adjusting MLA outputs to ensure compatibility and accuracy before generating the final database query.
Solution Approach 2:
The system implements feedback loops where constraint violations are detected and used to refine MLA predictions. When predictions fail to satisfy constraints, the system adjusts the predictions iteratively until compatibility is achieved, ensuring reliable query generation while maintaining ease of operation.
2Adaptability or versatility
If multiple MLAs are used to predict different aspects of the query, then functionality is improved, but device complexity increases
Solution Approach 1:
The patent segments the query generation task into multiple independent prediction components, each handled by a specialized MLA. This segmentation allows each model to focus on specific aspects (SELECT fields, WHERE conditions, etc.), improving overall capability while managing complexity through modular architecture.
Solution Approach 2:
The constraint satisfaction framework serves as a universal mechanism that handles all types of predictions from multiple MLAs. This multi-functional approach allows the same constraint system to manage diverse prediction types, reducing overall system complexity despite multiple specialized components.
3Manufacturing precision
If constraints are applied to filter MLA outputs, then manufacturing precision is improved, but loss of information increases
Solution Approach 1:
The patent changes parameters of the probability distribution to satisfy constraints while preserving as much information as possible. Instead of simply filtering out predictions, the system adjusts probability values and re-normalizes distributions, maintaining the relative ordering and uncertainty information while ensuring constraint compliance.
Data Source
AI summary
There is disclosed a method of and a system for generating a database query. A natural language input for requesting data from a database is received. A first portion of the natural language input is input to a first machine learning algorithm (MLA). A second portion of the natural language input is input to a second MLA. The first MLA outputs a first probability distribution. The second MLA outputs a second probability distribution. One or more sets of classes from the first probability distribution and the second probability distribution that satisfy a plurality of constraints are determined. A predicted probability is determined for each of the one or more sets of classes. A set of classes having a highest predicted probability from the one or more sets of classes is selected. A database query is generated based on the set of classes.


