# US 11,907,226 B2 · Refining understanding of natural language database queries

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

- Number: US 11,907,226 B2
- Document ID: US11907226B2
- Status: Granted
- Kind: B2
- Application number: 17/655,564
- Filed: 2022-03-21
- Published: 2023-09-21
- Granted: 2024-02-20
- Earliest claimed: 2022-03-21
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Ngoc Phuoc An Vo; Vadim Sheinin; Elahe Khorasani; Hangu Yeo
- Web page: https://patentgrep.com/patent/US11907226B2

## CPC

- G06F 16/2455: Query execution
- G06F 16/24564: {Applying rules; Deductive queries}
- G06F 40/226: Validation
- G06F 40/279: Recognition of textual entities
- G06F 40/40: Processing or translation of natural language (natural language analysis G06F40/20; semantic analysis G06F40/30)
- G06F 40/30: Semantic analysis
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A computer-implemented method, a computer system and a computer program product create rules for a rule-based natural language interface for databases (NLIDB). The method may include receiving a natural language query from a user. The method may also include generating a first explanation for the natural language query using a deep learning model and a second explanation for the natural language query using the rule-based NLIDB and validating whether the first and second explanations correctly represent the natural language query. The method may further include identifying the database value in the first explanation in response to the first explanation correctly representing the natural language query and the second explanation not correctly representing the natural language query. Lastly, the method may include creating a rule in a table for the rule-based natural language interface for databases that associates the database value with the original word of the natural language query.

## Claims

### Claim 1

A computer-implemented method for creating rules for a rule-based natural language interface for databases (NLIDB), the method comprising:
receiving a natural language query from a user, wherein the natural language query includes an original word;
generating a first explanation for the natural language query using a deep learning model, wherein the first explanation includes a database value, and displaying the first explanation to the user;
generating a second explanation for the natural language query using the rule-based natural language interface, wherein the second explanation includes a rule-based database value, and displaying the second explanation to the user;
receiving a first decision and a second decision from the user, wherein the first decision indicates whether the first explanation represents the natural language query and the second decision indicates whether the second explanation represents the natural language query;
in response to the first decision from the user indicating that the first explanation represents the natural language query and the second decision from the user indicating that the second explanation does not represent the natural language query, identifying the database value in the first explanation; and
creating a rule in a table for the rule-based natural language interface that associates the database value with the original word of the natural language query.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1, further comprising:
in response to the second decision from the user indicating that the second explanation represents the natural language query and the first decision from the user indicating that the first explanation does not represent the natural language query, identifying the rule-based database value in the second explanation; and
updating the deep learning model based on the rule-based database value in the second explanation.

### Claim 3 (depends on 2)

The computer-implemented method of claim 2, wherein the creating a rule in the table for the rule-based natural language interface further comprises:
comparing the database value in the first explanation to the rule-based database value in the second explanation;
identifying the original word in the natural language query associated with the rule-based database value; and
associating the original word associated with the database value in the first explanation to the identified original word associated with the rule-based database value in the second explanation when the database value matches the rule-based database value.

### Claim 4 (depends on 1)

The computer-implemented method of claim 1, wherein the generating the first explanation for the natural language query further comprises:
predicting a structured database query corresponding to the natural language query using the deep learning model; and
generating a natural language explanation based on the structured database query using natural language processing algorithms.

### Claim 5 (depends on 1)

The computer-implemented method of claim 1, wherein the generating the second explanation for the natural language query further comprises:
predicting a structured database query corresponding to the natural language query using the rule-based natural language interface; and
generating a natural language explanation based on the structured database query using natural language processing algorithms.

### Claim 6 (depends on 1)

The computer-implemented method of claim 1, further comprising:
classifying the first explanation as representing the natural language query in response to the first decision from the user indicating that the first explanation represents the natural language query; and
classifying the first explanation as not representing the natural language query in response to the first decision from the user indicating that the first explanation does not represent the natural language query.

### Claim 7 (depends on 1)

The computer-implemented method of claim 1, further comprising:
classifying the second explanation as representing the natural language query in response to the second decision from the user indicating that the second explanation represents the natural language query; and
classifying the second explanation as not representing the natural language query in response to the second decision from the user indicating that the second explanation does not represent the natural language query.

### Claim 8

A computer system for creating rules for a rule-based natural language interface for databases (NLIDB), the computer system comprising:
one or more processors, one or more computer-readable memories, one or more computer-readable storage media, and program instructions stored on at least one of the one or more computer-readable storage media for execution by at least one of the one or more processors via at least one of the one or more computer-readable memories, wherein the computer system is capable of performing a method comprising:
receiving a natural language query from a user, wherein the natural language query includes an original word;
generating a first explanation for the natural language query using a deep learning model, wherein the first explanation includes a database value, and displaying the first explanation to the user;
generating a second explanation for the natural language query using the rule-based natural language interface, wherein the second explanation includes a rule-based database value, and displaying the second explanation to the user;
receiving a first decision and a second decision from the user, wherein the first decision indicates whether the first explanation represents the natural language query and the second decision indicates whether the second explanation represents the natural language query;
in response to the first decision from the user indicating that the first explanation represents the natural language query and the second decision from the user indicating that the second explanation does not represent the natural language query, identifying the database value in the first explanation; and
creating a rule in a table for the rule-based natural language interface that associates the database value with the original word of the natural language query.

### Claim 9 (depends on 8)

The computer system of claim 8, further comprising:
in response to the second decision from the user indicating that the second explanation represents the natural language query and the first decision from the user indicating that the first explanation does not represent the natural language query, identifying the rule-based database value in the second explanation; and
updating the deep learning model based on the rule-based database value in the second explanation.

### Claim 10 (depends on 9)

The computer system of claim 9, wherein the creating a rule in the table for the rule-based natural language interface further comprises:
comparing the database value in the first explanation to the rule-based database value in the second explanation;
identifying the original word in the natural language query associated with the rule-based database value; and
associating the original word associated with the database value in the first explanation to the identified original word associated with the rule-based database value in the second explanation when the database value matches the rule-based database value.

### Claim 11 (depends on 8)

The computer system of claim 8, wherein the generating the first explanation for the natural language query further comprises:
predicting a structured database query corresponding to the natural language query using the deep learning model; and
generating a natural language explanation based on the structured database query using natural language processing algorithms.

### Claim 12 (depends on 8)

The computer system of claim 8, wherein the generating the second explanation for the natural language query further comprises:
predicting a structured database query corresponding to the natural language query using the rule-based natural language interface; and
generating a natural language explanation based on the structured database query using natural language processing algorithms.

### Claim 13 (depends on 8)

The computer system of claim 8, further comprising:
classifying the first explanation as representing the natural language query in response to the first decision from the user indicating that the first explanation represents the natural language query; and
classifying the first explanation as not representing the natural language query in response to the first decision from the user indicating that the first explanation does not represent the natural language query.

### Claim 14 (depends on 8)

The computer system of claim 8, further comprising:
classifying the second explanation as representing the natural language query in response to the second decision from the user indicating that the second explanation represents the natural language query; and
classifying the second explanation as not representing the natural language query in response to the second decision from the user indicating that the second explanation does not represent the natural language query.

### Claim 15

A computer program product for creating rules for a rule-based natural language interface for databases, the computer program product comprising:
a computer readable storage medium having program instructions embodied therewith, the program instructions executable by a processor to cause the processor to perform a method comprising:
receiving a natural language query from a user, wherein the natural language query includes an original word;
generating a first explanation for the natural language query using a deep learning model, wherein the first explanation includes a database value, and displaying the first explanation to the user;
generating a second explanation for the natural language query using the rule-based natural language interface, wherein the second explanation includes a rule-based database value, and displaying the second explanation to the user;
receiving a first decision and a second decision from the user, wherein the first decision indicates whether the first explanation represents the natural language query and the second decision indicates whether the second explanation represents the natural language query;
in response to the first decision from the user indicating that the first explanation represents the natural language query and the second decision from the user indicating that the second explanation does not represent the natural language query, identifying the database value in the first explanation; and
creating a rule in a table for the rule-based natural language interface that associates the database value with the original word of the natural language query.

### Claim 16 (depends on 15)

The computer program product of claim 15, further comprising:
in response to the second decision from the user indicating that the second explanation represents the natural language query and the first decision from the user indicating that the first explanation does not represent the natural language query, identifying the rule-based database value in the second explanation; and
updating the deep learning model based on the rule-based database value in the second explanation.

### Claim 17 (depends on 16)

The computer program product of claim 16, wherein the creating a rule in the table for the rule-based natural language interface further comprises:
comparing the database value in the first explanation to the rule-based database value in the second explanation;
identifying the original word in the natural language query associated with the rule-based database value; and
associating the original word associated with the database value in the first explanation to the identified original word associated with the rule-based database value in the second explanation when the database value matches the rule-based database value.

### Claim 18 (depends on 15)

The computer program product of claim 15, wherein the generating the first explanation for the natural language query further comprises:
predicting a structured database query corresponding to the natural language query using the deep learning model; and
generating a natural language explanation based on the structured database query using natural language processing algorithms.

### Claim 19 (depends on 15)

The computer program product of claim 15, further comprising:
classifying the first explanation as representing the natural language query in response to the first decision from the user indicating that the first explanation represents the natural language query; and
classifying the first explanation as not representing the natural language query in response to the first decision from the user indicating that the first explanation does not represent the natural language query.

### Claim 20 (depends on 15)

The computer program product of claim 15, further comprising:
classifying the second explanation as representing the natural language query in response to the second decision from the user indicating that the second explanation represents the natural language query; and
classifying the second explanation as not representing the natural language query in response to the second decision from the user indicating that the second explanation does not represent the natural language query.
