# US 12,602,373 B2 · System and method for generating database queries based on natural language input

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 12,602,373 B2
- Document ID: US12602373B2
- Status: Granted
- Kind: B2
- Application number: 18/976,323
- Filed: 2024-12-10
- Published: 2025-06-19
- Granted: 2026-04-14
- Earliest claimed: 2023-12-19
- Assignees: Shopee IP Singapore Private Limited
- Applicants: Shopee IP Singapore Private Limited
- Inventors: Bin Fu; Hao-Tong Ye
- Web page: https://patentgrep.com/patent/US12602373B2

## CPC

- G06F 16/2423: {Interactive query statement specification based on a database schema}
- G06F 16/242: Query formulation
- G06F 16/243: {Natural language query formulation}
- G06F 16/24522: {Translation of natural language queries to structured queries}
- G06F 16/3329: Natural language query formulation
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Provided herein are systems, methods, and computer-readable media for generating one or more database queries based on a natural language input data. An example method comprises configuring, using a conversational artificial intelligence (AI) editing module, information for a task. Moreover, the method may further comprise parsing the configured information based on a database schema to obtain a parsed database schema. Further, the method may further comprise generating, using a natural language question-answering system, one or more database queries based on the parsed database schema and natural language input data.

## Claims

### Claim 1

A method for generating one or more database queries based on natural language input data, the method comprising:
configuring, using a conversational artificial intelligence (AI) editing module, information for completing a task-oriented dialogue based on natural language input data;
parsing the configured information based on a database schema;
generating a parsed database schema based on the parsed configured information;
generating, using a natural language question-answering system, one or more database queries based on the parsed database schema and the natural language input data;
obtaining at least one database entry from one or more databases by executing the one or more database queries;
comparing the at least one database entry with the configured information; and
generating a clarification prompt based on the comparison.

### Claim 2 (depends on 1)

The method of claim 1, wherein the natural language question-answering system is a table question-answering (TableQA) system or a knowledge-graph question-answering system.

### Claim 3 (depends on 1)

The method of claim 1, wherein the at least one database entry comprises a table, the table having at least one row and at least one column.

### Claim 4 (depends on 3)

The method of claim 3, further comprising:
determining whether there are multiple possible values based on the natural language input data and the table of the at least one database entry.

### Claim 5 (depends on 4)

The method of claim 4, further comprising:
determining there are multiple possible values; and
generating, using the natural language question-answering system, a clarification information based on the natural language input data.

### Claim 6 (depends on 1)

The method of claim 1, wherein the natural language input data comprises at least one of a text-based data, an audio data, or any combination thereof.

### Claim 7 (depends on 1)

The method of claim 1, wherein the database schema is Structured Query Language (SQL) database schema and the one or more database queries includes a SQL query.

### Claim 8 (depends on 1)

The method of claim 1, further comprising:
parsing, using a resource description framework schema, the natural language input data, wherein the generated one or more database queries includes a SPARQL query.

### Claim 9 (depends on 1)

The method of claim 1, wherein the conversational AI editing module comprises a chatbot dialogue flow editor module.

### Claim 10 (depends on 1)

The method of claim 1, wherein generating the clarification prompt comprises:
revising the configured information, wherein the clarification prompt is based on the revised configured information.

### Claim 11

A system for generating one or more database queries based on natural language input data, the system comprises:
at least one memory storing instruction; and
at least one processor coupled to the at least one memory, the at least one processor is configured to execute the instructions to:
configure information for completing a task-oriented dialogue based on natural language input data;
parse the configured information based on a database schema;
generate a parsed database schema based on the parsed configured information;
generate, using a natural language question-answering system, one or more database queries based on the parsed database schema and the natural language input data;
obtain at least one database entry from one or more databases by executing the one or more database queries;
compare the at least one database entry with the configured information; and
generate a clarification prompt based on the comparison.

### Claim 12 (depends on 11)

The system of claim 11, wherein the natural language question-answering system is a table question-answering (Table QA) system or a knowledge-graph question-answering system.

### Claim 13 (depends on 11)

The system of claim 11, wherein the at least one database entry comprises a table, the table having at least one row and at least one column.

### Claim 14 (depends on 13)

The system of claim 13, wherein the at least one processor is further configured to execute the instructions to:
determine whether there are multiple possible values based on the natural language input data and the table of the at least one database entry.

### Claim 15 (depends on 14)

The system of claim 14, wherein the at least one processor is further configured to execute the instructions to:
determine there are multiple possible values; and
generate, using the natural language question-answering system, a clarification information in response to the natural language input data.

### Claim 16 (depends on 14)

The system of claim 14, wherein the natural language input data comprises a text-based data, an audio data, or any combination thereof.

### Claim 17 (depends on 14)

The system of claim 14, wherein the database schema is Structured Query Language (SQL) database schema and the one or more database queries include a SQL query.

### Claim 18 (depends on 14)

The system of claim 14, wherein the at least one processor is further configured to execute the instructions to:
parse, using a resource description framework schema, the natural language input data, wherein the generated one or more database queries include a SPARQL query.

### Claim 19 (depends on 14)

The system of claim 14, wherein to generate the clarification prompt, the at least one processor is further configured to execute the instructions to:
revise the configured information, wherein the clarification prompt is based on the revised configured information.

### Claim 20

A non-transitory computer-readable medium comprising program instructions, which, when executed by one or more processors, cause the one or more processors to perform operations comprising:
configuring information for completing a task-oriented dialogue based on natural language input data;
parsing the configured information based on a database schema;
generating a parsed database schema based on the parsed configured information;
generating, using a natural language question-answering system, one or more database queries based on the parsed database schema and the natural language input data;
retrieving, from an associated database, at least one database entry by executing the one or more database queries;
comparing the at least one database entry with the information for the task-oriented dialogue; and
generating a clarification prompt based on the comparison.
