some of our codes are from https://github.com/weizhepei/CasRel
This repo was tested on Python 3.6 and Keras 2.2.4. The main requirements are:
- tqdm
- keras-bert==0.82.0
- tensorflow-gpu == 1.13.1
-
Get datasets
Download the two datasets above. Then decompress it under
data/NYT/
ordata/WebNLG/
.
-
Get pre-trained model BERT
Download Google's pre-trained BERT model (
BERT-Base, Cased
). Then decompress it underpretrained_bert_models/
. -
Train and select the model
Specify the running mode and dataset at the command line
python run.py --train=True --dataset=NYT
The model weights that lead to the best performance on validation set will be stored in
saved_weights/NYT/
orsaved_weights/WebNLG/
.