jurafsky&martin_3rdEd_17 (1).pdf

The a cost function f n is used to efficiently guide

Info icon This preview shows pages 234–236. Sign up to view the full content.

The A* cost function, f ( n ) , is used to efficiently guide the search to a solution. The f -cost has two components: g ( n ) , the exact cost of the partial solution repre- sented by the state n , and h ( n ) a heuristic approximation of the cost of a solution that makes use of n . When h ( n ) satisfies the criteria of not overestimating the actual cost, A* will find an optimal solution. Not surprisingly, the closer the heuristic can get to the actual cost, the more effective A* is at finding a solution without having to explore a significant portion of the solution space. When applied to parsing, search states correspond to edges representing com- pleted constituents. As with the PCKY algorithm, edges specify a constituent’s start and end positions, its grammatical category, and its f -cost. Here, the g component represents the current cost of an edge and the h component represents an estimate of the cost to complete a derivation that makes use of that edge. The use of A* for phrase structure parsing originated with (Klein and Manning, 2003a) , while the CCG approach presented here is based on (Lewis and Steedman, 2014) . Using information from a supertagger, an agenda and a parse table are initial- ized with states representing all the possible lexical categories for each word in the input, along with their f -costs. The main loop removes the lowest cost edge from the agenda and tests to see if it is a complete derivation. If it reflects a complete derivation it is selected as the best solution and the loop terminates. Otherwise, new states based on the applicable CCG rules are generated, assigned costs, and entered into the agenda to await further processing. The loop continues until a complete derivation is discovered, or the agenda is exhausted, indicating a failed parse. The algorithm is given in Fig. 13.11 .
Image of page 234

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

13.7 P ROBABILISTIC CCG P ARSING 235 function CCG-AS TAR -P ARSE ( words ) returns table or failure supertags S UPERTAGGER ( words ) for i from 1 to L ENGTH ( words ) do for all { A | ( words [ i ] , A , score ) 2 supertags } edge M AKE E DGE ( i - 1, i , A , score ) table I NSERT E DGE ( table , edge ) agenda I NSERT E DGE ( agenda , edge ) loop do if E MPTY ?( agenda ) return failure current P OP ( agenda ) if C OMPLETED P ARSE ?( current ) return table table I NSERT E DGE ( chart , edge ) for each rule in A PPLICABLE R ULES ( edge ) do successor A PPLY ( rule , edge ) if successor not 2 in agenda or chart agenda I NSERT E DGE ( agenda , successor ) else if successor 2 agenda with higher cost agenda R EPLACE E DGE ( agenda , successor ) Figure 13.11 A*-based CCG parsing. Heuristic Functions Before we can define a heuristic function for our A* search, we need to decide how to assess the quality of CCG derivations. For the generic PCFG model, we defined the probability of a tree as the product of the probability of the rules that made up the tree. Given CCG’s lexical nature, we’ll make the simplifying assumption that the probability of a CCG derivation is just the product of the probability of the supertags assigned to the words in the derivation, ignoring the rules used in the the derivation.
Image of page 235
Image of page 236
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