The repository contains scripts that help to convert Discourse Representation Structures (DRSs) into Graph formatted as JSON, the format adopted at the MRP shared task, and back from the graph to DRS.
clf2graph.py supports different types of conversion depending on how to represent concept or role clauses (labelled node vs labelled edge), where to place role nodes (between vs as a parent of arguments), and whether to label argument edges (with vs without ARG[12]).
-cetreat concepts as labelled edges, otherwise as labelled nodes (default)-rletreat roles as unlabeled nodes with ingoing labelled edges, otherwise as labelled nodes (default)-rmidplace roles between their arguments, otherwise as a parent of its arguments (default)-noargdon't placeARGnlabelled or argument edges, otherwise place them (default)-bm [all arg1 role a1]box membership (bm) representation modes:allbmedges are present;bmedges are kept forroles but omitted for role arguments if both arguments (excepy constants) have the same membership as their role;arg1bmedges are kept, but removed for its role ifarg1has only thatbmedge what its role has.a1further developsarg1and also omits thebmedge for arg2 if the latter hasbmedge for the same box as arg1 and teh role.
For example, the DRGs used in the MRP shared task are produced with (using a sample DRS):
./clf2graph.py --input test_suite/crops/crops.clf --raw test_suite/crops/crops.raw --output test_suite/crops/crops.mrp -noarg -rmid -bm arg1 --sig clf_signature.yaml
Note that with this particular combination of parameters, some CLFs might not be convertible as the conversion assumes a single (maximally specific) concept per discourse referent.
Clausal forms can be recovered from MRP DRGs by:
./mrp2clf.py --mrp test_suite/crops/crops.mrp --clf test_suite/crops/crops.mrp.clf --sig clf_signature.yaml
Python 3