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

Implement predicate modification for EDS #156

Closed
goodmami opened this issue Jul 13, 2018 · 7 comments
Closed

Implement predicate modification for EDS #156

goodmami opened this issue Jul 13, 2018 · 7 comments
Milestone

Comments

@goodmami
Copy link
Member

See here: #130 (comment)

"By 1997, almost all remaining uses of cancer-causing asbestos will be outlawed."

[ LTOP: h1 INDEX: e3 [ e SF: PROP TENSE: FUT MOOD: INDICATIVE PROG: - PERF: - ]
  RELS: <
    [ focus_d_rel<0:79> LBL: h2 ARG0: e5 [ e SF: PROP ] ARG1: e3 ARG2: e4 [ e SF: PROP TENSE: UNTENSED MOOD: INDICATIVE PROG: - PERF: - ] ]
    [ _by_p_temp_rel<0:2> LBL: h2 ARG0: e4 ARG1: e3 ARG2: x6 [ x PERS: 3 NUM: SG IND: + ] ]
    [ proper_q_rel<3:8> LBL: h7 ARG0: x6 RSTR: h8 BODY: h9 ]
    [ yofc_rel<3:8> LBL: h10 ARG0: x6 CARG: "1997" ]
    [ "_almost_x_deg_rel"<9:15> LBL: h11 ARG0: e12 [ e SF: PROP TENSE: UNTENSED MOOD: INDICATIVE PROG: - PERF: - ] ARG1: u13 ]
    [ _all_q_rel<16:19> LBL: h11 ARG0: x14 [ x PERS: 3 NUM: PL ] RSTR: h15 BODY: h16 ]
    [ "_remaining_a_1_rel"<20:29> LBL: h17 ARG0: e18 [ e SF: PROP TENSE: UNTENSED MOOD: INDICATIVE ] ARG1: x14 ]
    [ "_use_n_of_rel"<30:34> LBL: h17 ARG0: x14 ARG1: x19 [ x PERS: 3 NUM: SG GEND: N IND: - ] ]
    [ udef_q_rel<38:61> LBL: h20 ARG0: x19 RSTR: h21 BODY: h22 ]
    [ compound_rel<38:52> LBL: h23 ARG0: e26 [ e SF: PROP TENSE: UNTENSED MOOD: INDICATIVE PROG: - PERF: - ] ARG1: e24 [ e SF: PROP TENSE: UNTENSED MOOD: INDICATIVE PROG: + PERF: - ] ARG2: x25 ]
    [ udef_q_rel<38:52> LBL: h27 ARG0: x25 RSTR: h28 BODY: h29 ]
    [ "_cancer_n_1_rel"<38:52> LBL: h30 ARG0: x25 ]
    [ "_cause_v_1_rel"<38:52> LBL: h23 ARG0: e24 ARG1: x19 ARG2: p31 ]
    [ "_asbestos_n_1_rel"<53:61> LBL: h23 ARG0: x19 ]
    [ "_outlaw_v_1_rel"<70:79> LBL: h2 ARG0: e3 ARG1: i32 ARG2: x14 ]
    [ parg_d_rel<70:79> LBL: h2 ARG0: e33 [ e SF: PROP ] ARG1: e3 ARG2: x14 ] >
  HCONS: < h28 QEQ h30 h21 QEQ h23 h15 QEQ h17 h8 QEQ h10 h1 QEQ h2 > ]
@goodmami
Copy link
Member Author

@PKUzilin, can you share what command or script you used in the conversion, and whether you started from the MRS or EDS representation?

Thank you

@ghost
Copy link

ghost commented Jul 13, 2018

echo "<the MRS above>" | ./delphin.sh convert --to eds-penman --no-properties
It works for other sentences.

@goodmami
Copy link
Member Author

Ok thanks, I just confirmed it. Note that it works if you use --to dmrs-penman. I believe the problem is that PyDelphin's implementation of EDS does not yet have a feature called "predicate modification" that connects "almost" and "all". DMRS retains scope information so it does not become disconnected, but EDS must resort to other means. The EDS you get from the SDP data was created with a different codebase that does perform predicate modification (note the ARG1 on the _almost_x_deg), so it's possible that you can convert to PENMAN using PyDelphin if you load the EDS representation and convert it directly to PENMAN, but currently delphin.sh convert --from eds --to eds-penman does not work because it requires round-tripping through a different representation. This is a deficiency in PyDelphin.

When I get a chance I'll see if I can resolve the EDS issue somehow. In the meantime you can try using DMRS instead of EDS, as PyDelphin has much better support for that representation.

@ghost
Copy link

ghost commented Jul 13, 2018

Thanks a lot for the helpful info!

@goodmami goodmami changed the title "invalid graph; possibly disconnected" when converting SDP data to PENMAN Implement predicate modification for EDS Jul 24, 2018
@goodmami
Copy link
Member Author

@PKUzilin
I've implemented predicate modification (there may be some more tweaks later but it seems to work well now), but there was one more bug (#160) that prevented conversion to eds-penman, which is now fixed. If you still want to use the eds-penman representation, I suggest you clone the latest PyDelphin (develop branch) and give it a shot.

@ghost
Copy link

ghost commented Jul 25, 2018

Thank you so much! I also found that the last version of pydelphin I used cannot convert some of the EDS/DMRS graphs into json format. I will let you know if the latest one still has that problem.

@goodmami
Copy link
Member Author

Yes, the "predicate modification" fix covers a large share of the disconnected graphs, but not all, and it's not really possible to "fix" all disconnected graphs in a principled way. Rather, I think PyDelphin should not crash when encountering a graph it cannot serialize. It should either (a) output nothing, or (b) output just the connected part. Then it should continue to the next item, possibly with a warning about the broken item. I've created #161 for this.

If you come up with some specific MRSs that break JSON (or PENMAN) serialization, please start a new issue. It might be a different problem than the one for this issue. Thanks!

@goodmami goodmami added this to the v0.8.0 milestone Aug 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant