Communication network data management and visualization using generative large language model-based query statement generation
A processing system including at least one processor may obtain a natural language request associated with a database system and may generate a prompt based upon the natural language request in accordance with a prompt mapping function. The processing may next apply the prompt as an input to a generative model to generate a structured query and may further apply the structured query to the database system to obtain a query result. The processing system may then present at least one visualization of the query result.
1 . A method comprising:
obtaining, by a processing system including at least one processor, a natural language request associated with a database system;
generating, by the processing system, a prompt based upon the natural language request in accordance with a prompt mapping function, wherein the prompt mapping function comprises a term mapping function that matches terms in natural language requests to data fields of data tables of the database system, wherein the term mapping function comprises: a thesaurus or an ontology, and wherein the thesaurus or the ontology comprises a feature graph that includes: nodes and edges, each of the nodes representing a respective one of the data fields of the data tables of the database system and each of the edges representing a respective pair of the data fields of the data tables of the database system being related, and wherein the generating of the prompt includes: generating an output of the prompt mapping function in response to the natural language request as an input, truncating, from the output, a portion of the output that relates to visualization to generate a truncated output, and generating the prompt by inserting the truncated output into a prompt template;
applying, by the processing system, the prompt as an input to a generative model implemented by the processing system to generate a structured query, wherein the applying includes embedding a sub-graph of the thesaurus or the ontology with the prompt as the input to the generative model;
applying, by the processing system, the structured query to the database system to obtain a query result; and
presenting, by the processing system, at least one visualization of the query result.
2 . The method of claim 1 , further comprising:
generating the at least one visualization of the query result.
3 . The method of claim 2 , wherein the at least one visualization of the query comprises at least one result table.
4 . The method of claim 2 , wherein the at least one visualization comprises at least one of:
a chart; or
a graph.
5 . The method of claim 2 , wherein the natural language request includes a visualization request.
6 . The method of claim 5 , wherein the at least one visualization of the query result is generated in response to the visualization request.
7 . The method of claim 1 , wherein the database system comprises data tables of communication network operational data.
8 . The method of claim 7 , wherein the processing system is deployed in a communication network.
9 . The method of claim 1 , wherein the generative model comprises a large language model-based machine learning model.
10 . The method of claim 1 , wherein the generative model comprises a generative pre-trained transformer model.
11 . The method of claim 1 , wherein the applying of the prompt as the input to the generative model to generate the structured query further comprises:
generating supplemental prompt content from one or more data tables of the database system; and
applying the supplemental prompt content as an additional input to the generative model.
12 . The method of claim 1 , wherein the data fields comprise at least one of:
table columns; or
fields of data elements within a table column.
13 . The method of claim 12 , wherein the data elements comprise java script object notation elements.
14 . The method of claim 1 , wherein the term mapping function is updated via machine learning.
15 . The method of claim 1 , wherein the database system comprises a structured query language-based system.
16 . A non-transitory computer-readable medium storing instructions which, when executed by a processing system including at least one processor, cause the processing system to perform operations, the operations comprising:
obtaining a natural language request associated with a database system;
generating a prompt based upon the natural language request in accordance with a prompt mapping function, wherein the prompt mapping function comprises a term mapping function that matches terms in natural language requests to data fields of data tables of the database system, wherein the term mapping function comprises: a thesaurus or an ontology, and wherein the thesaurus or the ontology comprises a feature graph that includes: nodes and edges, each of the nodes representing a respective one of the data fields of the data tables of the database system and each of the edges representing a respective pair of the data fields of the data tables of the database system being related, and wherein the generating of the prompt includes: generating an output of the prompt mapping function in response to the natural language request as an input, truncating, from the output, a portion of the output that relates to visualization to generate a truncated output, and generating the prompt by inserting the truncated output into a prompt template;
applying the prompt as an input to a generative model implemented by the processing system to generate a structured query, wherein the applying includes embedding a sub-graph of the thesaurus or the ontology with the prompt as the input to the generative model;
applying the structured query to the database system to obtain a query result; and
presenting at least one visualization of the query result.
17 . An apparatus comprising:
a processing system including at least one processor; and
a computer-readable medium storing instructions which, when executed by the processing system, cause the processing system to perform operations, the operations comprising:
obtaining a natural language request associated with a database system;
generating a prompt based upon the natural language request in accordance with a prompt mapping function, wherein the prompt mapping function comprises a term mapping function that matches terms in natural language requests to data fields of data tables of the database system, wherein the term mapping function comprises: a thesaurus or an ontology, and wherein the thesaurus or the ontology comprises a feature graph that includes: nodes and edges, each of the nodes representing a respective one of the data fields of the data tables of the database system and each of the edges representing a respective pair of the data fields of the data tables of the database system being related, and wherein the generating of the prompt includes: generating an output of the prompt mapping function in response to the natural language request as an input, truncating, from the output, a portion of the output that relates to visualization to generate a truncated output, and generating the prompt by inserting the truncated output into a prompt template;
applying the prompt as an input to a generative model implemented by the processing system to generate a structured query;
applying the structured query to the database system to obtain a query result, wherein the applying includes embedding a sub-graph of the thesaurus or the ontology with the prompt as the input to the generative model; and
presenting at least one visualization of the query result.
18 . The apparatus of claim 17 , wherein the operations further comprise:
generating the at least one visualization of the query result.
19 . The apparatus of claim 18 , wherein the at least one visualization of the query comprises at least one result table.
20 . The apparatus of claim 18 , wherein the at least one visualization comprises at least one of:
a chart; or
a graph.