Your SlideShare is downloading. ×
0
Atn Parsing
Atn Parsing
Atn Parsing
Atn Parsing
Atn Parsing
Atn Parsing
Atn Parsing
Atn Parsing
Atn Parsing
Atn Parsing
Atn Parsing
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Atn Parsing

1,072

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,072
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Parsing: Features & ATN & Prolog By [email_address] http://fsktm.um.edu.my/~rohana
  • 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 &amp; the form of its complement </li></ul></ul>
  • 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. Augmented Transition Network (ATN) <ul><li>RTN –&gt; 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. 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. Example ATN Grammar <ul><li>Example Grammar 4.11 (pg 102, Allen) &amp; 4.12 </li></ul>
  • 7. Grammar &amp; 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. Example <ul><li>S -&gt; 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. 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. 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. 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>

×