Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in converting MRS to DMRS when EP has no ARG0 #289

Closed
goodmami opened this issue May 28, 2020 · 0 comments
Closed

Error in converting MRS to DMRS when EP has no ARG0 #289

goodmami opened this issue May 28, 2020 · 0 comments
Labels
Milestone

Comments

@goodmami
Copy link
Member

There is an error when converting an MRS to a DMRS when an EP does not have an ARG0 (see the discourse thread).

$ echo "[ LTOP: h0 INDEX: e2 [ e SF: prop-or-ques E.TENSE: tense E.ASPECT: aspect E.MOOD: mood ] RELS: < [ “_name_n_rel”<-1:-1> LBL: h4 ARG0: x5 [ x SPECI: bool COG-ST: cog-st PNG.PER: 3rd PNG.NUM: number PNG.GEND: gender ] ] [ “exist_q_rel”<-1:-1> LBL: h6 ARG0: x5 RSTR: h7 BODY: h8 ] [ “_drown_v_rel”<-1:-1> LBL: h9 ARG0: e10 [ e SF: iforce E.TENSE: tense E.ASPECT: aspect E.MOOD: mood ] ARG1: x5 ARG2: x11 [ x SPECI: bool COG-ST: cog-st PNG.PER: 3rd PNG.NUM: number PNG.GEND: gender ] ] [ “_paper_n_rel”<-1:-1> LBL: h12 ARG0: x11 ] [ “exist_q_rel”<-1:-1> LBL: h13 ARG0: x11 RSTR: h14 BODY: h15 ] [ “_return_v_rel”<-1:-1> LBL: h16 ARG0: e17 [ e SF: iforce E.TENSE: tense E.ASPECT: aspect E.MOOD: mood ] ARG1: x5 ARG2: x18 [ x SPECI: bool COG-ST: cog-st PNG.PER: person PNG.NUM: number PNG.GEND: gender ] ] [ “_and_coord_rel”<-1:-1> LBL: h1 L-HNDL: h9 R-HNDL: h19 C-ARG: e2 L-INDEX: e10 R-INDEX: e17 ] > HCONS: < h0 qeq h1 h7 qeq h4 h14 qeq h12 > ICONS: < e20 [ e SF: iforce E.TENSE: tense E.ASPECT: aspect E.MOOD: mood ] non-focus x18 > ]" | delphin convert --indent --to dmrs-penman
Traceback (most recent call last):
  [...]
  File "/home/goodmami/delphin/pydelphin/delphin/dmrs/_operations.py", line 72, in _mrs_to_nodes
    properties = m.properties(iv)
  File "/home/goodmami/delphin/pydelphin/delphin/mrs/_mrs.py", line 275, in properties
    var = self[id].iv
  File "/home/goodmami/delphin/pydelphin/delphin/sembase.py", line 164, in __getitem__
    return self._pidx[id]
KeyError: None

To be clear, MRSs that do not follow the intrinsic variable property cannot be reliably converted to DMRS, but in this case the error is more mundane. Since the _and_coord EP has a C-ARG instead of an ARG0, ep.iv returns None which results in a KeyError when looking up the EP's properties by that key.

Better in this case would be one of the following:

  • raise an error that the MRS cannot be converted to a DMRS
  • raise a warning about this missing ARG0 and assign no properties (in this case the missing ARG0 should identify with the MRS's INDEX, so there may be other issues with this example, as well as missing EPs for the e20 and x18 in the ICONS list)
@goodmami goodmami added the bug label May 28, 2020
goodmami added a commit that referenced this issue Jun 5, 2020
@goodmami goodmami added this to the v1.3.0 milestone Jul 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant