- Clone the repository with the following command:
git clone https://github.com/Emvista/Meta-XAMR-2024.git
- Clone the following repository to the root of the project:
git clone https://github.com/RikVN/AMR.git
# add AMR to the python path
export PYTHONPATH=${PYTHONPATH}:${PWD}/AMR
# install the required packages for AMR
pip install -r AMR/requirements.txt
- Install the required packages for the project:
pip install -r requirements.txt
- Place your AMR data in the following tree structure:
data
├── amr
│ ├── en
│ │ ├── train
│ │ │ ├── en-amr.amr
│ │ │ ├── en-amr.pm
│ │ │ ├── en-amr.en
│ │ ├── dev
│ │ └── test
│ └── de
│ ├── train
│ │ ├── de-amr.amr
...
en-amr.amr
contains linearized AMR graphsen-amr.pm
contains AMR graphs in Penman notation, where each graph is separated by an empty lineen-amr.en
contains the corresponding English sentences
# To train a model using maml, see the script for more options
python train_maml_xlingual.py
# To train a model using baseline, see the script for more options
python train_baseilne_xlingual.py
# To evaluate the model, set the `--max_steps` to 0
# and `--resume_from_checkpoint` to True
# and specify the `--checkpoint_path`
python train_maml_xlingual.py --max_steps 0 --resume_from_checkpoint True --checkpoint_path <path_to_checkpoint>
You can test our best model with gui. This will run a server on your local machine and you can access the page by going to the following link: http://127.0.0.1:7860/
- Download the model from the following link and place it in the folder
checkpoint/
- Run the following command:
python gui_amr_parser.py
You can find the data file named amr-bank-struct-v1.6_ko+hr.txt
under the root directory.
If you use this code, please cite the following paper:
to be added