{"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/learning-logic-rules-for-document-level-1","title":"Learning Logic Rules for Document-level Relation Extraction","arxiv_id":"2111.05407","date":"2021-11-09","proceeding":"EMNLP 2021 11","authors":["Dongyu Ru","Changzhi Sun","Jiangtao Feng","Lin Qiu","Hao Zhou","Weinan Zhang","Yong Yu","Lei LI"],"abstract":"Document-level relation extraction aims to identify relations between entities in a whole document. Prior efforts to capture long-range dependencies have relied heavily on implicitly powerful representations learned through (graph) neural networks, which makes the model less transparent. To tackle this challenge, in this paper, we propose LogiRE, a novel probabilistic model for document-level relation extraction by learning logic rules. LogiRE treats logic rules as latent variables and consists of two modules: a rule generator and a relation extractor. The rule generator is to generate logic rules potentially contributing to final predictions, and the relation extractor outputs final predictions based on the generated logic rules. Those two modules can be efficiently optimized with the expectation-maximization (EM) algorithm. By introducing logic rules into neural networks, LogiRE can explicitly capture long-range dependencies as well as enjoy better interpretation. Empirical results show that LogiRE significantly outperforms several strong baselines in terms of relation performance (1.8 F1 score) and logical consistency (over 3.3 logic score). Our code is available at https://github.com/rudongyu/LogiRE.","url_abs":"https://arxiv.org/abs/2111.05407v1","url_pdf":"https://arxiv.org/pdf/2111.05407v1.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":"learning-logic-rules-for-document-level-1","repo_url":"https://github.com/rudongyu/logire","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"document-level-relation-extraction","task_name":"Document-level Relation Extraction"},{"task_slug":null,"task_name":"Relation"},{"task_slug":"relation-extraction","task_name":"Relation Extraction"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/relation-extraction-on-docred","task":"Relation Extraction","dataset":"DocRED","model":"ATLOP + LogiRE","rank_in_archive_order":21,"of":62,"metrics":{"F1":"61.45","Ign F1":"59.48"},"uses_additional_data":false},{"leaderboard":"/sota/relation-extraction-on-docred","task":"Relation Extraction","dataset":"DocRED","model":"GAIN + LogiRE","rank_in_archive_order":29,"of":62,"metrics":{"F1":"60.61","Ign F1":"58.62"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2111.05407","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2111.05407"}},"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/rudongyu/logire","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":3},"by_repo_kind":{"official":{"samples":3,"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":"c946309d3e0f1a17","entry":"append_chain","repo":"rudongyu/logire","repo_kind":"official","path":"reader.py","file_url":"https://github.com/rudongyu/logire/blob/HEAD/reader.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":"c946309d3e0f1a17"}},{"code_sha256_prefix":"50f5d22519059b77","entry":"evaluate","repo":"rudongyu/logire","repo_kind":"official","path":"logire.py","file_url":"https://github.com/rudongyu/logire/blob/HEAD/logire.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":"50f5d22519059b77"}},{"code_sha256_prefix":"b402de90fc90bf8c","entry":"get_backbone_collate_fn","repo":"rudongyu/logire","repo_kind":"official","path":"dataset.py","file_url":"https://github.com/rudongyu/logire/blob/HEAD/dataset.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":"b402de90fc90bf8c"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}