Is there something I can add to my Simple MRS (or a knob I can turn on ACE) to indicate that I don’t want passive voice alternatives when using ACE to generate English?
For example, this:
[ TOP: h0
RELS: < [ _a_q LBL: h9 ARG0: x8 [ x PERS: 3 NUM: sg IND: + ] RSTR: h10 BODY: h11 ]
[ _diamond_n_1 LBL: h12 ARG0: x8 [ x PERS: 3 NUM: sg IND: + ] ]
[ pronoun_q LBL: h5 ARG0: x3 [ x PERS: 1 NUM: sg IND: + PT: std ] RSTR: h6 BODY: h7 ]
[ pron LBL: h4 ARG0: x3 [ x PERS: 1 NUM: sg IND: + PT: std ] ]
[ _see_v_1 LBL: h1 ARG0: e2 [ e SF: prop TENSE: pres MOOD: indicative PROG: - PERF: - ] ARG1: x3 ARG2: x8 ]
HCONS: < h0 qeq h1 h6 qeq h4 h10 qeq h12 > ]
‘I see a diamond.’
‘A diamond is seen by me.’
I just want the first one and don’t want to have to post process to figure out which is active…
You can tweak the grammar.
In ace/config.tdl there is a line:
generation-ignore-rules := “…/lkb/nogen-rules.set”.
in …/lkb/nogen-rules.set" is a list of rules not to apply in generation.
If you add the passive rules to this file (e.g., v_pas_odlr and similar rules from inflr.dtl), it will prevent passivization in parsing.
Note you have to recompile the grammar after making these changes.
There is more discussion of generation here: http://moin.delph-in.net/LkbGeneration#Selective_Generation_.28globals.lisp.29
You can also tweak the ICONS to force the passivization (e.g, adding
ICONS: < e2 topic x8 > at the end generates only “A diamond is seen by me.”), but I can’t seem to force the other way (e.g., by adding
ICONS: < e2 topic x3 >).
Somewhat relatedly, parsing “It is I who saw a diamond” gets the first parse with an MRS as above but with
ICONS: < e2 focus x3 >, but I cannot then generate from this sentence. It seems there are some more gaps in generation coverage.
Mike is onto a better approach by looking to constrain ICONS, but see below. While Francis’s strategy for blocking passives has the advantage of making the generator a little more efficient, it would require you to find all of the various lexical rules for passives (there have to be several, alas).
A preferable strategy is to alter the “root” condition imposed on the generator, which controls what it outputs. The default for generation is a root called “root_gen” which already suppresses so-called topicalization such as “Paris, Kim admired.” as a variant of “Kim admired Paris.” ACE has an option for supplying a non-default root, via the “-r” flag; try the following to see it in actionL
“Kim admired Paris.” | ace -g erg.dat -1 | ace -g erg.dat -e -r root_strict
You’ll see the topicalized variants generated, along with the ones you saw before.
Now to suppress passives too, I should have included the following root variant, which constrains ICONS to be empty, blocking both topicalization and passives. You can add this code snippet between the “====” lines to (the end of) the file roots.tdl, and then recompile the ERG:
;; Also exclude passives in generation
root_gen_nopass := phrase &
[ INFLECTD +,
SYNSEM root_synsem &
[ LOCAL [ CAT.HEAD verb_or_conj-s,
CONT.ICONS 0-dlist ],
PUNCT.RPUNCT basic_clause_punct ],
ORTH root_orth ].
I don’t remember if you have already recompiled the ERG, but here’s the command, once you’re in your ERG directory:
ace -G erg.dat -g ace/config.tdl
All that was because I hadn’t already defined that obviously useful root - I’ll check it in to the `trunk’ version of the grammar soon. Now you can try out your change by doing the following:
“Kim admired Paris.” | ace -g erg.dat -1 | ace -g erg.dat -e -r root_gen_nopass
You’ll see just the simple active sentence generated now.
These are all great. thanks everyone! I’m going to try out some options today.
I also may try increasing the variations to include the Yoda-ization you show above. Might add some funny variety to the responses!