Computer Science 355: Artificial Intelligence

beadkennelΤεχνίτη Νοημοσύνη και Ρομποτική

15 Οκτ 2013 (πριν από 3 χρόνια και 11 μήνες)

67 εμφανίσεις


Problem Set Page
1

of
4

Artificial Intelligence

Machine Learning and
NLP

Due Date:
Fri, 5/3/13


1.


(2
0

points)
Xia loves to cook, but while some of her attempts meet rave reviews from her
friends, others have been disasters. She would like to be able to anticipate whether or not

a
given recipe will work at the next gathering, so she wants to train a classifier that will tell her
whether or not to even try a new one.


a.

Explain what
Xia
would use as
her

training set
.

b.

Explain how
Xia
would make use of a
test set
.

c.

What would be an exa
mple of
noise

in this problem?

d.

How might
over
-
fitting

change the performance of
her

system once
s
he puts it in
action?

e.

What would be a
false positive

in this case? A
false negative
?

f.

What would high
precision

mean?

g.

What would high
recall

mean?


2.

(
10 points
)

Given the following CFG for English syntax:


S

→ NP VP

NP

→ DET ADJ N

VP

→ V NP

NP

→ N

VP

→ V NP PP

NP

→ PRO

PP

→ P NP

PRO

→ he

V

→ took

N

→ hand

P

→ in

N

→ sword

DET

→ his

ADJ

→ vorpal


Draw a bottom
-
up parsing tree of this
line:
:


He took his vorpal

sword in hand


(see other side)




Problem Set Page
2

of
4

3.

(
10 points
) Trace the top
-
down parsing of that sentence from the last question using the
same CFG rules and illustrating the trace as a tree of states where the successors of a state are
the sequences of terminals

and non
-
terminals

that result from all of the possible expansions
of the
left
-
most

non
-
terminal symbol.
Explore possible expansions in the order they are
listed in the grammar

and assume a DFS approach
.
For example:



The result should be a larger tree than the bottom
-
up parse tree because it will include
abandoned paths.


For the next few questions,
consider the following RTN and CFG:




NP → DET NP1

For both:

NP1 → ADJ N PPS

NP1 → ADJ N

adjectives (ADJ): big, black, scary
, thick
, leather

PPS → PP

determiners (DET): a, many, his

PPS → PP PPS

nouns (N): dog, teeth, collar, neck

PP → P NP

prepositions (P): with, around

S


B潢⁰琠乐

S


Bob pet DET A
DJ N

S


Bob pet N

S


Bob pet
PRO

S


B潢⁰琠t桥⁁ J⁎




B潢⁰琠t桥⁦畲ry N




B潢⁰琠t桥⁦畲ry cat


Problem Set Page
3

of
4

4.


(
10

points
) Indicate which grammar(s) can handle each of the following noun phrases:


a.

a dog

b.

a big dog

c.

a big dog with teeth

d.

a big black dog

e.

a big black scary dog

f.

a big black
scary dog with many teeth

g.

a big dog with a
leather
collar around his
thick
neck


5.

(
10

points
) What
similarities and
differences between the two did you discover?

Be specific
in comparing and contrasting what they can cover and what they do not.


Now that
we’ve talked about how to do some of these tasks
using NLP
, you’re going to
experiment with

how we can “cheat.”
Most chatbot programs use a pattern
-
matching rule that
looks for sentences that fit a certain description in order to make a response that soun
ds
appropriate.
For the next few questions, find the links from the course website.


Evaluate a chatbot
program.

Go to Alice.org, or do a Google se
arch for “Eliza” or “chatbot.”
Have a few conversations with the chatbot
and record two cases each of:


a.

Re
sponses using pattern
-
matching rules where the response came out very well.


b.

Responses using pattern
-
matching rules where the response was inappropriate

(meaning the pattern
-
matching goofed, and therefore the answer doesn’t work in
context)
.


6.

(
10

points) For each of the four sentences above, sketch what you believe the pattern
-
matching rule underlying the response was. Use blanks to indicate parts of the phrase that
are captured and repeated, numbered if necessary. For example:


I hate ______



What’s wrong with _____ ?


__
1
__ are __
2
__



Why do you think that ___
1
__ are __
2
__?



On th
e course website is linked an applet that implements a very simple Eliza program. When
you click on the “Show Rules” button, you see the pattern matching
rules it obeys. The handout
from class shows how the patterns are established.


7.

(
20

points)
Create a

text
file in an editor of your choice,
starting with a cut
-
and
-
paste of
Eliza’s rules and
adding at minimum 15 more rules.
Ha
ve the following kinds of r
ules
re
presented:


a.

Give Eliza three ways to respond supportively to something the patient has said about
himself/herself.

b.

Have Eliza respond in two different ways to something the patient says about her
(about Eliza).

c.

Have at least three rules that use two

or more variables.


Problem Set Page
4

of
4

d.

Have at least three rules that use a variable that matches more than one word.

e.

Have at least three rules that use a wildcard (*) symbol to ignore part of the sentence.


These rules

cannot overlap (one rule cannot count
for more than one
requirement
). Please
include in your paper submission of the homework five separate groupings that are labeled as
to what requirement they satisfy.


Copy and paste these rules into the Rules buffer in the applet to test them.


8.

(5 points)

Capture
and submit
a good conversatio
n in which each one of your rules is used at
least once.


9.

(5 points) Capture

and submit
a bad one of at least 10 lines showing some of your rules
going awry.