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]).
-ce
treat concepts as labelled edges, otherwise as labelled nodes (default)-rle
treat roles as unlabeled nodes with ingoing labelled edges, otherwise as labelled nodes (default)-rmid
place roles between their arguments, otherwise as a parent of its arguments (default)-noarg
don't placeARGn
labelled or argument edges, otherwise place them (default)-bm [all arg1 role a1]
box membership (bm
) representation modes:all
bm
edges are present;bm
edges are kept forrole
s but omitted for role arguments if both arguments (excepy constants) have the same membership as their role;arg1
bm
edges are kept, but removed for its role ifarg1
has only thatbm
edge what its role has.a1
further developsarg1
and also omits thebm
edge for arg2 if the latter hasbm
edge 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