Skip to content

Visualizing Graphbanks

Matthias Lindemann edited this page Nov 21, 2019 · 1 revision

visualize_graphbank.sh

Sometimes we want to visualize the graphs that we have (either straight from the graphbank or from a parsed file). The common case that is described here assumes:

  • we have a file containing graphs in one of the formats MRP, AMR/Penman, SDP
  • we want to create a pdf file for every graph in the graphbank

If that fits your use case, analyzers/visualize_graphbank.sh is the right script to call. Before using this script, open it your editor and set the mtool variable to be the python command that calls the main.py script of your local mtool copy. For example, in my case, the right command is mtool="python3 /home/matthias/bin/mtool_code/main.py".

  1. cd to the directory where you want to store all PDFs
  2. call /your/path/to/am-parser/analyzers/visualize_graphbank.sh

analyzers/visualize_graphbank.sh expects three arguments:

  1. The file format of your graphbank (amr, mrp, dm, pas, psd and whatever is supported by mtool)
  2. The prefix you want for your PDF files. For instance, choosing "AMR" results in the AMR-01.pdf, AMR-02.pdf etc.
  3. The file containing the graphs

Beware: Currently, a temporary file in /tmp/ is created, so it only works on Linux and MacOS.

Clone this wiki locally