{"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/text2nkg-fine-grained-n-ary-relation","title":"Text2NKG: Fine-Grained N-ary Relation Extraction for N-ary relational Knowledge Graph Construction","arxiv_id":"2310.05185","date":"2023-10-08","proceeding":null,"authors":["Haoran Luo","Haihong E","Yuhao Yang","Tianyu Yao","Yikai Guo","Zichen Tang","Wentai Zhang","Kaiyang Wan","Shiyao Peng","Meina Song","Wei Lin","Yifan Zhu","Luu Anh Tuan"],"abstract":"Beyond traditional binary relational facts, n-ary relational knowledge graphs (NKGs) are comprised of n-ary relational facts containing more than two entities, which are closer to real-world facts with broader applications. However, the construction of NKGs remains at a coarse-grained level, which is always in a single schema, ignoring the order and variable arity of entities. To address these restrictions, we propose Text2NKG, a novel fine-grained n-ary relation extraction framework for n-ary relational knowledge graph construction. We introduce a span-tuple classification approach with hetero-ordered merging and output merging to accomplish fine-grained n-ary relation extraction in different arity. Furthermore, Text2NKG supports four typical NKG schemas: hyper-relational schema, event-based schema, role-based schema, and hypergraph-based schema, with high flexibility and practicality. The experimental results demonstrate that Text2NKG achieves state-of-the-art performance in F1 scores on the fine-grained n-ary relation extraction benchmark. Our code and datasets are publicly available.","url_abs":"https://arxiv.org/abs/2310.05185v3","url_pdf":"https://arxiv.org/pdf/2310.05185v3.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":"text2nkg-fine-grained-n-ary-relation","repo_url":"https://github.com/lhrlab/text2nkg","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"event-based-n-ary-relaiton-extraction","task_name":"Event-based N-ary Relaiton Extraction"},{"task_slug":"hyper-relational-extraction","task_name":"Hyper-Relational Extraction"},{"task_slug":"hypergraph-based-n-ary-relaiton-extraction","task_name":"Hypergraph-based N-ary Relaiton Extraction"},{"task_slug":null,"task_name":"Relation"},{"task_slug":"role-based-n-ary-relaiton-extraction","task_name":"Role-based N-ary Relaiton Extraction"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/hyper-relational-extraction-on-hyperred","task":"Hyper-Relational Extraction","dataset":"HyperRED","model":"Text2NKG","rank_in_archive_order":1,"of":4,"metrics":{"Avg. F1":"83.81"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2310.05185","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2310.05185"}},"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/lhrlab/text2nkg","reach":null}],"summary":{"ran_draft_wrong":1,"ran":5,"ran_fixture":1,"unverified":5},"by_repo_kind":{"official":{"samples":11,"ran":6,"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":1,"samples":[{"code_sha256_prefix":"9df40357afea56cc","entry":"to_list","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_draft_wrong","verification_level":2,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"9df40357afea56cc"}},{"code_sha256_prefix":"b15e1145195f287e","entry":"BioEncoder","repo":"lhrlab/text2nkg","repo_kind":"official","path":"hyperred_data_process.py","file_url":"https://github.com/lhrlab/text2nkg/blob/HEAD/hyperred_data_process.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b15e1145195f287e"}},{"code_sha256_prefix":"4161204c355ff4f5","entry":"Entity","repo":"lhrlab/text2nkg","repo_kind":"official","path":"hyperred_data_process.py","file_url":"https://github.com/lhrlab/text2nkg/blob/HEAD/hyperred_data_process.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4161204c355ff4f5"}},{"code_sha256_prefix":"e82ac45ea887bc39","entry":"add_tag_joint_label","repo":"lhrlab/text2nkg","repo_kind":"official","path":"hyperred_data_process.py","file_url":"https://github.com/lhrlab/text2nkg/blob/HEAD/hyperred_data_process.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e82ac45ea887bc39"}},{"code_sha256_prefix":"51d44540fb9cd150","entry":"add_tokens","repo":"lhrlab/text2nkg","repo_kind":"official","path":"hyperred_data_process.py","file_url":"https://github.com/lhrlab/text2nkg/blob/HEAD/hyperred_data_process.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"51d44540fb9cd150"}},{"code_sha256_prefix":"ace46dde5211f557","entry":"convert_sent_to_tags","repo":"lhrlab/text2nkg","repo_kind":"official","path":"hyperred_data_process.py","file_url":"https://github.com/lhrlab/text2nkg/blob/HEAD/hyperred_data_process.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ace46dde5211f557"}},{"code_sha256_prefix":"03619aadbbc021c8","entry":"sset","repo":"LHRLAB/Text2NKG","repo_kind":"official","path":"run_re.py","file_url":"https://github.com/LHRLAB/Text2NKG/blob/HEAD/run_re.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"03619aadbbc021c8"}},{"code_sha256_prefix":"09904326420aaef1","entry":"Relation","repo":"lhrlab/text2nkg","repo_kind":"official","path":"hyperred_data_process.py","file_url":"https://github.com/lhrlab/text2nkg/blob/HEAD/hyperred_data_process.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":"09904326420aaef1"}},{"code_sha256_prefix":"81db230e87f76be0","entry":"Sentence","repo":"lhrlab/text2nkg","repo_kind":"official","path":"hyperred_data_process.py","file_url":"https://github.com/lhrlab/text2nkg/blob/HEAD/hyperred_data_process.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":"81db230e87f76be0"}},{"code_sha256_prefix":"c95bb2a25e11fe46","entry":"SparseCube","repo":"lhrlab/text2nkg","repo_kind":"official","path":"hyperred_data_process.py","file_url":"https://github.com/lhrlab/text2nkg/blob/HEAD/hyperred_data_process.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":"c95bb2a25e11fe46"}},{"code_sha256_prefix":"0acb90d02eadd73f","entry":"load_tf_weights_in_albert","repo":"LHRLAB/Text2NKG","repo_kind":"official","path":"transformers/src/transformers/modeling_albert.py","file_url":"https://github.com/LHRLAB/Text2NKG/blob/HEAD/transformers/src/transformers/modeling_albert.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":"0acb90d02eadd73f"}},{"code_sha256_prefix":"fccd9efaa74da2dd","entry":"process","repo":"lhrlab/text2nkg","repo_kind":"official","path":"hyperred_data_process.py","file_url":"https://github.com/lhrlab/text2nkg/blob/HEAD/hyperred_data_process.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":"fccd9efaa74da2dd"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}