Source code for ACL-IJCNLP 2021 findings paper: MRN: A Locally and Globally Mention-Based Reasoning Network for Document-Level Relation Extraction.
- python (3.6.8)
- cuda (10.1)
- numpy (1.17.3)
- torch (1.6.0)
- transformers (3.5.1)
- pandas (1.1.5)
- scikit-learn (0.23.2)
- Download DocRED dataset
- Put all the
train_annotated.json
,dev.json
,test.json
,word2id.json
,vec.npy
,rel2id.json
,ner2id
into the directorydata/
>> python preprocess.py
>> python main.py
You will get json file named result.json
for test set at step 4. Then you can submit it to CodaLab.
This project is licensed under the MIT License - see the LICENSE file for details.
If you use this work or code, please kindly cite the following paper:
@inproceedings{li-etal-2021-mrn,
title = "{MRN}: A Locally and Globally Mention-Based Reasoning Network for Document-Level Relation Extraction",
author = "Li, Jingye and
Xu, Kang and
Li, Fei and
Fei, Hao and
Ren, Yafeng and
Ji, Donghong",
booktitle = "Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021",
month = aug,
year = "2021",
address = "Online",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2021.findings-acl.117",
doi = "10.18653/v1/2021.findings-acl.117",
pages = "1359--1370",
}