Spurious questions on copulas in Grammar Matrix

Hi all,

I was working on a mini grammar of English and I came across a spurious parse for “the dog is old” - with an extra (int ) phrase. I wonder if this is interference between the yes-no library and the copula functionality? I was able to remove the parse by adding INV - to the cop-lex super type. However, I have little idea how the question mechanisms work so I figured I would ask :slight_smile:

Here is the ace output with the spurious parse:

SENT: the dog is old
[ LTOP: h0
INDEX: e2 [ e SF: prop-or-ques E.TENSE: present E.ASPECT: aspect E.MOOD: mood ]
RELS: < [ "_the_q_rel"<-1:-1> LBL: h4 ARG0: x3 [ x SPECI: bool COG-ST: cog-st PNG.PER: 3rd PNG.NUM: singular PNG.GEND: gender ] RSTR: h5 BODY: h6 ]
[ "_dog_n_rel"<-1:-1> LBL: h7 ARG0: x3 ]
[ "_old_a_rel"<-1:-1> LBL: h1 ARG0: e2 ARG1: x3 ] >
HCONS: < h0 qeq h1 h5 qeq h7 >
ICONS: < > ] ; (314 subj-head 0.000000 0 4 (312 head-spec 0.000000 0 2 (5 the 0.000000 0 1 ("the")) (311 singular-lex 0.000000 1 2 (6 dog 0.000000 1 2 ("dog")))) (313 head-comp 0.000000 2 4 (7 is 0.000000 2 3 ("is")) (9 old 0.000000 3 4 ("old"))))
[ LTOP: h0
INDEX: e2 [ e SF: ques E.TENSE: present E.ASPECT: aspect E.MOOD: mood ]
RELS: < [ "_the_q_rel"<-1:-1> LBL: h4 ARG0: x3 [ x SPECI: bool COG-ST: cog-st PNG.PER: 3rd PNG.NUM: singular PNG.GEND: gender ] RSTR: h5 BODY: h6 ]
[ "_dog_n_rel"<-1:-1> LBL: h7 ARG0: x3 ]
[ "_old_a_rel"<-1:-1> LBL: h1 ARG0: e2 ARG1: x3 ] >
HCONS: < h0 qeq h1 h5 qeq h7 >
ICONS: < > ] ; (319 int 0.000000 0 4 (318 subj-head 0.000000 0 4 (316 head-spec 0.000000 0 2 (5 the 0.000000 0 1 ("the")) (315 singular-lex 0.000000 1 2 (6 dog 0.000000 1 2 ("dog")))) (317 head-comp 0.000000 2 4 (7 is 0.000000 2 3 ("is")) (9 old 0.000000 3 4 ("old")))))
NOTE: 2 readings, added 268 / 194 edges to chart (51 fully instantiated, 40 actives used, 33 passives used) RAM: 1778k

Here is the original cop-lex rule my choices provided:

cop-lex := basic-verb-lex-super & trans-first-arg-raising-lex-item-2 & non-mod-lex-item &
  [ SYNSEM.LOCAL [ CONT.HOOK.XARG #xarg,
                   CAT.VAL [ COMPS < [ LOCAL.CAT cat-sat &
                                                 [ HEAD.PRD +,
                                                   VAL [ SUBJ < >,
                                                         COMPS < > ] ] ] >,
                             SPR < >,
                             SPEC < >,
                             SUBJ < [ LOCAL [ CONT.HOOK.INDEX #xarg,
                                              CAT cat-sat &
                                                  [ VAL [ SPR < >,
                                                          COMPS < > ],
                                                    HEAD noun &
                                                         [ CASE real-case ] ] ] ] > ] ] ].

I added INV - and got rid of the parse:

cop-lex := basic-verb-lex-super & trans-first-arg-raising-lex-item-2 & non-mod-lex-item &
  [ SYNSEM.LOCAL [ CONT.HOOK.XARG #xarg,
                   CAT [ HEAD.INV -,
                         VAL [ COMPS < [ LOCAL.CAT cat-sat &
                                                 [ HEAD.PRD +,
                                                   VAL [ SUBJ < >,
                                                         COMPS < > ] ] ] >,
                               SPR < >,
                               SPEC < >,
                               SUBJ < [ LOCAL [ CONT.HOOK.INDEX #xarg,
                                                CAT cat-sat &
                                                    [ VAL [ SPR < >,
                                                            COMPS < > ],
                                                      HEAD noun &
                                                         [ CASE real-case ] ] ] ] > ] ] ] ].


SENT: the dog is old
[ LTOP: h0
INDEX: e2 [ e SF: prop-or-ques E.TENSE: present E.ASPECT: aspect E.MOOD: mood ]
RELS: < [ "_the_q_rel"<-1:-1> LBL: h4 ARG0: x3 [ x SPECI: bool COG-ST: cog-st PNG.PER: 3rd PNG.NUM: singular PNG.GEND: gender ] RSTR: h5 BODY: h6 ]
 [ "_dog_n_rel"<-1:-1> LBL: h7 ARG0: x3 ]
 [ "_old_a_rel"<-1:-1> LBL: h1 ARG0: e2 ARG1: x3 ] >
HCONS: < h0 qeq h1 h5 qeq h7 >
ICONS: < > ] ;  (312 subj-head 0.000000 0 4 (310 head-spec 0.000000 0 2 (5 the 0.000000 0 1 ("the")) (309 singular-lex 0.000000 1 2 (6 dog 0.000000 1 2 ("dog")))) (311 head-comp 0.000000 2 4 (7 is 0.000000 2 3 ("is")) (9 old 0.000000 3 4 ("old"))))
NOTE: 1 readings, added 266 / 192 edges to chart (49 fully instantiated, 38 actives used, 31 passives used)	RAM: 1752k


NOTE: parsed 1 / 1 sentences, avg 1752k, time 0.00535s

Questions (before I set up the regression test environment, etc.):

  1. Does this seem like the right way to resolve this problem?
  2. Is this going to cause problems if someone wanted to add support for “is the dog old”

I haven’t checked but most likely yes, it will. In the past, I had to disassociate types which are intended for questions from types which are intended for e.g. subordinating complementizers. I expect that something like this might need to be done for copulas as well.

Or, it is possible that the interrogative clause type is underconstrained there somehow. Could I see the grammar?

1 Like

Yes, this seems like the right way to do it. If you want to fix this bug in customization (and thanks, if so!), it seems like the spot is yes_no_questions.py, where INV is introduced. It’s added to “all verbs”, but the way that’s set up is missing the copula (and possibly other auxiliaries?). So you probably want to add it to cop-lex just in case it’s being added elsewhere.

The way the subj-v-inv rule works involves an [ INV - ] daughter and an [ INV + ] mother, so (as long as the rule can apply to cop-lex, also probably a bug), there shouldn’t be a problem there.

@ebender I suppose enabling cop-lex to go through the inversion rule would allow for the customization system to support “is the dog old”, right? If so, I might add a regression test for it.

I suppose this is karma for me to find a bug in my own library 5 years later :-p

Yes – allowing cop-lex as a daughter there should help with that :slight_smile:

@olzama I emailed you the choices file that extends mini English that illustrates the problem. Sorry for the delay; I was having issues with the verbal inflection, but I just figured it out :slight_smile: (is there a way to upload choices files here that I can’t figure out?)

Here’s the test suite I was using to make it:

I sleep
I can sleep
the dog sleeps
the dog can sleep
the dog is old
can I sleep
can the dog sleep
is the dog old

the dog is old is the only one with the spurious reading. The rest are consistent with the ERG.

Thanks, T.J.! I will take a look! (And I don’t think it is possible to attach files here.)

1 Like

Committed. rtest is very nice, but also confirmed the tests pass with ace, tsdb, LKB, and with the traditional regression test setup.

2 Likes