Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS460/IT632 Natural Language Processing/Language Technology for the Web Lecture 17 (14/03/06) Prof. Pushpak Bhattacharyya IIT Bombay Formulation of Grammar.

Similar presentations


Presentation on theme: "CS460/IT632 Natural Language Processing/Language Technology for the Web Lecture 17 (14/03/06) Prof. Pushpak Bhattacharyya IIT Bombay Formulation of Grammar."— Presentation transcript:

1 CS460/IT632 Natural Language Processing/Language Technology for the Web Lecture 17 (14/03/06) Prof. Pushpak Bhattacharyya IIT Bombay Formulation of Grammar And Parsing

2 14/03/06Prof. Pushpak Bhattacharyya, IIT Bombay 2 Formulation of Grammar Form a grammar which accepts - 1.Joe is reading the book. 2.Joe has won a letter. 3.Joe has to win. 4.Joe will have the letter. 5.The letter in the book was red. 6.Joe could have had one.

3 14/03/06Prof. Pushpak Bhattacharyya, IIT Bombay 3 Formulation of Grammar (Contd.1) And rejects – 1*. Joe has reading the book. 2*. Joe had win. 3*. Joe winning. 4*. Joe will had the letter. 5*. The book was won by Joe. 6*. Joe can have having one.

4 14/03/06Prof. Pushpak Bhattacharyya, IIT Bombay 4 Solution (Considering NP) S  NP VP NP  Joe | the letter in the box | a letter | one NP  PN (proper noun) | DT N | NP PP | NQ (quantitative noun) PP  prep NP N  letter | box

5 14/03/06Prof. Pushpak Bhattacharyya, IIT Bombay 5 Solution (Contd.) But the production rule NP  NP PP is left recursion. So we make it NP  DT N PP

6 14/03/06Prof. Pushpak Bhattacharyya, IIT Bombay 6 Verb Forms Forming VP production rules require insight into verb forms – 1.VB – base form (bathe, go) 2.VBS – S form (bathes, goes) 3.VBD – D form, past tense (bathed, went) 4.VBG – -ing form, present participle (bathing, going) 5.VBN – N form, past participle (bathed, gone)

7 14/03/06Prof. Pushpak Bhattacharyya, IIT Bombay 7 Solution (Considering VP) VP  is VBG NP | has VBN NP | has to VB | will VB NP | was AP (adjective phrase) | could have VBN NP AP  JJ (adjective)

8 14/03/06Prof. Pushpak Bhattacharyya, IIT Bombay 8 Solution (Contd. 1) Introducing new non-terminals – AM_IS_WAS  am | is | was HAS_HAD  has | had MODAL  will | would | shall | should | can | could | may | might | must | ought to IS_WAS  is | was

9 14/03/06Prof. Pushpak Bhattacharyya, IIT Bombay 9 Solution (Contd. 2) The VP rules are now changed as follows – VP  AM_IS_WAS VBG NP | HAS_HAD VBN NP | HAS_HAD to VB | MODAL VB NP | IS_WAS AP | MODAL have VBN NP Some more rules of VP can be – VP  HAS_HAD been VBG NP | MODAL have been VBG NP

10 14/03/06Prof. Pushpak Bhattacharyya, IIT Bombay 10 Top-down Parsing for Sentence 1 1 Joe 2 is 3 reading 4 the 5 book 6 TopdownbackupAction 1.((S) 1)-- 2.((NP VP) 1)-- 3.((PN VP) 1)bkup exists- 4.((VP) 2)-Joe 5.((IS_WAS VBG NP) 2)bkup exists- 6.((VBG NP) 3)-is 7.((NP) 4)-reading 8.((PN) 4)bkup exists-

11 14/03/06Prof. Pushpak Bhattacharyya, IIT Bombay 11 Bottom-up Chart Parsing for Sentence 3 Joehastowin 12345 NP  PN  VP  HAS_HAD  VBN NPVP  HAS_HAD to  VBVP  HAS_HAD to VB  S  NP  VPVP  HAS_HAD  to VB


Download ppt "CS460/IT632 Natural Language Processing/Language Technology for the Web Lecture 17 (14/03/06) Prof. Pushpak Bhattacharyya IIT Bombay Formulation of Grammar."

Similar presentations


Ads by Google