Source-linked AI summary
VisKoP: Visual Knowledge oriented Programming for Interactive Knowledge Base Question Answering
Zijun Yao, Yuanyong Chen, Xin Lv, Shulin Cao, Amy Xin, Jifan Yu, Hailong Jin, Jianjun Xu, Peng Zhang, Lei Hou, Juanzi Li
TL;DR
Semantic parsing cannot guarantee correct KB queries, and existing KBQA systems make generated queries difficult to manipulate. VisKoP combines visual, editable KoPL programs with a million-entity-level execution engine; users found correct answers in 110.6 seconds on average, and its engine was 16× faster than the original KoPL engine and 5× faster than Virtuoso.
Problem
Semantic parsing cannot guarantee correct parses for every question, and existing KBQA systems offer no easy way to manipulate generated query programs.
Source: §1 · pp. 1–2Method
VisKoP uses neural program induction to convert questions into KoPL, visualizes programs as operators that users can edit through dragging, linking, and slot-filling, and provides an efficient execution engine.
Source: §1 · p. 2, §3.1 · pp. 3–4Results
110.6 seconds on average for users to find the correct answer; the engine was 16× faster than the original KoPL engine and 5× faster than Virtuoso.
Source: §1 · p. 2Takeaways & Limitations
VisKoP supports monitoring, editing, and debugging KB queries while scaling KoPL execution to a million-entity-level KB.
Source: §7 · p. 7VisKoP depends on the KB's correctness and coverage, and confusing entities can make it difficult for users to correct a KoPL program.
Source: §5.2 · p. 6, Limitations · p. 7
Abstract
from arXiv · showhide
We present Visual Knowledge oriented Programming platform (VisKoP), a knowledge base question answering (KBQA) system that integrates human into the loop to edit and debug the knowledge base (KB) queries. VisKoP not only provides a neural program induction module, which converts natural language questions into knowledge oriented program language (KoPL), but also maps KoPL programs into graphical elements. KoPL programs can be edited with simple graphical operators, such as dragging to add knowledge operators and slot filling to designate operator arguments. Moreover, VisKoP provides auto-completion for its knowledge base schema and users can easily debug the KoPL program by checking its intermediate results. To facilitate the practical KBQA on a million-entity-level KB, we design a highly efficient KoPL execution engine for the back-end. Experiment results show that VisKoP is highly efficient and user interaction can fix a large portion of wrong KoPL programs to acquire the correct answer. The VisKoP online demo https://demoviskop.xlore.cn (Stable release of this paper) and https://viskop.xlore.cn (Beta release with new features), highly efficient KoPL engine https://pypi.org/project/kopl-engine, and screencast video https://youtu.be/zAbJtxFPTXo are now publicly available.
1 Introduction
VisKoP addresses the difficulty of correcting KB queries when semantic parsing makes errors by letting users inspect and edit query programs. It combines a graphical, KoPL-based interface with an efficient execution engine.
- Users can drag to add operators, connect them to express dependencies, and fill slots to specify operator arguments.Source: §1 · p. 2
- Intermediate operator results support debugging, and KB-schema autocomplete helps users unfamiliar with the schema.Source: §1 · p. 2
- The engine executes KoPL on a million-entity-level KB in less than 200 milliseconds.Source: §1 · p. 2
- Users found correct answers in an average 110.6 seconds; the engine was 16× faster than the original KoPL engine and 5× faster than Virtuoso.Source: §1 · p. 2
- VisKoP couples human-in-the-loop query editing and debugging with a KoPL execution engine that scales to a million-entity-level KB.Source: §1 · p. 2
- The authors report that allowing questioners to monitor query errors validates the approach and may improve system robustness.Source: §1 · p. 2
2 Preliminaries
The preliminaries define the knowledge elements and query setting that VisKoP operates on, then describe KoPL as an inspectable language of connected operators.
2.1 Knowledge Base
- KB represents entities, concepts, relations, and attributes, with relational, literal, and qualifier knowledge encoded as structured triplets.Source: §2.1 · p. 2
2.2 Knowledge Base Question Answering
- KBQA takes a natural-language question and returns either KB knowledge elements or results computed by logical or algebraic operations.Source: §2.2 · p. 3
2.3 KoPL
- KoPL comprises 26 connected operators with argument and dependency inputs; execution yields answers, while preserved intermediate results can be inspected and debugged.Source: §2.3 · p. 3
3 The VisKoP Platform
VisKoP combines a visual KoPL programming interface with a back-end execution engine, supporting query editing, schema-aware assistance, and inspection of intermediate results.
3 The VisKoP Platform
- The platform follows four design principles: graphical visualization, interactive editing, efficient execution, and transparent execution, split between the front end and back end.The interface handles visualization and editing; the execution engine handles efficiency and preserves operator outputs for inspection.Source: §3 · p. 3
3.1 Interactive Programming Interface
- A BART-based neural program induction module fine-tuned on KQA Pro converts natural-language questions into KoPL programs for graphical display.The generated KoPL program is output in depth-first-search order.Source: §3.1 · p. 3
- Users edit the tree-structured KoPL program by dragging in operators, linking dependencies, and slot-filling arguments; schema autocomplete, link checks, and operator outputs support correction and debugging.The interface presents intermediate execution results so users can inspect and debug their programs.Source: §3.1 · pp. 3–4, §3.2 · p. 4
3.2 Highly Efficient KoPL Engine
- The KoPL engine uses inverted indices, merges consecutive FindAll and filtering operators, and selects key-value storage structures by measured runtime on KQA Pro questions.The storage search considers hash maps, red-black trees, tries, and ternary search trees.Source: §3.2 · p. 4
4 Usage Example
In the usage example, VisKoP parses a natural-language question into KoPL, lets users correct structural and argument errors with schema autocomplete and intermediate results, and executes programs through its back-end engine.
4.1 Interactive Programming Interface
- VisKoP parses the border-count question into a KoPL program, but the example cannot be correctly parsed automatically and requires user correction.Users run the generated program to see its predicted answer.Source: §4.1 · p. 4
- Users replace the incorrect Or with And and correct the Relate argument; schema autocomplete and the And operator’s intermediate results help check the corrected query.The intermediate result shows which countries satisfy the And operator.Source: §4.1 · pp. 4–5, Figure 3 · p. 5, Figure 4 · p. 5
4.2 KoPL Engine
- The back-end engine loads the KB from JSON, builds in-memory data structures and indices, parses the KoPL program into its internal representation, and returns execution results.The engine is provided as a Python extension.Source: §4.2 · p. 5
5 Evaluation
On a million-entity-level KB, VisKoP’s engine runs faster than the compared engines, and users correct some questions that otherwise could not be answered; the study also identifies difficult entity-disambiguation cases.
5.1 Efficiency
- The efficiency study compares wall time over 94,376 KQA Pro queries on one Intel Xeon 5218R CPU with 1.0TB RAM.The platform is deployed on a million-entity-level KB extracted from Wikidata.Source: §5.1 · pp. 5–6
- 16× faster than the original KoPL engine and 5× faster than Virtuoso on equivalent SPARQL queries, VisKoP also has a smaller runtime-distribution peak and maximum than Virtuoso.Table 2 reports average running time over all queries; Figure 5 shows the running-time distribution.Source: Table 2 · p. 6, §5.1 · p. 6, Figure 5 · p. 6
5.2 User Study and Case Study
- 65.8% accuracy followed user correction of 20 questions selected as unanswerable without correction, with six users averaging 110.7 seconds per question and a 68.0-second median.The evaluation used manually annotated questions.Source: §5.2 · p. 6
- Questions requiring obscure or similarly named entities remain difficult; testers struggled to identify Sony Interactive Entertainment rather than Sony.The authors also note that some needed knowledge elements are not included in the KB.Source: §5.2 · p. 6
6 Related Works
VisKoP is a semantic-parsing KBQA system that integrates human guidance into program induction and supports visual interaction and intermediate-result checking. This addresses the difficulty of reliably parsing questions and inspecting generated queries.
6 Related Works
- VisKoP follows semantic parsing and neural program induction, translating questions into multi-step programs rather than ranking entities from a retrieved sub-KB.The passage contrasts semantic parsing with information retrieval as two KBQA categories.Source: §6 · p. 6
- VisKoP integrates humans into program induction to provide external guidance and potentially improve robustness.The cited challenge is the expense of question-program parallel data and the large program search space.Source: §6 · p. 6
- VisKoP is the first among the compared systems to enable visual interaction and intermediate-result checking for users.The comparison names ReTraCk, SEMPRE, TRANX, and DTQA.Source: §6 · p. 6
7 Conclusion and Future Work
VisKoP lets users monitor, edit, and debug KB queries, with a KoPL engine designed to scale execution to million-entity-level KBs. The authors identify KB customization and helping users recognize relevant knowledge elements as future directions.
7 Conclusion and Future Work
- VisKoP lets users monitor, edit, and debug KB queries.Its accompanying engine scales KoPL execution to a million-entity-level KB.Source: §7 · p. 7
- Future work could allow users to customize the KB.Source: §7 · p. 7
- The authors also identify guidance for recognizing true knowledge elements in a large-scale KB as important.Source: §7 · p. 7
Limitations
VisKoP depends on the correctness and broad knowledge coverage of the background KB; missing or incorrect relevant knowledge constrains answer finding.
Limitations
- VisKoP depends on the background KB being correct and broadly covering relevant knowledge.Finding the correct answer is extremely difficult when relevant knowledge elements are missing or incorrect.Source: Limitations · p. 7
Ethics Statement
VisKoP is designed for graphical editing of KB queries. The ethics statement notes that Wikidata’s imbalance in female and male entities can lead to gender-biased answers, and describes the data and user-study context.
Ethics Statement
- VisKoP is designed for users to edit KB queries with graphical elements.Source: Ethics Statement · p. 7
- The authors report 339,531 female and 1,458,903 male human entities in Wikidata and warn that missing female entities can lead to gender-biased answers.They attribute the imbalance to Wikidata data and identify KB debugging as important future work.Source: Ethics Statement · p. 7
- VisKoP is built on a high-quality subset of Wikidata.Source: Ethics Statement · p. 7
- The user-study participants were engineering graduate-student volunteers who received written and oral guidance; usernames were anonymized.Source: Ethics Statement · p. 7
A KoPL Definition
KoPL operators retrieve, filter, verify, select, and combine knowledge elements from a knowledge base. The section also introduces a Python dictionary format for representing operators and their dependencies.
A KoPL Definition
- KoPL operators retrieve, filter, verify, select, and combine knowledge elements according to names, conditions, values, or relationships.Query Operators find knowledge elements by name; Filter Operators keep elements satisfying conditions; Verification Operators test relationships to values; Selection Operators choose elements under a condition; and Set Operators perform inter-set operations.Source: A KoPL Definition · p. 10
- The operator descriptions are brief because the functions match those described in Cao et al. (2022a).The paper directs readers to that work or its website for each function's specific meaning.Source: A KoPL Definition · p. 10
B KoPL Program Format
- In Python, each knowledge operator is represented by a dictionary with function, inputs, and dependencies keys.The keys identify the operator name, its argument inputs, and its dependency inputs.Source: B KoPL Program Format · p. 10
C Questions for User Study
Table 3 presents the 20 questions used in the user study and their corresponding answers.
C Questions for User Study
- The questions are accompanied by their corresponding answers in Table 3.Source: C Questions for User Study · p. 10, Table 3 · p. 11
- Table 3 presents the 20 questions used in the user study.Source: C Questions for User Study · p. 10, Table 3 · p. 11
- The table is identified as the user-study question set.Source: Table 3 · p. 11