A natural language query (NLQ) is translated to a structured data query (e.g., a SQL statement) by extracting entities from the NLQ and replacing them with generic variables to form a generic query. The generic query is associated with a structured question type which includes structured data variables using natural language classifiers (NLCs). Specific data is inserted in the structured question type in relation to the structured data variables based on the extracted entities to form the structured data query. An ensemble of NLCs trained with different ground truths can be used to yield multiple candidate question types. One of the candidate question types is selected based on confidence levels. The multiple NLCs can include an NLC which is optimized according to a focus of the generic query. For example, an NLC can be optimized for a specific data structure (such as SQL), or for comparative queries.
展开▼