Skip to main content

Penman JS

ci Npm

Abstract Meaning Representation (AMR) parser and generator for JavaScript.

About

This library, including documentation, is a manual port of the Penman Python library. All functionality available in the original library should also be available in this library, with similar usage and semantics. The Python library should still be considered the main project for new features. If you find that behavior differs between these libraries, please open a Github issue.

The goal of this project is to bring the power of the Penman Python library's AMR parsing and generation to the browser and Node.js. This project does not provide a CLI interface for manipulating AMR, since the Python library already provides that functionality.

AMR

Abstract meaning representation (AMR) captures the meaning of English sentences in a single rooted, directed graph. AMR incorporates PropBank semantic roles, and can represent a number of linguistic phenomema including coreference, negation, quantity, modality, questions, and many more. AMR is typically written in PENMAN notation, giving this library its name.

AMR for the sentence "He drives carelessly" is shown below:

(d / drive-01
:ARG0 (h / he)
:manner (c / care-04
:polarity -))

To learn more about AMR, check out the AMR project website. To learn more about PENMAN notation and how it's parsed in this library, visit the Penman Python docs.

Disclaimer

This project is not officially affiliated with AMR or the Penman Python library.

Acknowledgements

This library, including documentation, is a manual port of the Penman Python library, and as such, all credit for the original code and docs work goes to github.com/goodmami/penman.