next up previous
Next: Null productions Up: Probabilistic Earley Parsing Previous: Completion (probabilistictransitive)

An example

  table5470
Table:   Earley chart as constructed during the parse of aaa with the grammar in (a). The two columns to the right in (b) list the forward and inner probabilities, respectively, for each state. In both tex2html_wrap_inline7695 and tex2html_wrap_inline7697 columns, the tex2html_wrap_inline7699 separates old factors from new ones (as per equations 1, 2 and 3). Addition indicates multiple derivations of the same state.

Consider the grammar

eqnarray6158

where q = 1 - p. This highly ambiguous grammar generates strings of any number of a's, using all possible binary parse trees over the given number of terminals. The states involved in parsing the string aaa are listed in Table 2, along with their forward and inner probabilities. The example illustrates how the parser deals with left-recursion and the merging of alternative sub-parses during completion.

Since the grammar has only a single nonterminal, the left-corner matrix tex2html_wrap_inline8423 has rank 1:

displaymath8404

Its transitive closure is

displaymath8405

Consequently, the example trace shows the factor tex2html_wrap_inline8305 being introduced into the forward probability terms in the prediction steps.

The sample string can be parsed as either (a (aa)) or ((a a) a), each parse having a probability of tex2html_wrap_inline8431 . The total string probability is thus tex2html_wrap_inline8433 , the computed tex2html_wrap_inline7695 and tex2html_wrap_inline7697 values for the final state. The tex2html_wrap_inline7695 values for the scanned states in sets 1, 2 and 3 are the prefix probabilities for a, aa, and aaa, respectively: tex2html_wrap_inline8447 , tex2html_wrap_inline8449 , tex2html_wrap_inline8451 .



Andreas Stolcke
Sat Jun 29 21:49:02 PDT 1996