Note: This branch implements the adjacency matrix multiplication method described in Section 4.2 of the corresponding paper. For Floyd-Warshall, go to the fl-wa
branch.
Credit: This code is based on the repo for the 2020 AAAI paper "Graph Transformer for Graph-to-Sequence Learning". We are grateful to the authors for open-sourcing their work.
The code is tested with Python 3.6. All dependencies are listed in requirements.txt.
The instructions to prepare AMR data are given in the generator_data folder.
A pretrained checkpoint yielding our paper results can be found here as the file batch308999_epoch818
. To verify, execute steps 2--3 below without modifying the script settings. Our model output can be found in the file batch308999_epoch818_test_out.final
by following the above link.
The following steps should be done in the generator
folder. The default settings in this repo should reproduce the results in our paper. Please check all scripts for correct arguments before use.
- Preprocess data and train
sh prepare.sh # vocab and data preprocessing sh train.sh
- Test and postprocess
sh work.sh # test sh test.sh # postprocess (make sure --output is set)
- Evaluate
./multi-bleu.perl # BLEU eval python chrF++.py -H [hyp] -R [ref] # chrF++ eval java -Xmx2G -jar meteor-1.5.jar [hyp] [ref] -l en # Meteor eval