jurafsky&martin_3rdEd_17 (1).pdf

0n ii1 ii2 ij 2 ij 1 i1j i2j j 1j j 2j ij 01 n 1 n

Info icon This preview shows pages 203–206. Sign up to view the full content.

View Full Document Right Arrow Icon
... ... [0,n] [i,i+1] [i,i+2] [i,j-2] [i,j-1] [i+1,j] [i+2,j] [j-1,j] [j-2,j] [i,j] ... [0,1] [n-1, n] Figure 12.6 All the ways to fill the [ i , j ]th cell in the CKY table. Figure 12.7 shows how the five cells of column 5 of the table are filled after the word Houston is read. The arrows point out the two spans that are being used to add an entry to the table. Note that the action in cell [ 0 , 5 ] indicates the presence of three alternative parses for this input, one where the PP modifies the flight , one where it modifies the booking, and one that captures the second argument in the original VP ! Verb NP PP rule, now captured indirectly with the VP ! X2 PP rule.
Image of page 203

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
204 C HAPTER 12 S YNTACTIC P ARSING Book the flight through Houston S, VP, Verb, Nominal, Noun S,VP,X2 Det NP Nominal, Noun Nominal Prep NP, Proper- Noun [0,1] [0,2] [0,3] [0,4] [0,5] [1,2] [1,3] [2,3] [1,4] [2,5] [2,4] [3,4] [4,5] [3,5] [1,5] Book the flight through Houston S, VP, Verb, Nominal, Noun S,VP,X2 Det NP NP Nominal, Noun Prep PP NP, Proper- Noun [0,1] [0,2] [0,3] [0,4] [0,5] [1,2] [1,3] [2,3] [1,4] [2,5] [2,4] [3,4] [4,5] [3,5] [1,5] Book the flight through Houston S, VP, Verb, Nominal, Noun S,VP,X2 Det NP NP Nominal, Noun Nominal Prep PP NP, Proper- Noun [0,1] [0,2] [0,3] [0,4] [0,5] [1,2] [1,3] [2,3] [1,4] [2,5] [2,4] [3,4] [4,5] [3,5] [1,5] Book the flight through Houston S, VP, Verb, Nominal, Noun S,VP,X2 Det NP NP Nominal, Noun Nominal Prep PP NP, Proper- Noun [0,1] [0,2] [0,3] [0,4] [0,5] [1,2] [1,3] [2,3] [1,4] [2,5] [2,4] [3,4] [4,5] [3,5] [1,5] Book the flight through Houston S, VP, Verb, Nominal, Noun S, VP, X2 Det NP NP Nominal, Noun Nominal Prep PP NP, Proper- Noun [0,1] [0,2] [0,3] [0,4] [1,2] [1,3] [2,3] [1,4] [2,5] [2,4] [3,4] [4,5] [3,5] [1,5] S 2 , VP S 3 S 1 ,VP, X2 Figure 12.7 Filling the cells of column 5 after reading the word Houston .
Image of page 204
12.3 P ARTIAL P ARSING 205 12.2.3 CKY Parsing The algorithm given in Fig. 12.5 is a recognizer, not a parser; for it to succeed, it simply has to find an S in cell [ 0 , n ] . To turn it into a parser capable of returning all possible parses for a given input, we can make two simple changes to the algorithm: the first change is to augment the entries in the table so that each non-terminal is paired with pointers to the table entries from which it was derived (more or less as shown in Fig. 12.7 ), the second change is to permit multiple versions of the same non-terminal to be entered into the table (again as shown in Fig. 12.7 ). With these changes, the completed table contains all the possible parses for a given input. Re- turning an arbitrary single parse consists of choosing an S from cell [ 0 , n ] and then recursively retrieving its component constituents from the table. Of course, returning all the parses for a given input may incur considerable cost since an exponential number of parses may be associated with a given input. In such cases, returning all the parses will have an unavoidable exponential cost. Looking forward to Chapter 13, we can also think about retrieving the best parse for a given input by further augmenting the table to contain the probabilities of each entry. Re- trieving the most probable parse consists of running a suitably modified version of the Viterbi algorithm from Chapter 10 over the completed parse table.
Image of page 205

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 206
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern