What could be the reason for this (the empty perimeter is supposed to be the MRS):
Trees get displayed fine, but not the other representations.
What could be the reason for this (the empty perimeter is supposed to be the MRS):
Trees get displayed fine, but not the other representations.
Is there actually a valid MRS? We can only display it if it is there, …
I would say so; I just checked some examples from the MRS testsuite; I think they should be valid but of course it is possible that something about them is wrong (this is the Spanish treebanks).
Here’s one I was looking at (I copied a portion from the result
file):
[ LTOP: h0 INDEX: e2 [ e SF: prop TENSE: untensed MOOD: indicative ] RELS: < [ named_rel<-1:-1> LBL: h4 CARG: "pitágoras" WLINK: list CFROM: *top* CTO: *top* ARG0: x3 ARG1: u9 ] [ "_ladrar_v_rel"<-1:-1> LBL: h1 WLINK: list CFROM: *top* CTO: *top* ARG0: e2 ARG1: x3 ] > HCONS: < h0 qeq h1 > ]@
This is the same item if fftb, think:
But in LTDB, no MRS:
Perhaps something wrong about the MRS?
The MRS above is not valid according to the grammar, maybe pydelphin is not parsing it
According to the grammar @arademaker linked to, role-argument values must be variables, and link
and *top*
are not variables. PyDelphin, which LTDB uses under the hood (at least an old version), is more permissive about loading and dumping such MRSs as role-argument values can be any symbol, but any task that involves interpretation of that MRS, such as conversion to DMRS, will likely fail.
>>> from delphin.codecs import simplemrs
>>> s = """[ LTOP: h0 INDEX: e2 [ e SF: prop TENSE: untensed MOOD: indicative ] RELS: < [ named_rel<-1:-1> LBL: h4 CARG: "pitágoras" WLINK: list CFROM: *top* CTO: *top* ARG0: x3 ARG1: u9 ] [ "_ladrar_v_rel"<-1:-1> LBL: h1 WLINK: list CFROM: *top* CTO: *top* ARG0: e2 ARG1: x3 ] > HCONS: < h0 qeq h1 > ]"""
>>> m = simplemrs.loads(s)
>>> m
[<MRS object (named _ladrar_v) at 140321187189856>]
>>> print(simplemrs.dumps(m))
[ TOP: h0 INDEX: e2 [ e SF: prop TENSE: untensed MOOD: indicative ] RELS: < [ named<-1:-1> LBL: h4 ARG0: x3 ARG1: u9 CFROM: *top* CTO: *top* WLINK: list CARG: "pitágoras" ] [ _ladrar_v<-1:-1> LBL: h1 ARG0: e2 ARG1: x3 CFROM: *top* CTO: *top* WLINK: list ] > HCONS: < h0 qeq h1 > ]
>>> from delphin import dmrs
>>> dmrs.from_mrs(m[0])
Traceback (most recent call last):
[...]
ValueError: Invalid variable string: list