Code For TDEER: An Efficient Translating Decoding Schema for Joint Extraction of Entities and Relations (EMNLP2021)
Overview
TDEER is an efficient model for joint extraction of entities and relations. Unlike the common decoding approach that predicting the relation between subject and object, we adopt the proposed translating decoding schema: subject + relation -> objects, to decode triples. By the proposed translating decoding schema, TDEER can handle the overlapping triple problem effectively and efficiently. The following figure is an illustration of our models.
Reproduction Steps
1. Environment
We conducted experiments under python3.7 and used GPUs device to accelerate computing.
You can install the required dependencies by the following script.
We release our pre-trained models for NYT, WebNLG, and NYT11-HRL datasets.
Click Google Drive | Baidu NetDisk to download pre-trained models and then uncompress to ckpts folder.
To use the pre-trained models, you need to download our processed datasets and specify --rel_path to our processed rel2id.json.
To evaluate by the pre-trained models, you can use above commands and specify --ckpt_path to specific model.
In our setting, NYT, WebNLG, and NYT11-HRL achieve the best result on Epoch 86, 174, and 23 respectively.
1. NYT
2. WebNLG
3. NYT11-HRL
Citation
If you use our code in your research, please cite our work:
@inproceedings{li2021tdeer,
title={TDEER: An Efficient Translating Decoding Schema for Joint Extraction of Entities and Relations},
author={Li, Xianming and Luo, Xiaotian and Dong, Chenghao and Yang, Daichuan and Luan, Beidi and He, Zhen},
booktitle={Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing (EMNLP)},
year={2021}
}
Contact
If you have any questions about the paper or code, you can
For the latest version, plz visit 👉 https://github.com/4AI/TDEER
TDEER (WIP)
Code For TDEER: An Efficient Translating Decoding Schema for Joint Extraction of Entities and Relations (EMNLP2021)
Overview
TDEER is an efficient model for joint extraction of entities and relations. Unlike the common decoding approach that predicting the relation between subject and object, we adopt the proposed translating decoding schema: subject + relation -> objects, to decode triples. By the proposed translating decoding schema, TDEER can handle the overlapping triple problem effectively and efficiently. The following figure is an illustration of our models.
Reproduction Steps
1. Environment
We conducted experiments under python3.7 and used GPUs device to accelerate computing.
You can install the required dependencies by the following script.
2. Prepare Data
We follow weizhepei/CasRel to prepare datas.
For convenience, you could download our preprocessed datasets (Google Drive | Baidu NetDisk).
Please place the downloaded data to
datafolder.3. Download Pretrained BERT
Click 👉BERT-Base-Cased to download the pretrained model and then decompress to
pretrained-bertfolder.4. Train & Eval
You can use
run.pywith--do_trainto train the model. After training, you can also userun.pywith--do_testto evaluate data.Our training and evaluating commands are as follows:
1. NYT
train:
evaluate:
You can evaluate other data by specifying
--test_path.2. WebNLG
train:
evaluate:
You can evaluate other data by specifying
--test_path.3. NYT11-HRL
train:
evaluate:
Pre-trained Models
We release our pre-trained models for NYT, WebNLG, and NYT11-HRL datasets.
Click Google Drive | Baidu NetDisk to download pre-trained models and then uncompress to
ckptsfolder.To use the pre-trained models, you need to download our processed datasets and specify
--rel_pathto our processedrel2id.json.To evaluate by the pre-trained models, you can use above commands and specify
--ckpt_pathto specific model.In our setting, NYT, WebNLG, and NYT11-HRL achieve the best result on Epoch 86, 174, and 23 respectively.
1. NYT
2. WebNLG
3. NYT11-HRL
Citation
If you use our code in your research, please cite our work:
Contact
If you have any questions about the paper or code, you can