









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










Artificial Intelligence Programming
Department of Computer ScienceUniversity of San Francisco
Department of Computer Science — University of San Francisco – p. 1/
-^ Logic provides one answer to the question of
how
to say things.
-^ It does not tell us
what
to say.
-^ Typically, this is the hard part. •^ We want to give our agent enough knowledge to solve all of theproblems we are interested in. •^ The process of building a knowledge base is referred to as^ knowledge engineering
◦^ Many of the same principles as software engineering.
Department of Computer Science — University of San Francisco – p. 2/
-^ An ontology is a vocabulary that describes all of the objects ofinterest in the domain and the relations between them.
◦^ All of the relevant knowledge about a problem we areinterested in.
-^ Ontolgies allow knowledge about a domain to be sharedbetween agents (including humans). •^ This can allow knowledge to be reused more easily. •^ Allows an agent to perform inference with its current knowledge.
Department of Computer Science — University of San Francisco – p. 4/
-^ An ontology consists of:
◦^ A set of
concepts
or^
classes
◦^ P rof essor
(Brooks
x P rof essor
(x)
U SF Employee
(x)
-^ Instances of these classes. •^ Relations between classes of objects, sometimes called
slots
or^ properties
or^
roles
◦^ Salary
(Brooks,
, N ame
(Brooks,
“Chris
-^ Restrictions on slots (sometimes called
facets
x, y P rof essor
(x)
∧^ Salary
(x, y
y <
$1000 Department of Computer Science — University of San Francisco – p. 5/
-^ Logic is a very powerful representation language, but it can bedifficult for humans to work with. •^ In addition, the lack of structure between sentences in a KB canmake inference difficult. •^ A
semantic network
is a way to graphically represent and
reason about some logical concepts.
Department of Computer Science — University of San Francisco – p. 7/
-^ SisterOf
(M ary, John
-^ F emale
(M ary
xF emale
(x)
P erson
(x)
-^ M ale
(John
xM ale
(x)
P erson
(x)
xP erson
(x)
M ammal
(x)
xP erson
(x)
Def aultN umberOf Legs
(x,
-^ legs
(John,
Department of Computer Science — University of San Francisco – p. 8/
-^ Protege is a Java-based graphical tool for constructingontologies. •^ Has a rich set of plugins for performing inference andvisualizing data. •^ Can export data in RDF and OWL for use with the SemanticWeb.
Department of Computer Science — University of San Francisco – p. 10/
-^ Let’s make a simple ontology to describe the USF CSdepartment. •^ We begin by asking
competency questions
questions weâ ˘
A ´Zd like our KB to be able to answer.
◦^ Who is taking CS662? ◦^ Which professors teach classes on Monday? ◦^ How many students are taking both CS662 and CS601? ◦^ What classes should one take before taking CS662? ◦^ Which professors assign the most work?
Department of Computer Science — University of San Francisco – p. 11/
-^ Now we can start to fill in the slots. •^ Letâ ˘
A ´Zs start with Student ◦^ Students have a Name, an ID, and some courses theyâ ˘
A ´Zre
taking. ◦ Letâ ˘
A ´Zs also add a â ˘
A ´Zyearâ ˘
A ´Z slot to Undergrads- this
can be Freshman, Sophomore,Junior, or Senior
-^ Next, we can do Professors.
◦^ Professors have a name, a salary, and some courses theyteach.^ •
Wait! Maybe name should be in person instead of studentand professor. ◦^ Then do course - course should have an â ˘
A ´Zinverse
slotâ ˘
A ´Zfor taughtby and enrolls
Department of Computer Science — University of San Francisco – p. 13/
-^ Now we can begin to populate our knowledge base withinstances of the classes weâ ˘
A ´Zve created.
-^ To begin, add â ˘
A ´ZBrooksâ ˘
A ´Z as a Professor with salary
$100,000 (I wish!) • We can create a course object on the fly to represent CS662. • Next, create a student (use your own name).
Department of Computer Science — University of San Francisco – p. 14/
-^ The query pane lets us create, save and retrieve queries •^ We can specify either AND or OR. •^ Try finding all students enrolled in CS662.
Department of Computer Science — University of San Francisco – p. 16/
-^ A KB is only as useful as the data thatâ ˘
A ´Zs in it.
-^ Add instances for Wolber and Parr. •^ Add courses CS601, CS690, and CS112. •^ Add more students. •^ Add a class called Sysadmins and populate it with Alex. •^ Finally, add a class called RA - it should have USFEmployeeand GradStudent as superclasses.
Department of Computer Science — University of San Francisco – p. 17/