CPC G06F 16/3344 (2019.01) [G06F 16/3329 (2019.01); G06F 40/20 (2020.01)] | 6 Claims |
1. A method, comprising:
fetching at least one query from a user as an input, using one or more hardware processors, wherein the at least one query is in an unstructured natural language format;
generating a sketch corresponding to the fetched at least one query, using the one or more hardware processors, wherein the sketch is a structured representation of the at least one query;
transforming the sketch to one or more database queries, using the one or more hardware processors, wherein
the sketch comprises of a predicate part and a condition part,
transforming the sketch to the one or more database queries further comprises:
analyzing the predicate part of the sketch, for each predicate (pi) of the predicate part of the sketch, wherein analyzing further comprises:
identifying a plurality of predicates (pi) in a plurality of reference tables (T), which match a table type (ni) and an attribute type (ai) of the predicate from the predicate part of the sketch;
checking semantic similarity of each predicate (pi) of the sketch with the plurality of predicates of the plurality of reference tables; and
identifying at least one table of the plurality of reference tables as a matching table, based on the semantic similarity;
analyzing the condition part of the sketch, for each condition (ci) in the condition part (C) of the sketch, wherein the analyzing the condition part further comprises:
identifying a plurality of predicates (pi) in a plurality of reference tables (T), which match a table type (ni) and an attribute type (ai) of the condition (ci) from the predicate part of the sketch; and
identifying reference tables of the plurality of predicates (pi) which match each condition (ci) in the condition part (C) of the sketch, as the matching table;
establishing a relationship (R) between the tables identified as the matching table; and
computing at least one database query of the one or more database queries based on the relationship (R);
querying at least one database using the one or more database queries, using the one or more hardware processors; and
generating a response to the at least one query based on one or more results obtained by querying the at least one database, using the one or more hardware processors.
|