Skip to content
This repository has been archived by the owner on Oct 14, 2022. It is now read-only.

error when comparing a partial disambiguated fftb profile with the same one analysed by ACE #1

Closed
arademaker opened this issue Aug 22, 2020 · 5 comments
Labels
upstream The problem is in a dependency

Comments

@arademaker
Copy link
Member

not all items in the omw2k were disambiguated:

% delphin process -g terg-dict-mac.dat -o "-n 1" -s omw2k omw2k-parsed
% delphin edm -v --ignore-missing=gold omw2k omw2k-parsed
Traceback (most recent call last):
  File "/Users/ar/venv/bin/delphin", line 8, in <module>
    sys.exit(main())
  File "/Users/ar/venv/lib/python3.8/site-packages/delphin/main.py", line 42, in main
    args.func(args)
  File "/Users/ar/venv/lib/python3.8/site-packages/delphin/cli/edm.py", line 35, in call_compute
    p, r, f = edm.compute(
  File "/Users/ar/venv/lib/python3.8/site-packages/delphin/edm.py", line 235, in compute
    totals: Match = accumulate(
  File "/Users/ar/venv/lib/python3.8/site-packages/delphin/edm.py", line 154, in accumulate
    for i, (gold, test) in enumerate(zip_longest(golds, tests), 1):
  File "/Users/ar/venv/lib/python3.8/site-packages/delphin/cli/edm.py", line 59, in _iter_representations
    yield from_mrs(result.mrs(), predicate_modifiers=True)
  File "/Users/ar/venv/lib/python3.8/site-packages/delphin/eds/_operations.py", line 43, in from_mrs
    top = _mrs_get_top(m.top, hcmap, reps)
  File "/Users/ar/venv/lib/python3.8/site-packages/delphin/eds/_operations.py", line 70, in _mrs_get_top
    top = reps[lbl][0].id
KeyError: 'h1'
``` `
@goodmami
Copy link
Member

It looks like the EDS function in PyDelphin could be made more robust (a PyDelphin issue, once we can pinpoint the MRS to make the error reproducible), but can you clarify what your profiles are? What do you mean by a partially-disambiguated fftb profile? This delphin.edm module wouldn't be able to compare full-forest results to regularly enumerated results.

@arademaker
Copy link
Member Author

By partially-disambiguated fftb profile I mean a fftb profile with many items yet not analyzed (yellow items in the fftb page that list the sentences! Sorry if I didn't use the right terminology) . The delphin.edm worked fine comparing an fftb profile fully-disambiguated (all items green) to a profile of the same set of sentences processed (https://github.com/arademaker/sick-fftb, comparing parsed with golden).

BTW, what delphin.edm does when a profile has more them one result for items? In my case I executed with (ace -n 1), but if an item has more them one result, how the module use them?

@goodmami
Copy link
Member

I don't think this is a delphin.edm issue then. If you can find the MRS that causes the error in EDS conversion then please open an issue on PyDelphin.

BTW, what delphin.edm does when a profile has more them one result for items? In my case I executed with (ace -n 1), but if an item has more them one result, how the module use them?

It uses the first result (result-id is 0), which you can change with the -p option as described in delphin edm -h.

Unless there's something that's clearly a delphin.edm issue, I think I'll close this.

@goodmami goodmami added the upstream The problem is in a dependency label Aug 23, 2020
@arademaker
Copy link
Member Author

arademaker commented Sep 9, 2020

Processing another profile, the same error. I was able to identify the source MRS:

Sentence 7000043

[ TOP: h0
  INDEX: e2 [ e SF: prop-or-ques TENSE: untensed MOOD: indicative ]
  RELS: < [ unknown<0:69> LBL: h4 ARG: u5 ARG0: e2 ]
          [ _in_p_loc<0:2> LBL: h4 ARG0: e2 ARG1: u6 ARG2: x7 [ x PERS: 3 NUM: sg IND: + PT: pt ] ]
          [ _the_q<3:6> LBL: h8 ARG0: x7 RSTR: h9 BODY: h10 ]
          [ compound<7:17> LBL: h11 ARG0: e12 [ e SF: prop TENSE: untensed MOOD: indicative PROG: - PERF: - ] ARG1: x7 ARG2: x13 [ x IND: + PT: pt ] ]
          [ udef_q<7:12> LBL: h14 ARG0: x13 RSTR: h15 BODY: h16 ]
          [ _front_n_1<7:12> LBL: h17 ARG0: x13 ]
          [ _part_n_of<13:17> LBL: h11 ARG0: x7 ARG1: i18 ]
          [ _of_p<18:20> LBL: h11 ARG0: e19 [ e SF: prop TENSE: untensed MOOD: indicative PROG: - PERF: - ] ARG1: x7 ARG2: x20 [ x PERS: 3 NUM: sg IND: + PT: pt ] ]
          [ _the_q<21:24> LBL: h21 ARG0: x20 RSTR: h22 BODY: h23 ]
          [ _neck_n_1<25:29> LBL: h24 ARG0: x20 ]
          [ _below_p<30:35> LBL: h11 ARG0: e25 [ e SF: prop TENSE: untensed MOOD: indicative PROG: - PERF: - ] ARG1: x7 ARG2: x26 [ x PERS: 3 NUM: sg IND: + PT: pt ] ]
          [ _the_q<36:39> LBL: h27 ARG0: x26 RSTR: h28 BODY: h29 ]
          [ _chin_n_1<40:44> LBL: h30 ARG0: x26 ]
          [ _and_c<45:48> LBL: h11 ARG0: e31 [ e SF: prop TENSE: untensed MOOD: indicative PROG: - PERF: - ] ARG1: e25 ARG2: e32 [ e SF: prop TENSE: untensed MOOD: indicative PROG: - PERF: - ] ]
          [ _above_p<49:54> LBL: h11 ARG0: e32 ARG1: x7 ARG2: x33 [ x PERS: 3 NUM: sg PT: pt ] ]
          [ _the_q<55:58> LBL: h34 ARG0: x33 RSTR: h35 BODY: h36 ]
          [ _collarbone/nn_u_unknown<59:69> LBL: h37 ARG0: x33 ] >
  HCONS: < h0 qeq h1 h9 qeq h11 h15 qeq h17 h22 qeq h24 h28 qeq h30 h35 qeq h37 > ]
Traceback (most recent call last):
  File "process.py", line 13, in <module>
    e = eds.from_mrs(m)
  File "/Users/ar/venv/lib/python3.8/site-packages/delphin/eds/_operations.py", line 43, in from_mrs
    top = _mrs_get_top(m.top, hcmap, reps)
  File "/Users/ar/venv/lib/python3.8/site-packages/delphin/eds/_operations.py", line 70, in _mrs_get_top
    top = reps[lbl][0].id
KeyError: 'h1'

The sentence is a definition of a sysnet in OMW:

in the front part of the neck below the chin and above the collarbone

This is an invalid MRS, right? h1 nor h0 appears in the LBLs of the predicates.

@goodmami
Copy link
Member

Thanks for the example. This is a PyDelphin bug, so I've opened delph-in/pydelphin#316 to track it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
upstream The problem is in a dependency
Projects
None yet
Development

No branches or pull requests

2 participants