Skip to content
/ AMRSim Public

Code for our paper "Evaluate AMR Graph Similarity via Self-supervised Learning" in ACL 2023

Notifications You must be signed in to change notification settings

zzshou/AMRSim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AMRSim

This repository contains the code for our ACL-2023 paper: Evaluate AMR Graph Similarity via Self-supervised Learning. AMRSim collects silver AMR graphs and utilizes self-supervised learning methods to evaluate the similarity of AMR graphs. AMRSim calculates the cosine of contextualized token embeddings, making it alignment-free.

Requirements

Run the following script to install the dependencies:

pip install -r requirements.txt

Install amr-utils:

git clone https://github.com//ablodge/amr-utils
pip install penman
pip install ./amr-utils

Computing AMR Similarity

Preprocess

Linearize AMR graphs and calculate the relative distance of nodes from the root:

cd preprocess
python amr2json.py -src <amr_file> -tgt <amr_file>

Returning Similarity with pre-trained model

Download the model from Google drive and unzip to the output directory (/sentence-transformers/output/).

cd sentence_transformers
python test_amrsim.py

Training a Similarity model from scratch

Following data preparation in AMR-DA (Shou et al., 2022), AMRSim utilized SPRING (Bevilacqua et al., 2021) to parse one-million sentences randomly sampled from English Wikipedia2 to AMR graphs.

Generated Wiki AMR graphs were preprocessed and can be download from the Google drive. For training, run:

python train_stsb_ct_amr.py

Citation

@inproceedings{shou-lin-2023-evaluate,
    title = "Evaluate {AMR} Graph Similarity via Self-supervised Learning",
    author = "Shou, Ziyi  and
      Lin, Fangzhen",
    booktitle = "Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)",
    month = jul,
    year = "2023",
    address = "Toronto, Canada",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2023.acl-long.892",
    pages = "16112--16123",
}

Acknowledgments

This project uses code from the following open source projects:

Thank you to the contributors of these projects for their valuable contributions to the open source community.

About

Code for our paper "Evaluate AMR Graph Similarity via Self-supervised Learning" in ACL 2023

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published