cs 4100 artificial intelligence prof. c. hafner class notes feb 23, 2012

34
CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes Feb 23, 2012

Upload: natalie-young

Post on 25-Dec-2015

217 views

Category:

Documents


1 download

TRANSCRIPT

CS 4100 Artificial Intelligence

Prof. C. HafnerClass Notes Feb 23, 2012

AI Term Projects• Form teams of 3 or (will accept 4 but not 5)• Define a basic ontology of objects, event, and properties/roles

for some real world domain with planning issues• Implement your ontology in the Protégé Frames Editor as far as

possible (note limitations)• Define plan operators using Partial Order Planning or Situation

Calculus (your choice)• Define at least two different planning problems in your domain• Show how your chosen plan algorithm would derive plans,

discuss strengths and weaknesses of the approach (on paper)• Consider implementing a POP or resolution planner and running

some small experiments. You may try the java-based Protégé API to use Protégé as your database editor/server.

• Final papers due Thursday April 12 in class• Student presentations April 12 and 17

AI Term Projects (cont)• Planning domains (multiple goals or complex end-goal)

– Travel/vacation planning– MBTA train/subway ride– Make up a game or use a (simplified) existing game (must be

plan oriented, not primarily physical co-ord)– Mechanical assembly planning -- extension of blocks world

ideas– Look in AI publications for planning applications

– Not an abstract problem such as checkers, chess, go since lacks a real world ontology

Major elements of ontologies

• Taxonomy -- “isa” hierarchy • Partonomy -- “is-part” hierarchy• Role relations -- has-a relationships

• Examples:– The concept of a book– The concept of a university– The concept of a wine (READ: Ontology 101 paper)

Protégé Resources

• Protégé home:http://protege.stanford.edu/

• Protege “Frames” Download URL: http://protege.stanford.edu/download/protege/3.4/installanywhere/ Web_Installers/

• Protege tutorial URL: http://protege.stanford.edu/doc/tutorial/get_started/table_of_content.html

Ontology Design• Ontologies define entities, events and relations as top-

level categories

• Every ontology includes a taxonomy (a tangled tree of ISA-linked concepts)

• A true ontology also defines the structure of each concept (its slots), consisting of its properties, parts and roles (whose fillers are also concepts)

• Some ontologies also include logical rules of conceptual syntax (how to form more complex concepts out of more primitive ones using various operators. Example: restrictive modification such as middle-aged adult)

Reasoning with Ontologies

• “isa” and “ispart” relationships are transitive– If X isa Y and Y isa Z then

X isa Z – If X ispart Y and Y ispart Z then

X ispart Z• Inheritance of properties

– If Z hasa (part or role) Y and X isa Z thenX hasa Y

• Examples from the animal world– Human isa primate, primate isa mammal– Primate haspart arm, arm haspart hand– Crime hasa victim, murder isa crime

Entity classesEx: person, number, chairchair has a seat partperson has a sex property

Event classesEx: an election, a concert, a murderevents have time propertiesphysical events have location and time

Relation classesEx: employment, marriage, above(Traditional) marriage has roles: husband, wife

filler class of husband = male humanfiller class of wife = female human

The goal of concept-oriented ontology design: formally represent meaning so a computer can manipulate it.

Seven steps to creating an ontology

1. Determine domain and scope2. Consider re-using existing ontologies3. Enumerate important concepts4. Define the classes and class hierarchy (taxonomy)5. Define the properties, parts and roles (slots)6. Define the facets of the slots7. Create instances

Wine example from Noy & McGuinness, Ontology 101

Determine Domain and Scope

• What is the domain that the ontology will cover?

• For what we are going to use the ontology?• For what types of questions the information in

the ontology should provide answers (competency questions)?

determinescope

considerreuse

enumerateterms

defineclasses

defineproperties

defineconstraints

createinstances

Thanks to: Paula Matuszek for slides modified from: Natasha Noy, Protege.stanford.edu/amia2003/AMIA2003Tutorial.ppt

Competency Questions

Which wine characteristics should I consider when choosing a wine?Is Bordeaux a red or white wine?Does Cabernet Sauvignon go well with seafood?What is the best choice of wine for grilled meat?Which characteristics of a wine affect its appropriateness for a dish?Does a flavor or body of a specific wine change with vintage year?What were good vintages for Napa Zinfandel?

Consider Reuse

• Why reuse other ontologies?– to save the effort– to interact with the tools that use other ontologies– to use ontologies that have been validated

through use in applications

determinescope

considerreuse

enumerateterms

defineclasses

defineproperties

defineconstraints

createinstances

What to Reuse?

• Upper ontologies– IEEE Standard Upper Ontology (suo.ieee.org)– Cyc (www.cyc.com)

• General ontologies– DMOZ (www.dmoz.org)– WordNet (www.cogsci.princeton.edu/~wn/)

• Domain-specific ontologies– UMLS Semantic Net– GO (Gene Ontology) (www.geneontology.org)

Enumerate Important Terms (Concepts)

• What are the concepts we need to talk about?• What are the properties of these concepts?• What do we want to say about the concepts?

considerreuse

determinescope

enumerateterms

defineclasses

defineproperties

defineconstraints

createinstances

Enumerating Terms - The Wine Ontology

• wine, grape, winery, location, • wine color, wine body, wine flavor, sugar content• white wine, red wine, Bordeaux wine• food, seafood, fish, meat, vegetables, cheese

Define Classes and the Class Hierarchy

• A class is a concept in the domain– Class/subclass structure of wines– Class/subclass structure of wineries

• A class is a collection of elements with similar properties

• Instances of classes– a glass of California wine you’ll have for lunch

considerreuse

determinescope

defineclasses

defineproperties

defineconstraints

createinstances

enumerateterms

Levels in the Hierarchy

Middlelevel

Toplevel

Bottomlevel

Modes of Development

• top-down – define the most general concepts first and then specialize them

• bottom-up – define the most specific concepts and then organize them in more general classes

• combination – define the more salient concepts first and then generalize and specialize them

Documentation

• Classes (and slots) usually have documentation– Describing the class in natural language– Listing domain assumptions relevant to the class

definition– Listing synonyms

• Documenting classes and slots is as important as documenting computer code!

Define Properties of Classes – Slots

• Slots in a class definition describe attributes of instances of the class and relations to other instances

Each wine will have color, sugar content, producer, etc.

considerreuse

determinescope

defineconstraints

createinstances

enumerateterms

defineclasses

defineproperties

Properties Parts and Roles (Slots)• Types:

– “intrinsic” properties: flavor and color of wine– “extrinsic” properties: name and price of wine– parts: ingredients in a dish– roles: producer of the wine (winery)

• Simple and complex properties– simple properties (attributes): contain primitive

values (strings, numbers)– complex properties: contain (or point to) other

concepts (e.g., a winery instance)

Slots for the Class Wine

Slot and Class Inheritance

• A subclass inherits all the slots from the superclassIf a wine has a name and flavor, a red wine also has a

name and flavor• If a class has multiple superclasses, it inherits slots

from all of themPort is both a dessert wine and a red wine. It inherits

“sugar content: high” from the former and “color:red” from the latter

Property Constraints

• Property constraints (facets) describe or limit the set of possible values for a slot

The name slot of a wine has a type facet of stringThe producer slot has a type facet instance of WineryThe location slot of a winery has a cardinality facet of 1

considerreuse

determinescope

createinstances

enumerateterms

defineclasses

defineconstraints

defineproperties

Facets for Slots at the Wine Class

Common Facets

• Slot cardinality – the number of values a slot has• Slot value type – the data type of values a slot

has: string, number, instance of <class>, etc.• Minimum and maximum value – a range of values

slot whose data type is numeric• Default value – the value a slot has for an instance

unless a value explicitly specified

Common Facets: Slot Cardinality in Protege

• Cardinality– Cardinality N means that the slot must have N values

• Minimum cardinality– Minimum cardinality 1 means that the slot must have a value

(required)– Minimum cardinality 0 means that the slot value is optional

• Maximum cardinality– Maximum cardinality 1 means that the slot can have at most one

value (single-valued slot)– Maximum cardinality greater than 1 means that the slot can have

more than one value (multiple-valued slot)

Common Facets: Value Type

• String: a string of characters (“Château Lafite”)• Number: an integer or a float (15, 4.5)• Boolean: a true/false flag• Enumerated type: a list of specific allowed values

(high, medium, low)• Complex type: an instance of another class

– Specify the class to which the instances belongThe Wine class is the value type for the slot

“produces” at the Winery class

Domain and Range of Slot

• Domain of a slot – the class (or classes) that have the slot– More precisely: class (or classes) instances of

which have the slot• Range of a slot – the class (or classes) to which

slot values belong – i.e. the value type

Facets and Class Inheritance• A subclass inherits all the slots from the

superclass• A subclass can override the facets to “narrow” the

list of allowed values– Make the cardinality range smaller– Replace a class in the range with a subclass

Wine

Frenchwine

Winery

Frenchwinery

is-a is-a

producer

producer

Create Instances

• Create an instance of a class– The class becomes a direct type of the instance– Any superclass of the direct type is a type of the

instance• Assign slot values for the instance

– Slot values must conform to the facet constraints– Knowledge-acquisition tools often check that

considerreuse

determinescope

createinstances

enumerateterms

defineclasses

defineproperties

defineconstraints

Creating an Instance: Example

Thanks to: Paula Matuszek for slides modified from: Natasha Noy, Protege.stanford.edu/amia2003/AMIA2003Tutorial.ppt

The semantic web•Goal: to put information with computer-processable meaning (semantics) on the web

•E-commerce motivation and industry supportWould like to describe companies, products (entities), and transactions (events) to automate e-commerce (especially B2B e-commerce)

•Extends the web through the use of:•Standards•Markup languages•Tools

Steps in creating the Semantic Web

XML – eXtensible Markup Language

RDF – Resource Description Framework

OWL – Ontology Web Language

Standards proposed by W3C: World Wide Web Consortium