IP Library Granted Patent US 12675474
Granted Patent B1
US 12675474 · App. 18/962,392 · Granted Jul 7, 2026

Generate customized data visualization from natural language query

Inventors: Anuj Chauhan (New York, NY); Wuwei Lan (Princeton Junction, NJ); Rishav Chakravarti (White Plains, NY); Patrick Ng (Great Neck, NY); Jerry Lin (New York, NY); Stephen Michael Ash (Seattle, WA); William Michael Siler (Germantown, TN); Chris Elliott (Bainbridge Island, WA)
Assignee: Amazon Technologies, Inc.
G06F16/24522G06F16/243G06F16/248G06F16/26G06F40/30
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12675474
App. No.
18/962,392
Granted
Jul 7, 2026
Kind
B1
Abstract

Systems and methods are provided for natural language query processing and data visualization generation. The system can analyze the natural language query for semantic attributes and compare the semantic attributes against the semantic data of a set of data visualizations to generate context for the natural language query in the form of a personalized set of semantic data. Based on the semantic attributes and the semantic data, the system can select a set of exemplars that best match the natural language query and using the exemplars, and a library specification, generate library specification programming code for generating a structured query to resolve the natural language query. Based on the results of the structured query, the system can generate a data visualization as a response to the natural language query.

Claims (44)

1 . A computer-implemented method comprising:

identifying a subset of exemplars of a plurality of exemplars based on first semantic data associated with a natural language query and second semantic data associated with one or more data visualizations, each exemplar in the subset of exemplars comprising a respective example input and a corresponding example output;

generating library specific programming code using a prompt and a machine learning model, the prompt comprising instructions to generate the library specific programming code based on at least: a specification of a library associated with the library specific programming code and the subset of exemplars, wherein the library is new to the machine learning model; and

executing, using the library, the library specific programming code to generate a structured query configured to produce a result for the natural language query that includes a customized data visualization.

2 . The computer-implemented method of claim 1 , further comprising:

executing the structured query to generate query results;

generating a customized data visualization based on the query results; and

transmitting the customized data visualization to a client device in response to the natural language query.

3 . The computer-implemented method of claim 2 , further comprising adding semantic data associated with the customized data visualization to a dataset of semantic data.

4 . The computer-implemented method of claim 1 , further comprising:

receiving, from a client device, the natural language query for information associated with a first dataset;

extracting the first semantic data from the natural language query; and

identifying the second semantic data from the one or more data visualizations.

5 . The computer-implemented method of claim 4 , wherein the machine learning model is a first machine learning model, wherein the prompt is a first prompt, and wherein extracting the first semantic data from the natural language query further comprises using a second prompt and a second machine learning model.

6 . The computer-implemented method of claim 4 , wherein extracting the first semantic data from the natural language query comprises identifying named entities of the natural language query corresponding to at least one of metrics, filters, or query commands.

7 . The computer-implemented method of claim 4 , wherein identifying the second semantic data comprises prioritizing data visualizations of the one or more data visualizations based on whether the data visualizations were provided to the client device within a predetermined time period.

8 . The computer-implemented method of claim 1 , wherein the subset of exemplars is a first subset of exemplars, and wherein the computer-implemented method further comprises identifying a second subset of exemplars, each exemplar in the second subset of exemplars comprising:

an example natural language query,

an example schema, the example schema missing a column associated with at least one semantic attribute, and

an example of library specific programing code, the library specific programming code including an unanswerability token.

9 . The computer-implemented method of claim 1 , further comprising:

identifying an error in the library specific programming code;

generating an error message based on the error; and

generating updated library specific programming code using a second prompt and the machine learning model, the second prompt comprising instructions to generate the updated library specific programming code based on: the specification of the library associated with the library specific programming code, the subset of exemplars, the natural language query, and the error message.

10 . The computer-implemented method of claim 1 , further comprising ranking individual exemplars of the plurality of exemplars based on proximity to the first and second semantic data to generate a rank value for individual exemplars, and selecting a subset of exemplars based on the rank value of individual exemplars.

11 . The computer-implemented method of claim 10 , wherein selecting the subset of exemplars comprises selecting individual exemplars having the rank value above a predetermined threshold.

12 . A system comprising computer readable memory and one or more processors, wherein the system is configured to:

identify a subset of exemplars of a plurality of exemplars based on first semantic data associated with a natural language query and second semantic data associated with one or more data visualizations, each exemplar in the subset of exemplars comprising a respective example input and a corresponding example output;

generate library specific programming code using a prompt and a machine learning model, the prompt comprising instructions to generate the library specific programming code based on at least: a specification of a library associated with the library specific programming code, and the subset of exemplars, wherein the library is new to the machine learning model; and

execute, using the library, the library specific programming code to generate a structured query configured to produce a result for the natural language query that includes a customized data visualization.

13 . The system of claim 12 , wherein an example input comprises a schema and an example natural language query, and wherein a corresponding example output comprises an example of library specific programming code.

14 . The system of claim 12 , wherein the system is further configured to:

execute the structured query to generate query results;

generate a customized data visualization based on the query results; and

transmit the customized data visualization to a client device in response to the natural language query.

15 . The system of claim 14 , wherein the system is further configured to add semantic data associated with the customized data visualization to a dataset of semantic data.

16 . The system of claim 12 , wherein the system is further configured to:

receive, from a client device, the natural language query for information associated with a first dataset;

extract the first semantic data associated from the natural language query; and

identify the second semantic data from the one or more data visualizations.

17 . The system of claim 16 , wherein to extract the first semantic data from the natural language query, the system is further configured to identify named entities in the natural language query corresponding to at least one of metrics, filters, or query commands.

18 . The system of claim 12 , wherein the machine learning model is a large language model.

19 . The system of claim 12 , further configured to rank individual exemplars of the plurality of exemplars based on proximity to the first and second semantic data to generate a rank value for individual exemplars, and to select a subset of exemplars based on the rank value of individual exemplars.

20 . The system of claim 19 , wherein selecting the subset of exemplars comprises selecting exemplars having the rank value above a predetermined threshold.