CPC G06F 16/2433 (2019.01) | 18 Claims |
1. A method for automatically generating question and query pair from a knowledge base comprising the steps of:
accessing a knowledge base;
extracting, via processing module stored in a memory and executed by a processor, one or more entities and one or more predicates from said knowledge base;
generating, via a baseline template generator module, a baseline question template from a context free grammar rule;
inputting the one or more entities and the one or more predicates into the baseline question template to determine a numbering of the one or more predicates;
generating a numbered question template based on the numbering;
generating a typed question template by traversing the numbered question template through a predicate type-graph;
generating a protocol and RDF query language (SPARQL) query by inputting the one or more entities and the one or more predicates into a SPARQL query template;
generating a question by inputting the one or more entities and the one or more predicates into the typed question template;
constructing a question and query pair by combining the question and the SPARQL query; and
storing the question and query pair in the memory for future access.
|