{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/kqa-pro-a-large-diagnostic-dataset-for","title":"KQA Pro: A Dataset with Explicit Compositional Programs for Complex Question Answering over Knowledge Base","arxiv_id":"2007.03875","date":"2020-07-08","proceeding":"ACL 2022 5","authors":["Shulin Cao","Jiaxin Shi","Liangming Pan","Lunyiu Nie","Yutong Xiang","Lei Hou","Juanzi Li","Bin He","Hanwang Zhang"],"abstract":"Complex question answering over knowledge base (Complex KBQA) is challenging because it requires various compositional reasoning capabilities, such as multi-hop inference, attribute comparison, set operation. Existing benchmarks have some shortcomings that limit the development of Complex KBQA: 1) they only provide QA pairs without explicit reasoning processes; 2) questions are poor in diversity or scale. To this end, we introduce KQA Pro, a dataset for Complex KBQA including ~120K diverse natural language questions. We introduce a compositional and interpretable programming language KoPL to represent the reasoning process of complex questions. For each question, we provide the corresponding KoPL program and SPARQL query, so that KQA Pro serves for both KBQA and semantic parsing tasks. Experimental results show that SOTA KBQA methods cannot achieve promising results on KQA Pro as on current datasets, which suggests that KQA Pro is challenging and Complex KBQA requires further research efforts. We also treat KQA Pro as a diagnostic dataset for testing multiple reasoning skills, conduct a thorough evaluation of existing models and discuss further directions for Complex KBQA. Our codes and datasets can be obtained from https://github.com/shijx12/KQAPro_Baselines.","url_abs":"https://arxiv.org/abs/2007.03875v4","url_pdf":"https://arxiv.org/pdf/2007.03875v4.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"kqa-pro-a-large-diagnostic-dataset-for","repo_url":"https://github.com/shijx12/kqapro_baselines","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"kqa-pro-a-large-diagnostic-dataset-for","repo_url":"https://github.com/happen2me/kqa-pro-datasets","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok"}}],"tasks":[{"task_slug":"attribute","task_name":"Attribute"},{"task_slug":"diagnostic","task_name":"Diagnostic"},{"task_slug":"diversity","task_name":"Diversity"},{"task_slug":"question-answering","task_name":"Question Answering"},{"task_slug":"semantic-parsing","task_name":"Semantic Parsing"}],"methods":[{"method_slug":"gru","method_name":"GRU"}],"datasets_introduced":[{"slug":"kqa-pro","name":"KQA Pro","full_name":""}],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2007.03875","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2007.03875"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/shijx12/kqapro_baselines","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/happen2me/kqa-pro-datasets","reach":{"status":"ok"}}],"summary":{"unverified":10},"by_repo_kind":{"official":{"samples":10,"ran":0,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"efd0ac51d93a0daa","entry":"collate","repo":"shijx12/kqapro_baselines","repo_kind":"official","path":"Bart_Program/data.py","file_url":"https://github.com/shijx12/kqapro_baselines/blob/HEAD/Bart_Program/data.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"efd0ac51d93a0daa"}},{"code_sha256_prefix":"c79055984b79cecc","entry":"encode_dataset","repo":"shijx12/kqapro_baselines","repo_kind":"official","path":"Bart_Program/preprocess.py","file_url":"https://github.com/shijx12/kqapro_baselines/blob/HEAD/Bart_Program/preprocess.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c79055984b79cecc"}},{"code_sha256_prefix":"e330a3e886196216","entry":"encode_dataset","repo":"shijx12/kqapro_baselines","repo_kind":"official","path":"Bart_SPARQL/preprocess.py","file_url":"https://github.com/shijx12/kqapro_baselines/blob/HEAD/Bart_SPARQL/preprocess.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e330a3e886196216"}},{"code_sha256_prefix":"ddb495680f6650e0","entry":"get_program_seq","repo":"shijx12/kqapro_baselines","repo_kind":"official","path":"Bart_Program/preprocess.py","file_url":"https://github.com/shijx12/kqapro_baselines/blob/HEAD/Bart_Program/preprocess.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ddb495680f6650e0"}},{"code_sha256_prefix":"f2644153c58a3490","entry":"load","repo":"shijx12/kqapro_baselines","repo_kind":"official","path":"evaluate.py","file_url":"https://github.com/shijx12/kqapro_baselines/blob/HEAD/evaluate.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f2644153c58a3490"}},{"code_sha256_prefix":"facadc8602de5157","entry":"post_process","repo":"shijx12/kqapro_baselines","repo_kind":"official","path":"Bart_Program/predict.py","file_url":"https://github.com/shijx12/kqapro_baselines/blob/HEAD/Bart_Program/predict.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"facadc8602de5157"}},{"code_sha256_prefix":"363b1bd85fb31dba","entry":"validate","repo":"shijx12/kqapro_baselines","repo_kind":"official","path":"Bart_Program/predict.py","file_url":"https://github.com/shijx12/kqapro_baselines/blob/HEAD/Bart_Program/predict.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"363b1bd85fb31dba"}},{"code_sha256_prefix":"e46e8bd5f842bf4b","entry":"validate","repo":"shijx12/kqapro_baselines","repo_kind":"official","path":"Bart_SPARQL/predict.py","file_url":"https://github.com/shijx12/kqapro_baselines/blob/HEAD/Bart_SPARQL/predict.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e46e8bd5f842bf4b"}},{"code_sha256_prefix":"39b9e1fd3e199769","entry":"whether_equal","repo":"shijx12/kqapro_baselines","repo_kind":"official","path":"evaluate.py","file_url":"https://github.com/shijx12/kqapro_baselines/blob/HEAD/evaluate.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"39b9e1fd3e199769"}},{"code_sha256_prefix":"dab51ce41e0aef5f","entry":"whether_equal","repo":"shijx12/kqapro_baselines","repo_kind":"official","path":"Bart_SPARQL/predict.py","file_url":"https://github.com/shijx12/kqapro_baselines/blob/HEAD/Bart_SPARQL/predict.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"dab51ce41e0aef5f"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}