The code is basically borrowed from here, with slight modification.
General
- Python (verified on 3.8)
Python Packages
- see requirements.txt
conda create -n degree python=3.8
conda activate degree
pip install -r requirements.txt
- Prepare data processed from DyGIE++
- Put the processed data into the folder
processed_data/ace05e_dygieppformat
- Run
./scripts/process_ace05e.sh
The data folder should be like following after preprocessing
processed_data/ace05e_bart
├── dev.w1.oneie.json
├── test.w1.oneie.json
├── train.001.w1.oneie.json
├── train.003.w1.oneie.json
├── train.005.w1.oneie.json
├── ...
└── train.w1.oneie.json
Run the following command to generate retrieved reference for dataset.
cd ../../retrieval
python retrieve.py --base_model degree
And the retrieved data will be in the folder processed_data/retrieved
Generate data
python degree/generate_data_degree_e2e.py -c config/config_degree_e2e_ace05e.json
train
python degree/train_degree_e2e.py -c config/config_degree_e2e_ace05e.json
The model will be stored at ./output/degree_e2e_ace05e/[timestamp]/best_model.mdl
in default.
Evaluate on the model
python degree/eval_end2endEE.py -c config/config_degree_e2e_ace05e.json -e [e2e_model]