Skip to content

Code release for paper submissions

Notifications You must be signed in to change notification settings

Emvista/Meta-XAMR-2024

Repository files navigation

This project is tested with python=3.10

Pre-requisites

  1. Clone the repository with the following command:
git clone https://github.com/Emvista/Meta-XAMR-2024.git
  1. 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
  1. Install the required packages for the project:
pip install -r requirements.txt
  1. 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 graphs
  • en-amr.pm contains AMR graphs in Penman notation, where each graph is separated by an empty line
  • en-amr.en contains the corresponding English sentences

Train a model

# 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 

Evaluate a model

# 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>

GUI

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/

  1. Download the model from the following link and place it in the folder checkpoint/
  2. Run the following command:
python gui_amr_parser.py 

Evaluation data in Korean & Croatian

You can find the data file named amr-bank-struct-v1.6_ko+hr.txt under the root directory.

Citation

If you use this code, please cite the following paper:

to be added 

About

Code release for paper submissions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages