{"id":13754355,"url":"https://github.com/TanyaZhao/MRC4ERE_plus","last_synced_at":"2025-05-09T22:32:04.942Z","repository":{"id":113387399,"uuid":"258142328","full_name":"TanyaZhao/MRC4ERE_plus","owner":"TanyaZhao","description":"Implementation for Paper \"Asking Effective and Diverse Questions: A Machine Reading Comprehension based Framework for Joint Entity-Relation Extraction\"","archived":false,"fork":false,"pushed_at":"2020-10-10T08:03:17.000Z","size":1147,"stargazers_count":38,"open_issues_count":4,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-16T07:33:27.240Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TanyaZhao.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-04-23T08:35:32.000Z","updated_at":"2024-05-07T12:34:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"8ec56a45-8fce-4a87-ac9d-802a5f270559","html_url":"https://github.com/TanyaZhao/MRC4ERE_plus","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TanyaZhao%2FMRC4ERE_plus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TanyaZhao%2FMRC4ERE_plus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TanyaZhao%2FMRC4ERE_plus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TanyaZhao%2FMRC4ERE_plus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TanyaZhao","download_url":"https://codeload.github.com/TanyaZhao/MRC4ERE_plus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253335861,"owners_count":21892749,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T09:01:56.524Z","updated_at":"2025-05-09T22:31:59.912Z","avatar_url":"https://github.com/TanyaZhao.png","language":"Python","funding_links":[],"categories":["关系抽取、信息抽取"],"sub_categories":["其他_文本生成、文本对话"],"readme":"# MRC4ERE++\nThe repository contains the code for Paper \"Asking Effective and Diverse Questions: A Machine Reading Comprehension based Framework for Joint Entity-Relation Extraction\", accepted by IJCAI 2020 (https://www.ijcai.org/Proceedings/2020/0546.pdf). \u003cbr\u003e\n\nIf you find this repo helpful, please cite the following:\n```text\n@inproceedings{zhao-etal-2020-asking,\n    title = \"Asking Effective and Diverse Questions: A Machine Reading Comprehension based Framework for Joint Entity-Relation Extraction\",\n    author = \"Zhao, Tianyang  and\n      Yan, Zhao  and\n      Cao, Yunbo  and\n      Li, Zhoujun\",\n    booktitle = \"Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence\",\n    month = jan,\n    year = \"2021\",\n    address = \"Kyoto, Japan\",\n    publisher = \"International Joint Conferences on Artificial Intelligence\",\n    url = \"https://www.ijcai.org/Proceedings/2020/0546.pdf\",\n    pages = \"3948--3954\"\n}\n```\n \n\n## Overview\n\nIn this paper, we improve the existing MRCbased entity-relation extraction model through diverse question answering. First, a diversity question answering mechanism is introduced to detect entity spans and two answering selection strategies are designed to integrate different answers. Then, we propose to predict a subset of potential relations and filter out irrelevant ones to generate questions effectively. Finally, entity and relation extractions are integrated in an end-to-end way and optimized through joint learning.\u003cbr\u003e \n\n![Aaron Swartz](https://github.com/TanyaZhao/MRC4ERE_plus/raw/master/model_framework.png)\n\nFor example, when extracting a person entity, we can construct diverse questions as follows:\n- Who is mentioned in the context?\n- Find people mentioned in the context?\n- Which words are person entities?\n\nAfter extracted the head entities, we generate diverse questions to identify tail entities by querying about protential relations.\nFor example, given the person ```Paul Vercammen``` and the relation ```Lived_In```, questions can be constructed as:\n- Find locations which Paul Vercammen is lived in ?\n- Where does Paul Vercammen live ?\n- Where is Paul Vercammen's home ?\n\n\n## Contents\n1. [Experimental Results](#experimental-results)\n2. [Dependencies](#dependencies)\n3. [Usage](#usage)\n\n\n## Experimental Results\n\nWe evaluate the proposed method on two widely-used datasets for entity relation extaction: ACE05 and CoNLL04.\nMicro precision, recall and F1-score are used as evaluation metrics. \n  \n- Results on **ACE 2005**:\n\n  | *Models* | Enity P | Entity R | Entity F | Relation P | Relation R | Relation F|\n  | --- | --- | --- | --- | --- | --- | --- |\n  |Sun et al. (2018) |83.9 s|83.2| 83.6| 64.9| 55.1| 59.6|\n  |Li et al. (2019) |84.7 |84.9| 84.8 |64.8| 56.2| 60.2 |\n  |MRC4ERE++ |85.9 |85.2 |**85.5** |62.0| 62.2| **62.1**|\n  \n- Results on **CoNLL 2004**:\n\n  | *Models* | Enity P | Entity R | Entity F | Relation P | Relation R | Relation F|\n  | --- | --- | --- | --- | --- | --- | --- |\n  |Zhang et al. (2017) |– |–| 85.6 |– |–| 67.8|\n  |Li et al. (2019) | 89.0 | 86.6 | 87.8 | 69.2 | 68.2 | 68.9 |\n  |MRC4ERE++ |89.3 |88.5|**88.9** |72.2| 71.5| **71.9**|\n\n\n## Data Preparation\n\nWe take the CoNLL04 dataset as an example:\n* We have processed the [original data](https://github.com/bekou/multihead_joint_entity_relation_extraction/tree/master/data/CoNLL04) into the MRC-based formation, as listed in the directory ```datasets/conll04/mrc4ere```.\n\nTo use the pretrained language model BERT:\n* Download [BERT-Base-Cased, English](https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-cased.tar.gz) pretrained model and unzip it into the directory ```pretrained_bert/bert-base-cased/```. In this way, we can load the BERT from local working directory.\n    \n## Dependencies \n\n* Package dependencies: \n```bash \npython \u003e= 3.6\nPyTorch == 1.1.0\npytorch-pretrained-bert == 0.6.1 \n```\n\n\n## Usage\nAs an example, the following command trains the proposed mothod on CoNLL04. \n```bash \ncd run\npython run_tagger.py \n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTanyaZhao%2FMRC4ERE_plus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTanyaZhao%2FMRC4ERE_plus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTanyaZhao%2FMRC4ERE_plus/lists"}