{"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/exploiting-structural-and-semantic-context","title":"Commonsense Knowledge Base Completion with Structural and Semantic Context","arxiv_id":"1910.02915","date":"2019-10-07","proceeding":null,"authors":["Chaitanya Malaviya","Chandra Bhagavatula","Antoine Bosselut","Yejin Choi"],"abstract":"Automatic KB completion for commonsense knowledge graphs (e.g., ATOMIC and ConceptNet) poses unique challenges compared to the much studied conventional knowledge bases (e.g., Freebase). Commonsense knowledge graphs use free-form text to represent nodes, resulting in orders of magnitude more nodes compared to conventional KBs (18x more nodes in ATOMIC compared to Freebase (FB15K-237)). Importantly, this implies significantly sparser graph structures - a major challenge for existing KB completion methods that assume densely connected graphs over a relatively smaller set of nodes. In this paper, we present novel KB completion models that can address these challenges by exploiting the structural and semantic context of nodes. Specifically, we investigate two key ideas: (1) learning from local graph structure, using graph convolutional networks and automatic graph densification and (2) transfer learning from pre-trained language models to knowledge graphs for enhanced contextual representation of knowledge. We describe our method to incorporate information from both these sources in a joint model and provide the first empirical results for KB completion on ATOMIC and evaluation with ranking metrics on ConceptNet. Our results demonstrate the effectiveness of language model representations in boosting link prediction performance and the advantages of learning from local graph structure (+1.5 points in MRR for ConceptNet) when training on subgraphs for computational efficiency. Further analysis on model predictions shines light on the types of commonsense knowledge that language models capture well.","url_abs":"https://arxiv.org/abs/1910.02915v2","url_pdf":"https://arxiv.org/pdf/1910.02915v2.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":"exploiting-structural-and-semantic-context","repo_url":"https://github.com/allenai/commonsense-kg-completion","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"computational-efficiency","task_name":"Computational Efficiency"},{"task_slug":"knowledge-base-completion","task_name":"Knowledge Base Completion"},{"task_slug":"knowledge-graphs","task_name":"Knowledge Graphs"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"link-prediction","task_name":"Link Prediction"},{"task_slug":"transfer-learning","task_name":"Transfer Learning"}],"methods":[{"method_slug":"graph-convolutional-networks","method_name":"Graph Convolutional Networks"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1910.02915","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1910.02915"}},"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/allenai/commonsense-kg-completion","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_honours":1,"unverified":11},"by_repo_kind":{"listed":{"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":"allenai/commonsense-kg-completion","repo_kind":"listed","path":"lm_finetuning/simple_lm_finetuning.py","file_url":"https://github.com/allenai/commonsense-kg-completion/blob/HEAD/lm_finetuning/simple_lm_finetuning.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":"420406b2e12799ee","entry":"camel_case_split","repo":"allenai/commonsense-kg-completion","repo_kind":"listed","path":"src/bert_feature_extractor.py","file_url":"https://github.com/allenai/commonsense-kg-completion/blob/HEAD/src/bert_feature_extractor.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":"420406b2e12799ee"}},{"code_sha256_prefix":"f6b73f652e22a0f7","entry":"convert_edges_to_examples","repo":"allenai/commonsense-kg-completion","repo_kind":"listed","path":"src/bert_feature_extractor.py","file_url":"https://github.com/allenai/commonsense-kg-completion/blob/HEAD/src/bert_feature_extractor.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":"f6b73f652e22a0f7"}},{"code_sha256_prefix":"e44321eb9fe5de7a","entry":"convert_example_to_features","repo":"allenai/commonsense-kg-completion","repo_kind":"listed","path":"lm_finetuning/simple_lm_finetuning.py","file_url":"https://github.com/allenai/commonsense-kg-completion/blob/HEAD/lm_finetuning/simple_lm_finetuning.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":"e44321eb9fe5de7a"}},{"code_sha256_prefix":"8670d7299e3756ce","entry":"convert_examples_to_features","repo":"allenai/commonsense-kg-completion","repo_kind":"listed","path":"src/bert_feature_extractor.py","file_url":"https://github.com/allenai/commonsense-kg-completion/blob/HEAD/src/bert_feature_extractor.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":"8670d7299e3756ce"}},{"code_sha256_prefix":"4916801754517961","entry":"create_vocab","repo":"allenai/commonsense-kg-completion","repo_kind":"listed","path":"src/reader_utils.py","file_url":"https://github.com/allenai/commonsense-kg-completion/blob/HEAD/src/reader_utils.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":"4916801754517961"}},{"code_sha256_prefix":"6c5d6cb16e3275c2","entry":"create_word_vocab","repo":"allenai/commonsense-kg-completion","repo_kind":"listed","path":"src/reader_utils.py","file_url":"https://github.com/allenai/commonsense-kg-completion/blob/HEAD/src/reader_utils.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":"6c5d6cb16e3275c2"}},{"code_sha256_prefix":"973da3b6d17a8a2a","entry":"get_filtered_ranks","repo":"allenai/commonsense-kg-completion","repo_kind":"listed","path":"src/evaluation_utils.py","file_url":"https://github.com/allenai/commonsense-kg-completion/blob/HEAD/src/evaluation_utils.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":"973da3b6d17a8a2a"}},{"code_sha256_prefix":"5a26e3880ee60f5b","entry":"get_vocab_idx","repo":"allenai/commonsense-kg-completion","repo_kind":"listed","path":"src/reader_utils.py","file_url":"https://github.com/allenai/commonsense-kg-completion/blob/HEAD/src/reader_utils.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":"5a26e3880ee60f5b"}},{"code_sha256_prefix":"fc6caabfdb1a495d","entry":"perturb_and_get_rank","repo":"allenai/commonsense-kg-completion","repo_kind":"listed","path":"src/evaluation_utils.py","file_url":"https://github.com/allenai/commonsense-kg-completion/blob/HEAD/src/evaluation_utils.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":"fc6caabfdb1a495d"}},{"code_sha256_prefix":"c247b25173d2c822","entry":"random_word","repo":"allenai/commonsense-kg-completion","repo_kind":"listed","path":"lm_finetuning/simple_lm_finetuning.py","file_url":"https://github.com/allenai/commonsense-kg-completion/blob/HEAD/lm_finetuning/simple_lm_finetuning.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":"c247b25173d2c822"}},{"code_sha256_prefix":"8353984688641dab","entry":"sort_and_rank","repo":"allenai/commonsense-kg-completion","repo_kind":"listed","path":"src/evaluation_utils.py","file_url":"https://github.com/allenai/commonsense-kg-completion/blob/HEAD/src/evaluation_utils.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":"8353984688641dab"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}