Sequence-to-Sequence Model for Natural Language Database Querying

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Lay persons find it difficult to query relational databases intuitively without specialized training in structured query languages like SQL, due to the unintuitive organization of data into tables and complex schema understanding.

Innovation Solution

A machine learning model, specifically a sequence-to-sequence learning model with encoder and decoder modules, is trained to convert unstructured search queries into structured database queries, utilizing attention mechanisms to encode database schema information and generate queries that can be executed by a query processor.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Power

If structured query languages like SQL are used to query relational databases, then query power and data extraction capability are improved, but ease of operation deteriorates due to specialized training requirements and complex syntax

Engineering Contradiction:
Improvequery powerVSAvoidease of operation
Core Design Contradiction:
PowerVSEase of operation

Solution Approach 1:

The patent introduces a machine learning model as an intermediary between the user's natural language query and the database schema. This mediator automatically translates unstructured natural language into structured SQL queries, eliminating the need for users to directly interact with complex SQL syntax while preserving query power. The ML model acts as a translator that bridges the gap between simple user intent and complex database operations.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The system enables self-service querying by automatically generating and executing SQL queries based on natural language input without requiring user intervention in the query construction process. The machine learning model autonomously handles the complex task of translating user-friendly queries into executable database operations, allowing lay persons to perform sophisticated data extraction independently.

Inventive Principle:
Principle #25Self-service

2Quantity of substance

If database schema is made more complex to accommodate relational data organization, then data storage efficiency is improved, but ease of operation deteriorates due to difficulty in understanding table relationships and keys

Engineering Contradiction:
Improvedata storage efficiencyVSAvoidease of operation
Core Design Contradiction:
Quantity of substanceVSEase of operation

Solution Approach 1:

The machine learning model serves as an intermediary that automatically interprets complex database schema relationships and translates them into natural language queries. It handles the complexity of table relationships, foreign keys, and joins internally, presenting a simplified interface to users while maintaining efficient data organization and retrieval.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The system changes the interface parameters from structured SQL syntax to unstructured natural language. This parameter transformation allows users to interact with databases using familiar conversational language rather than complex query syntax, while the underlying database schema remains optimized for efficient relational data storage.

Inventive Principle:
Principle #35Parameter changes

3Productivity

If data is organized into multiple tables with shared keys to improve data management, then data organization efficiency is improved, but ease of operation deteriorates due to arbitrary table placement and complex relationships

Engineering Contradiction:
Improvedata organization efficiencyVSAvoidease of operation
Core Design Contradiction:
ProductivityVSEase of operation

Solution Approach 1:

The machine learning model acts as a mediator that automatically navigates the complex network of tables and relationships defined in the database schema. It understands foreign key connections, joins between tables, and data relationships without requiring users to manually trace these connections, thereby maintaining high data organization efficiency while simplifying user interaction.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent replaces the mechanical process of manually constructing queries by tracing table relationships and keys with an automated machine learning system. The ML model substitutes human manual query building with automated translation from natural language to SQL, eliminating the burden of understanding arbitrary table placements and complex relationships.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

Data Source

PatentUS11921711B2Trained sequence-to-sequence conversion of database queries
Publication Date: 2024.03.05 ALIBABA GROUP HOLDING LTD
  • US11921711B2 patent drawing
  • US11921711B2 patent drawing
  • US11921711B2 patent drawing

AI summary

Methods and systems are provided for sequence-to-sequence conversion from unstructured search queries to structured database queries, so that lay persons may retrieve information from relational databases without specialized knowledge of database query languages. An encoder module and a decoder module of a learning model are trained to convert an unstructured search query to an intermediate feature vector by computing co-attention and self-attention based on a context string and a database schema, encoding the database schema in the context string by application of self-attention between the context string containing tokens of the database schema with learned structural attention heads which relate the token to logic of the database. Training is performed using labeled training datasets which include structured database queries which are normalized by parsing into a semantic representation thereof, followed by linearization.