US 11,720,614 B2
Method and system for generating a response to an unstructured natural language (NL) query
Amit Sangroya, Gurgaon (IN); Gautam Shroff, Gurgaon (IN); Chandrasekhar Anantaram, Gurgaon (IN); Mrinal Rawat, Gurgaon (IN); and Pratik Saini, Gurgaon (IN)
Assigned to TATA CONSULTANCY SERVICES LIMITED, Mumbai (IN)
Appl. No. 17/753,514
Filed by Tata Consultancy Services Limited, Mumbai (IN)
PCT Filed Mar. 4, 2020, PCT No. PCT/IB2020/051827
§ 371(c)(1), (2) Date Mar. 4, 2022,
PCT Pub. No. WO2021/044222, PCT Pub. Date Mar. 11, 2021.
Claims priority of application No. 201921036051 (IN), filed on Sep. 6, 2019.
Prior Publication US 2022/0342919 A1, Oct. 27, 2022
Int. Cl. G06F 16/33 (2019.01); G06F 16/332 (2019.01); G06F 40/20 (2020.01)
CPC G06F 16/3344 (2019.01) [G06F 16/3329 (2019.01); G06F 40/20 (2020.01)] 6 Claims
OG exemplary drawing
 
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.