Grammar-Based Question-Query Pair Generation from Knowledge Bases

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing methods for generating question/query pairs require significant human input and are not scalable for creating large datasets needed for effective machine learning training in AI modules and software applications.

Innovation Solution

An automated system that leverages WikiData as a knowledge base, using multiple layers of question templating and context-free grammar rules to generate natural language questions and formal language queries with minimal human intervention.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If automated question/query pair generation is implemented, then productivity is improved, but device complexity increases

Engineering Contradiction:
Improvedataset generation efficiencyVSAvoidsystem architecture complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The system divides the question generation process into distinct modules: a template generator that creates question templates from context-free grammar rules, a knowledge base processing module that extracts entities and relationships, and a pair generation module that combines templates with knowledge base data. This segmentation allows each module to be independently optimized and maintained, reducing overall system complexity while enabling high-throughput automated generation of question/query pairs

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system performs preliminary action by pre-generating question templates from context-free grammar rules and storing them in a template repository before actual question generation. This allows the system to efficiently generate large numbers of questions by simply filling templates with knowledge base data, rather than generating each question from scratch, thereby improving productivity without proportionally increasing complexity

Inventive Principle:
Principle #10Preliminary action

2Measurement precision

If large datasets are generated for machine learning training, then measurement precision is improved, but loss of time increases

Engineering Contradiction:
Improvetraining data qualityVSAvoiddataset creation time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The system enables continuous generation of question/query pairs by maintaining an operational knowledge base connection and continuously producing training data. The automated pipeline processes knowledge base entries through templates without interruption, generating large volumes of high-quality training data efficiently. This continuous operation eliminates manual dataset creation bottlenecks and provides sufficient training data for machine learning models without excessive time investment

Inventive Principle:
Principle #20Continuity of useful action

Data Source

PatentUS12346318B2System and method for automatically generating question and query pairs
Publication Date: 2025.07.01 MEETKAI INC
  • US12346318B2 patent drawing
  • US12346318B2 patent drawing
  • US12346318B2 patent drawing

AI summary

Disclosed is a method and system for automatically generating question and query pair from a knowledge base that involves accessing a knowledge base to extract one or more entities and one or more predicates, generating 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 generate a numbered question template, generating a typed question template by traversing the numbered question template through a predicate type-graph, generating a 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, and constructing a question and query pair by combining the question and the SPARQL query.