next up previous contents
Next: Simple Attachment Example Up: Monitoring and Revision with Previous: Changing the Ambiguous Parts

Redefining Locality

Often it will not be possible to generate an alternative expression by a local change as we suggested. We propose that the monitor first tries to change things as locally as possible. If all possibilities are tried, the notion `locality' is redefined by going up one level. This process repeats itself until no more alternative solutions are possible. Thus, given a marked derivation tree the monitored generation strategy first tries to find alternatives for the marked parts of the tree. If no further possibilities exist, all markers in the trees are inherited by their mother nodes. Again the monitored generation strategy tries to find alternatives, after which the markers are pushed upwards yet another level, etc.

It is possible that by successively moving markers upwards in a marked derivation tree the root node of the tree will be marked. If also in that case no unambiguous alternative will be possible then this means that the generator is not able to compute a grammatically unambiguous alternative. In this case the whole monitored generation process terminates and the strategic component has to decide whether to utter the ambiguous structure or to provide an alternative logical form. We will assume the definition of a function named MARK_L_G for pushing markers one level up. Now, the whole algorithm can be completed as follows.

mark_l_g(Tree,Set,Guide):-
    mark(Tree,Set),
    l_g(Tree,Guide).

l_g(Tree,Tree).
l_g(Tree,Guide):-
    one_up(Tree,Tree2),
    l_g(Tree2,Guide).

one_up(t(L,Ds,n),t(L,Ds,y)):-
    member(t(_,_,y),Ds),!.
one_up(t(L,Ds,n),t(L,Ds2,n)):-
    one_up_ds(Ds,Ds2).

one_up_ds([],[]).
one_up_ds([H|T],[H2|T2]):-
    one_up(H,H2), 
    one_up_ds(T,T2).

monitored_generation(LF,Sign):-
    generate(sign(LF,Str,Syn,D)),
    !,  % stick to one..
    find_all_parse(sign(_,Str,_,_),_,TreeSet),
    ( TreeSet = [ ]
    -> Sign = sign(LF,Str,Syn,D)
    ; revision(sign(LF,Str,Syn,D),TreeSet,Sign)
    ).

revision(sign(LF,Str1,Syn1,D1),TreeSet,sign(LF,Str,Syn,D)):-
    mark_l_g(D1,TreeSet,Guide),
    mgen(sign(LF,Str,Syn,D),Guide),
    unambiguous(sign(_,Str,_,_)).

find_all_parse(Sign,SignSet,TreeSet) :-
    setof(Sign,parse(Sign),SignSet),
    extract_trees(SignSet,TreeSet).

unambiguous(Sign):-
    find_all_parse(Sign,[One],_).

monitored_generation(goal):
  GenTree := generate_one(goal),
  TreeSet := find_all_parses(string(root_node(GenTree)))
  if null(rest(TreeSet))
   then string(root_node(GenTree))
   else Guide := mark(GenTree,TreeSet);
        revision(Guide)

generate_one(goal):
 ``just compute the first string and then stop''

find_all_parses(string):
 ``find all readings for a given string;
   ignore spurious ambiguities, in such a way
   that if two parsed trees have the same semantics
   then retain only one.''

revision(Guide):
 NewRes := mgen(Guide)
 if unambiguous(NewRes)
  then string(NewRes)
  else revision(mark_l_g(Guide)).

Summarising, the generator first generates a possible utterance. This utterance is then given as input to the monitor. The monitor calls the parser to find which parts of that utterance are ambiguous. These parts are marked in the derivation tree associated with the utterance. Finally the monitor tries to generate an utterance which uses alternative derivation trees for the marked, i.e., ambiguous parts, eventually pushing the markers successively upwards.

  figure6053
Figure 5.10:  Markers are pushed one level upward


next up previous contents
Next: Simple Attachment Example Up: Monitoring and Revision with Previous: Changing the Ambiguous Parts

Guenter Neumann
Mon Oct 5 14:01:36 MET DST 1998