ZhyuXie / copy_re

Release for acl18 paper "Extracting Relational Facts by an End-to-End Neural Model with Copy Mechanism"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This code is for ACL2018 paper "Extracting Relational Facts by an End-to-End Neural Model with Copy Mechanism"

Modify the Data path

You need to modify the data path in const.py before run the code. The pre-processed data is avaliable in:

WebNLG dataset: https://drive.google.com/open?id=1zISxYa-8ROe2Zv8iRc82jY9QsQrfY1Vj

NYT dataset: https://drive.google.com/open?id=10f24s9gM7NdyO3z5OqQxJgYud4NnCJg3

Train

python main.py -c config.json -t 0 -cell lstm

The cell can be "gru" or "lstm". You can specify the GPU card number by "-g". For exampe, "python main.py -c config.json -t 0 -cell lstm -g 0".

Test or Valid

You need to set the epochs of the model in main.py first. Then run the following commands: python main.py -c config.json -t 1 -cell lstm

"-t 1" means test and "-t 2" means valid.

About

Release for acl18 paper "Extracting Relational Facts by an End-to-End Neural Model with Copy Mechanism"


Languages

Language:Python 100.0%