BTDM: A Bi-directional Translating Decoding Model Based On Relational Embedding For Relational Triple Extraction
This repository contains the source code and dataset for the paper: BTDM: A Bi-directional Translating Decoding Model Based On Relational Embedding For Relational Triple Extraction.
The main requirements are:
- Keras==2.3.1
- numpy==1.23.5
- tensorflow==2.3.1
- torch==1.12.1
- transformers==4.25.1
- tqdm
1. Get pre-trained BERT model for PyTorch
Download BERT-Base-Cased which contains pytroch_model.bin
, vocab.txt
and config.json
. Put these under ./pretrained
.
2. Build Data
Put our preprocessed datasets under ./datasets
.
3. Train
Specify the running mode and dataset at the command line
python run.py ---train=train --dataset=NYT
4. Evaluate
Specify the running mode and dataset at the command line
python run.py ---train=test --dataset=NYT