US 12,259,879 B2
Mapping natural language to queries using a query grammar
Nikhil Yadav, Sunnyvale, CA (US); and Ravi Tandon, San Jose, CA (US)
Assigned to Thoughtspot, Inc., Mountain View, CA (US)
Filed by ThoughtSpot, Inc., San Jose, CA (US)
Filed on Aug. 9, 2022, as Appl. No. 17/883,955.
Application 17/883,955 is a continuation of application No. 16/512,674, filed on Jul. 16, 2019, granted, now 11,442,932.
Prior Publication US 2022/0382752 A1, Dec. 1, 2022
Int. Cl. G06F 16/00 (2019.01); G06F 16/242 (2019.01); G06F 16/245 (2019.01); G06F 16/248 (2019.01); G06F 16/901 (2019.01)
CPC G06F 16/2428 (2019.01) [G06F 16/245 (2019.01); G06F 16/248 (2019.01); G06F 16/9024 (2019.01)] 17 Claims
OG exemplary drawing
 
1. A system for providing a search interface for databases, comprising:
a network interface,
a processor, and
a memory, wherein the memory stores instructions executable by the processor to:
generate, based on a string, a set of tokens of a database syntax, wherein the tokens are each matched to a respective fragment of the string;
generate a query graph for the set of tokens from a finite state machine representing a query grammar, wherein nodes of the finite state machine represent token types, directed edges of the finite state machine represent valid transitions between token types in the query grammar, vertices of the query graph correspond to respective tokens of the set of tokens, and directed edges of the query graph represent a transition between two tokens in a sequencing of the tokens;
remove one or more directed edges from the query graph to form an acyclic query graph;
determine, based on a tour of the acyclic query graph, a sequence of the tokens in the set of tokens to form a database query; and
invoke a search of the database using a query based on the database query to obtain search results.