Skip to content
Snippets Groups Projects

amrBatch


AMR Batch is a python library to parse natural language sentences in order to build AMR graphs. It requires, as input, a textual document, and gives as output a set of AMR graphs corresponding to each sentence of the input document.

This library is currently under development, and therefore in unstable state.

Installation

This project was developp under Python 3.7 and Manjaro Linux system, but should be run on most common systems (Linux, Windows, Mac). All dependencies are listed in requirements.txt.

First, it is recommended to use a virtual environment. For example, 'venv' can be create and use with the following commands:

python3 -m venv venv

source venv/bin/activate

The necessary libraries are defined in the file 'requirements.txt', and can be installed in the virtual environment using package installer as pip:

pip install -r requirements.txt

See specific installation instructions about amrlib (amrlib-install).

So, it is necessary to install the models used by amrlib library. Models can be downloaded from amrlib-models.

These files need to be extracted and reside in a directory. The path to this directory can then be passed as a parameter of the main method. The model STOG 'xfm_bart_large-v0_1_0' (from source dir 'amrbatch/models/') is used by default if no model is given.

Usage

The script test_amrbatch_main.py (test directory) gives an example of using the library.

References


amrlib: A python library that makes AMR parsing, generation and visualization simple.

amr-ld: A Python library for mapping AMRs to linked data formats (such as RDF and JSON-LD).

Burns, G.A., Hermjakob, U., Ambite, J.L. (2016). Abstract Meaning Representations as Linked Data. In: , et al. The Semantic Web – ISWC 2016. ISWC 2016. Lecture Notes in Computer Science(), vol 9982. Springer, Cham. https://doi.org/10.1007/978-3-319-46547-0_2