Atn Parsing


Published on

Published in: Technology
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Atn Parsing

  1. 1. Parsing: Features & ATN & Prolog By [email_address]
  2. 2. Feature System <ul><li>CFG – inconvenient for capturing NL. </li></ul><ul><li>Most NL are often agreement restrictions between words and phrases. </li></ul><ul><li>For example: </li></ul><ul><ul><li>*a men (a man) : a indicates single object while the noun men indicates a plural object </li></ul></ul><ul><ul><li>The noun phrase does not satisfy the Number Agreement restriction of English </li></ul></ul><ul><li>Other forms of agreements: </li></ul><ul><ul><li>Subject-verb </li></ul></ul><ul><ul><li>Gender agreement for pronouns </li></ul></ul><ul><ul><li>Restriction between the head of a phrase & the form of its complement </li></ul></ul>
  3. 3. Feature System cont. <ul><li>To handle such phenomena: </li></ul><ul><ul><li>Grammatical formalism is extended to allow constituent to have Features </li></ul></ul><ul><ul><li>Eg: define a feature NUMBER that may take a value of either s (singular) or p (plural). </li></ul></ul>
  4. 4. Augmented Transition Network (ATN) <ul><li>RTN –> add features = ATN </li></ul><ul><li>The features are called Registers </li></ul><ul><li>Constituent structures are created by allowing each network to have a set of registers. </li></ul>
  5. 5. ATN processes <ul><li>When a network is pushed, a new set of registers is created </li></ul><ul><li>As the network is traversed, the registers are set to values by actions associated with each arc. </li></ul><ul><li>When the network is popped, the register are assembled to form a constituent structure, with the CAT slot being the network name </li></ul>
  6. 6. Example ATN Grammar <ul><li>Example Grammar 4.11 (pg 102, Allen) & 4.12 </li></ul>
  7. 7. Grammar & Logic Programming <ul><li>Another popular method is to encode the rules of grammar into logic programming language such as Prolog. </li></ul><ul><li>Prolog uses the same search strategy: depth first top-down parsing algorithm </li></ul><ul><li>Just need to reformulate CFG as clauses in PROLOG </li></ul>
  8. 8. Example <ul><li>S -> NP VP </li></ul><ul><li>S(P1,P3):- np(P1,P2), vp(P2,P3). </li></ul><ul><ul><li>Axiom: “There is an S between position 1 and position 3, if there is a position p2 such that there is an NP between p1 and p2 and a VP between p2 and p3”. </li></ul></ul><ul><li>Add axioms listing the words in the sentence (‘John ate the cat’) by their position: </li></ul><ul><ul><li>word(john,1,2). </li></ul></ul><ul><ul><li>word(ate,2,3). </li></ul></ul><ul><ul><li>word(the,3,4). </li></ul></ul><ul><ul><li>word(cat,4,5). </li></ul></ul>
  9. 9. Example cont. <ul><li>The Lexicon is defined by a set of predicates: </li></ul><ul><ul><li>isart(the). </li></ul></ul><ul><ul><li>isname(john). </li></ul></ul><ul><ul><li>isverb(ate). </li></ul></ul><ul><ul><li>isnoun(cat). </li></ul></ul><ul><ul><li>Ambiguous words would produce multiple assertions – one for each syntactic category to which they belong </li></ul></ul>
  10. 10. Example cont. <ul><li>For each syntactic category, define a predicate that is true only if the word between the two specified positions is of that category, for example: </li></ul><ul><ul><li>n(I,O):- word(Word,I,O), isnoun(Word). </li></ul></ul><ul><ul><li>art(I,O):- word(Word,I,O), isart(Word). </li></ul></ul><ul><ul><li>v(I,O):- word(Word,I,O), isverb(Word). </li></ul></ul><ul><ul><li>name(I,O):- word(Word,I,O), isname(Word). </li></ul></ul>
  11. 11. Prolog-based Parsing <ul><li>Prove that “John ate the cat” is a legal sentence. </li></ul><ul><li>ie. Prove : S(1,5). </li></ul><ul><li>Refer the tracing example in page 74, Allen </li></ul>