You are on page 1of 2

TCB3343 Artificial Intelligence

Exercise 6: Natural Language Processing


1.

a.

Consider the Context Free Grammar (CFG) in FIGURE Q1:


S NP VP
NP NOUN | ART NOUN
NP ART NP | NOUN CONJ NP
VP VERB | VERB NP
ART a | the
NOUN man | dog | men
VERB likes | bites | like
FIGURE Q1
Draw the parse tree for the following sentences:

b.

i.

The dog bites a man.

ii.

Men like the dog.

Write the extension of the grammar shown in part (a) to cater for each of the
following sentence, and then draw the new parse tree based on the extended
grammar.
i.

The big dog bites the man.

ii.

Syamilla likes the boy.

TCB3343 Artificial Intelligence / Sept 2014

2.

Consider the Context Free Grammar (CFG) in FIGURE Q2:


S

NP VP

NP

NOUN | PRONOUN | ADJ NOUN | DET NOUN | DET NOUN PP

PP

PREP NP

VP

VERB NP

DET the a
VERB likes drives
NOUN man girls boy coffee | Ferrari
ADJ

hot | beautiful

PREP with
PRONOUN he | she
FIGURE Q2
Draw the parse tree for the following sentences:

3.

i.

She drives Ferrari.

ii.

He likes hot coffee.

iii.

The man with the Ferrari loves beautiful girls.

Consider the Context Sensitive Grammar (CSG) in FIGURE Q3:


S NP

VP, NP PP

NP ART

NS | ART

NP

VP VS NP | VP NP
PP PREP NP
PREP in | on
ART the | a
NS man | car
NP men
VS drives
VP drive
FIGURE Q3
Draw the parse tree for the following sentences:
i.

A man drives the car.

ii.

The men in the car.

TCB3343 Artificial Intelligence / Sept 2014

You might also like