Atn Parsing

  • 995 views
Uploaded on

 

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
995
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

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