Skip to content
/ CAMR Public
forked from c-amr/camr

Transition-based tree-to-graph AMR Parser

License

Notifications You must be signed in to change notification settings

didzis/CAMR

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

REST API and Demo UI for CAMR + wrapper

Ready to run docker image available at dockerhub:

docker run --rm -p 5000:5000 -it didzis/camrrest --rest

On Linux open http://localhost:5000, on MacOS X or Windows open http://192.168.99.100:5000. Alternatively, execute: $ ./rest.sh.

NOTE: docker image requires at least 2GB of disk space and up to 22GB of RAM.

Demo User Interface includes REST API specification in Swagger format.

Wrapper for CAMR parser

Ready to run docker image available at dockerhub:

docker run -it -v INPUTDIR:/data didzis/camrwrapper --input FILE --output FILE

Alternatively, execute: $ ./camrwrapper.sh --help.

Description

This is AMR parser used in SemEval 2016 Task 8. For details see:

@InProceedings{barzdins-gosko:2016:SemEval,
  author    = {Barzdins, Guntis  and  Gosko, Didzis},
  title     = {RIGA at SemEval-2016 Task 8: Impact of Smatch Extensions and Character-Level Neural Translation on AMR Parsing Accuracy},
  booktitle = {Proceedings of the 10th International Workshop on Semantic Evaluation (SemEval-2016)},
  month     = {June},
  year      = {2016},
  address   = {San Diego, California},
  publisher = {Association for Computational Linguistics},
  pages     = {1143--1147},
  url       = {http://www.aclweb.org/anthology/S16-1176}
}

CAMR: A transition-based AMR Parser

CAMR is a transition-based, tree-to-graph parser for the Abstract Meaning Representation of a sentence. It is a product of an on-going collaboration between the Chinese Language Processing Group at Brandeis University and cemantix.org

Reference:

  • Chuan Wang, Nianwen Xue, and Sameer Pradhan.2015. A transition-based algorithm for AMR parsing. In Proceedings of the 2015 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 366–375, Denver, Colorado, May–June. Association for Computational Linguistics.
@InProceedings{wang-xue-pradhan:2015:NAACL-HLT,
  author    = {Wang, Chuan  and  Xue, Nianwen  and  Pradhan, Sameer},
  title     = {A Transition-based Algorithm for AMR Parsing},
  booktitle = {Proceedings of the 2015 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies},
  month     = {May--June},
  year      = {2015},
  address   = {Denver, Colorado},
  publisher = {Association for Computational Linguistics},
  pages     = {366--375},
  url       = {http://www.aclweb.org/anthology/N15-1040}
}
@InProceedings{wang-xue-pradhan:2015:ACL-IJCNLP,
  author    = {Wang, Chuan  and  Xue, Nianwen  and  Pradhan, Sameer},
  title     = {Boosting Transition-based AMR Parsing with Refined Actions and Auxiliary Analyzers},
  booktitle = {Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 2: Short Papers)},
  month     = {July},
  year      = {2015},
  address   = {Beijing, China},
  publisher = {Association for Computational Linguistics},
  pages     = {857--862},
  url       = {http://www.aclweb.org/anthology/P15-2141}
}

Dependencies

First download the project:

  git clone https://github.com/Juicechuan/AMRParsing.git

Here we use a modified version of the Stanford CoreNLP python wrapper, Charniak Parser and Stanford CoreNLP toolkit. To setup dependencies, run the following script:

  ./scripts/config.sh

Note: For Mac users, there are some problems when installing the Charniak Parser python module bllipparser. We recommend to use Linux system in order to utilize the Charniak Parser. Also you may need swig to successfully install bllipparser.

Parsing with Pre-trained Model

The input data format for parsing should be raw document with one sentence per line. ##Preprocessing To preprocess the data, run:

  python amr_parsing.py -m preprocess [input_sentence_file]

This will give you the tokenized sentences(.tok), POS tag and name entity (.prp) and dependency structure (.charniak.parse.dep) (generated by Charniak parser and Stanford Dependency converter). Download the model trained on training set of LDC2013E117 newswire section here. Then use the following command to parse the sentence:

  python amr_parsing.py -m parse --model [model_file] [input_sentence_file] 2>log/error.log

This will give your the parsed AMR file(.parsed) in the same directory of your input sentence file. ##Alignment If you have annotated AMR file, you could first run the preprocessing step:

python amr_parsing.py -m preprocess --amrfmt [input_amr_file]

This will generate a tokenized AMR file (.amr.tok) (which has :tok tag in the comments). Then you can run the following command to get the aligned AMR file(.aligned)

./scripts/jamr_align.sh [input_amr_tok_file]

Note: We use JAMR to get the alignment between sentence and its AMR annotation. You need to download and set up JAMR.

About

Transition-based tree-to-graph AMR Parser

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.8%
  • Shell 0.2%