ljynlp / MRN

Source code for ACL-IJCNLP 2021 findings paper: MRN: A Locally and Globally Mention-Based Reasoning Network for Document-Level Relation Extraction.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MRN: A Locally and Globally Mention-Based Reasoning Network for Document-Level Relation Extraction

Source code for ACL-IJCNLP 2021 findings paper: MRN: A Locally and Globally Mention-Based Reasoning Network for Document-Level Relation Extraction.

1. Environments

  • python (3.6.8)
  • cuda (10.1)

2. Dependencies

  • numpy (1.17.3)
  • torch (1.6.0)
  • transformers (3.5.1)
  • pandas (1.1.5)
  • scikit-learn (0.23.2)

3. Preparation

  • Download DocRED dataset
  • Put all the train_annotated.json, dev.json, test.json,word2id.json,vec.npy,rel2id.json,ner2id into the directory data/
>> python preprocess.py

4. Training

>> python main.py

5. Submission to LeadBoard (CodaLab)

You will get json file named result.json for test set at step 4. Then you can submit it to CodaLab.

6. License

This project is licensed under the MIT License - see the LICENSE file for details.

7. Citation

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",
}

About

Source code for ACL-IJCNLP 2021 findings paper: MRN: A Locally and Globally Mention-Based Reasoning Network for Document-Level Relation Extraction.

License:MIT License


Languages

Language:Python 100.0%