{"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/kagnet-knowledge-aware-graph-networks-for","title":"KagNet: Knowledge-Aware Graph Networks for Commonsense Reasoning","arxiv_id":"1909.02151","date":"2019-09-04","proceeding":"IJCNLP 2019 11","authors":["Bill Yuchen Lin","Xinyue Chen","Jamin Chen","Xiang Ren"],"abstract":"Commonsense reasoning aims to empower machines with the human ability to make presumptions about ordinary situations in our daily life. In this paper, we propose a textual inference framework for answering commonsense questions, which effectively utilizes external, structured commonsense knowledge graphs to perform explainable inferences. The framework first grounds a question-answer pair from the semantic space to the knowledge-based symbolic space as a schema graph, a related sub-graph of external knowledge graphs. It represents schema graphs with a novel knowledge-aware graph network module named KagNet, and finally scores answers with graph representations. Our model is based on graph convolutional networks and LSTMs, with a hierarchical path-based attention mechanism. The intermediate attention scores make it transparent and interpretable, which thus produce trustworthy inferences. Using ConceptNet as the only external resource for Bert-based models, we achieved state-of-the-art performance on the CommonsenseQA, a large-scale dataset for commonsense reasoning.","url_abs":"https://arxiv.org/abs/1909.02151v1","url_pdf":"https://arxiv.org/pdf/1909.02151v1.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":"kagnet-knowledge-aware-graph-networks-for","repo_url":"https://github.com/INK-USC/KagNet","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"kagnet-knowledge-aware-graph-networks-for","repo_url":"https://github.com/INK-USC/MHGRN","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"common-sense-reasoning","task_name":"Common Sense Reasoning"},{"task_slug":"knowledge-base-question-answering","task_name":"Knowledge Base Question Answering"},{"task_slug":"knowledge-graphs","task_name":"Knowledge Graphs"},{"task_slug":"natural-language-inference","task_name":"Natural Language Inference"}],"methods":[{"method_slug":"graph-convolutional-networks","method_name":"Graph Convolutional Networks"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/common-sense-reasoning-on-commonsenseqa","task":"Common Sense Reasoning","dataset":"CommonsenseQA","model":"KagNet","rank_in_archive_order":30,"of":38,"metrics":{"Accuracy":"58.9"},"uses_additional_data":true}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1909.02151","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1909.02151"}},"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/INK-USC/MHGRN","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/INK-USC/KagNet","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_honours":1,"unverified":11},"by_repo_kind":{"official":{"samples":12,"ran":1,"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":"eb725d5794b15f6b","entry":"accuracy","repo":"INK-USC/KagNet","repo_kind":"official","path":"baselines/extract_csqa_bert.py","file_url":"https://github.com/INK-USC/KagNet/blob/HEAD/baselines/extract_csqa_bert.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"eb725d5794b15f6b"}},{"code_sha256_prefix":"59331830eb0526c2","entry":"collate_csqa_paths","repo":"INK-USC/KagNet","repo_kind":"official","path":"models/csqa_dataset.py","file_url":"https://github.com/INK-USC/KagNet/blob/HEAD/models/csqa_dataset.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":"59331830eb0526c2"}},{"code_sha256_prefix":"324da0e6c0b20893","entry":"convert_examples_to_features","repo":"INK-USC/KagNet","repo_kind":"official","path":"baselines/extract_csqa_bert.py","file_url":"https://github.com/INK-USC/KagNet/blob/HEAD/baselines/extract_csqa_bert.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":"324da0e6c0b20893"}},{"code_sha256_prefix":"f92024b299799ce7","entry":"create_hypothesis","repo":"INK-USC/KagNet","repo_kind":"official","path":"baselines/run_csqa_bert.py","file_url":"https://github.com/INK-USC/KagNet/blob/HEAD/baselines/run_csqa_bert.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":"f92024b299799ce7"}},{"code_sha256_prefix":"5f4eefd99c11e698","entry":"del_pos","repo":"INK-USC/KagNet","repo_kind":"official","path":"conceptnet/extract_cpnet.py","file_url":"https://github.com/INK-USC/KagNet/blob/HEAD/conceptnet/extract_cpnet.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":"5f4eefd99c11e698"}},{"code_sha256_prefix":"fea5bb325776f21f","entry":"get_fitb_from_question","repo":"INK-USC/KagNet","repo_kind":"official","path":"baselines/run_csqa_bert.py","file_url":"https://github.com/INK-USC/KagNet/blob/HEAD/baselines/run_csqa_bert.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":"fea5bb325776f21f"}},{"code_sha256_prefix":"692d601c35015e13","entry":"get_fitb_from_question","repo":"INK-USC/KagNet","repo_kind":"official","path":"datasets/convert_csqa.py","file_url":"https://github.com/INK-USC/KagNet/blob/HEAD/datasets/convert_csqa.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":"692d601c35015e13"}},{"code_sha256_prefix":"9b0d6be3854d5d6d","entry":"load_embeddings","repo":"INK-USC/KagNet","repo_kind":"official","path":"models/csqa_dataset.py","file_url":"https://github.com/INK-USC/KagNet/blob/HEAD/models/csqa_dataset.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":"9b0d6be3854d5d6d"}},{"code_sha256_prefix":"08149da7e3c7cab3","entry":"most_frequent","repo":"INK-USC/KagNet","repo_kind":"official","path":"baselines/ensemble.py","file_url":"https://github.com/INK-USC/KagNet/blob/HEAD/baselines/ensemble.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":"08149da7e3c7cab3"}},{"code_sha256_prefix":"e50200dbeffa0133","entry":"patch_replication_callback","repo":"INK-USC/KagNet","repo_kind":"official","path":"models/parallel.py","file_url":"https://github.com/INK-USC/KagNet/blob/HEAD/models/parallel.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":"e50200dbeffa0133"}},{"code_sha256_prefix":"ce2f5b8a15be67db","entry":"read_csqa_examples","repo":"INK-USC/KagNet","repo_kind":"official","path":"baselines/extract_csqa_bert.py","file_url":"https://github.com/INK-USC/KagNet/blob/HEAD/baselines/extract_csqa_bert.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":"ce2f5b8a15be67db"}},{"code_sha256_prefix":"f46246d74e1f7b3e","entry":"replace_wh_word_with_blank","repo":"INK-USC/KagNet","repo_kind":"official","path":"baselines/run_csqa_bert.py","file_url":"https://github.com/INK-USC/KagNet/blob/HEAD/baselines/run_csqa_bert.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":"f46246d74e1f7b3e"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}