1 / 10

Bottom-up Syntactic Recognition and Chart Parsing

Bottom-up Syntactic Recognition and Chart Parsing. Chart Parsing. Well-Formed Substring Table WFST The main idea is the following: Once we have found a component of language it doesn’t have to be found again .

juliet-wise
Download Presentation

Bottom-up Syntactic Recognition and Chart Parsing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Bottom-up Syntactic Recognition and Chart Parsing

  2. Chart Parsing Well-Formed Substring Table WFST • The main idea is the following: • Once we have found a component of language it doesn’t have to be found again. • A WFST is a mechanism enabling a parser to keep record of structures it has already found.

  3. Syntactic ambiguity S VP NP NP PP NP Vt Pron Det Noun Prop Det Noun They hear the report on the travel

  4. Syntactic ambiguity S VP NP PP NP NP Vt Pron Det Noun Prop Det Noun They hear the report on the travel

  5. The active chart … ? VP  vt NP S needing VP NP vt det noun they hear the report … 0 1 2 3 4 We can represent the chart as a list of structures of the form: <0,1, they.>, <0,1, NP  they.>, <0,1,SNP.VP>, …

  6. The fundamental rule of chart parsing Fundamental Rule If the chart contains edges: <i, j, AW1. B W2> and <j, k, BW3.> where A and B are categories and W1, W2 and W3 are (possible empty) sequences of categories or words, then add edge: <i, k, AW1 B. W2> to the chart.

  7. Rule invocation Bottom-up Rule If you are adding edge <i, j, CW1. > to the chart, then for every rule in the grammar of the form B C W2, add and edge <i, i, B.C W2> to the chart.

  8. Prolog implementation of chart parsing Edges edge(Start, Finish, Label, ToFind, Found). Initial Chart start_chart(V0, V0,[]). start_chart(V0, Vn, [Word| Words]) :- V1 is V0+1, foreach(word(Category,Word), add_edge(V0, V1, Category, [], [Word, Category])), start_chart(V1, Vn, Words).

  9. Prolog implementation of chart parsing add_edge(V0, V1, Category, Categories, Parse) :- edge(V0, V1, Category, Categories, Parse), !. add_edge(V1, V2, Category1, [], Parse) :- asserta(edge(V1, V2, Category1, [], Parse), foreach(rule(Category2, [Category1|Categories]), add_edge(V1, V1, Category2, [Category1|Categories], [Category2])). Fundamental Rule foreach(edge(V0, V1, Category1, [Category1|Categories], Parses), add_edge(V0, V2, Category2, Categories, [Parse | Parses])). add_edge(V0, V1, Category1, [Cagegory2 | Categories], Parses) :- asserta(edge(V0, V1, Category1, [Category2 | Categories] , Parses)), foreach(edge(V1, V2, Category2, [], Parse), add_edge(V0, V2, Category1, Categories, [Parse | Parses])).

  10. Prolog implementation of chart parsing test test(String) :- V0 is 1, Start_chart(V0, Vn, String), foreach(edge(V0, Vn, Symbol, [], Parse), write(Parse)), retractall(edge(_,_,_,_,_)).

More Related