Introduction to Knowledge Representation Marti Hearst SIMS 202: Information Organization and...

29
Introduction to Knowledge Introduction to Knowledge Representation Representation Marti Hearst Marti Hearst SIMS 202: Information SIMS 202: Information Organization and Retrieval Organization and Retrieval Lecture 6, Sept 10, 1998 Lecture 6, Sept 10, 1998

Transcript of Introduction to Knowledge Representation Marti Hearst SIMS 202: Information Organization and...

Introduction to Knowledge Introduction to Knowledge RepresentationRepresentation

Marti HearstMarti Hearst

SIMS 202: Information SIMS 202: Information Organization and RetrievalOrganization and Retrieval

Lecture 6, Sept 10, 1998Lecture 6, Sept 10, 1998

TodayToday

What is a symbol?What is a symbol? Semantics: the meanings of symbolsSemantics: the meanings of symbols Creating OntologiesCreating Ontologies Objects, Properties, and RelationsObjects, Properties, and Relations

References:References:

Chapter 1 of Chapter 1 of Introduction to Knowledge SystemsIntroduction to Knowledge Systems by Mark by Mark Stefik.Stefik.

Chapter 8 of Chapter 8 of Artificial Intelligence, A Modern ApproachArtificial Intelligence, A Modern Approach by by Stuart Russell and Peter NorvigStuart Russell and Peter Norvig

What is a symbol?What is a symbol?

From Merriam-Webster’s Collegiate:From Merriam-Webster’s Collegiate: Something that stands for or suggests something Something that stands for or suggests something

else.else. An arbitrary conventional sign used in writing or An arbitrary conventional sign used in writing or

printing to represent:printing to represent: operationsoperations quantitiesquantities elementselements relationsrelations qualitiesqualities

What is meant by What is meant by sign sign and and representrepresent??

Recognizing SymbolsRecognizing Symbols

What is/are this/these symbol(s)?What is/are this/these symbol(s)? Two overlapping squares? Two overlapping squares? Eight horizontal and eight vertical lines? Eight horizontal and eight vertical lines?

Designation and Designation and RepresentationRepresentation What does it mean to represent something?What does it mean to represent something? Identify the following:Identify the following:

symbolssymbols contextcontext observer observer

Representation is the association of Representation is the association of symbols with conceptual objects or ideas in symbols with conceptual objects or ideas in a given context.a given context.

The observer sets up a correspondence The observer sets up a correspondence between the symbols and the meanings.between the symbols and the meanings.

Representation with Representation with SymbolsSymbols

Kailin threw the ball to Juno.

Kailin throw event

Juno

a ball

did-action

thrower

thrown-to

object-thrown

Symbols and LanguageSymbols and Language

Abstract concepts are difficult to Abstract concepts are difficult to express in a computer.express in a computer.

Combinations of abstract concepts are Combinations of abstract concepts are even more difficult to express:even more difficult to express: timetime shades of meaningshades of meaning social and psychological conceptssocial and psychological concepts causal relationshipscausal relationships

Symbols and LanguageSymbols and Language

The Dog.

Symbols and LanguageSymbols and Language

The Dog.

The dog cavorts.

The dog cavorted.

The picture doesn’t really show the manner or tense.

Symbols and LanguageSymbols and Language

The man.

The man walks.

Symbols and LanguageSymbols and Language

The man walks the cavorting dog.

So far, we can sort of show the meaning in pictures.

Symbols and LanguageSymbols and Language

As the man walks the cavorting dog, thoughtsarrive unbidden of the previous spring, so unlikethis one, in which walking was marching anddogs were baleful sentinals outside unjust halls.

What is the relation between the symbols and the meaning?

Symbols and LanguageSymbols and Language

Language only hints at meaning.Language only hints at meaning. Most meaning of text lies within our Most meaning of text lies within our

minds and common understanding.minds and common understanding. ““How much is that doggy in the window?”How much is that doggy in the window?”

how much: social system of barter and trade (not the how much: social system of barter and trade (not the size of the dog)size of the dog)

““doggy” implies childlike, plaintive, probably cannot doggy” implies childlike, plaintive, probably cannot do the purchasing on their owndo the purchasing on their own

““in the window” implies behind a store window, not in the window” implies behind a store window, not really inside a window, requires notion of window really inside a window, requires notion of window shoppingshopping

Setting up Correspondences Setting up Correspondences between Symbols and between Symbols and MeaningMeaning Consider made-up languagesConsider made-up languages

Codes used by espionage agentsCodes used by espionage agents ““Pope” means a particular piece of microfilmPope” means a particular piece of microfilm ““Denver” indicates a particular mailboxDenver” indicates a particular mailbox

People remember the “gist” instead People remember the “gist” instead of the actual words used.of the actual words used. This implies the actual words used are not This implies the actual words used are not

very salient; what matters is the meaning.very salient; what matters is the meaning.

Recognizing SymbolsRecognizing Symbols

The marks that constitute a symbol The marks that constitute a symbol depend on the conventions for depend on the conventions for recognizing the symbol.recognizing the symbol.

A recognizer typically has an A recognizer typically has an associated alphabet or set of symbols:associated alphabet or set of symbols: Token: an individual instance of a symbolToken: an individual instance of a symbol Type: a class of symbolsType: a class of symbols

Examples?Examples?

The Role of ContextThe Role of Context

The concept associated with the The concept associated with the symbol symbol 2121 means different things in means different things in different contexts.different contexts. Examples?Examples?

The question “Is there any salt?”The question “Is there any salt?” Asked of a waiter at a restaurant.Asked of a waiter at a restaurant. Asked of an environmental scientist at Asked of an environmental scientist at

work.work.

Semantics: The Meaning of Semantics: The Meaning of SymbolsSymbols

Semantics versus SyntaxSemantics versus Syntax Meaning versus RepresentationMeaning versus Representation

What a person’s name is versus who they What a person’s name is versus who they are.are.

A rose by any other name...A rose by any other name...

What the computer program “looks like” What the computer program “looks like” versus what it actually does.versus what it actually does.

SemanticsSemantics

Semantics: assigning meanings to Semantics: assigning meanings to symbols and expressions.symbols and expressions. Usually involves defining:Usually involves defining:

objectsobjects properties of objectsproperties of objects relations between objectsrelations between objects

More detailed versions include (among others)More detailed versions include (among others) eventsevents timetime placesplaces measurements (quantities)measurements (quantities)

OntologyOntology

From Merriam-Webster’s Collegiate:From Merriam-Webster’s Collegiate: A branch of metaphysics concerned with the nature and A branch of metaphysics concerned with the nature and

relations of being.relations of being. A particular theory about the nature of being or the A particular theory about the nature of being or the

kinds of existence.kinds of existence. More prosaically:More prosaically:

A carving up of the world’s meanings.A carving up of the world’s meanings. Determine what things exist, but not how they inter-Determine what things exist, but not how they inter-

relate.relate. Related terms:Related terms:

taxonomy, dictionary, category structuretaxonomy, dictionary, category structure

Knowledge Engineering Knowledge Engineering StepsSteps

Decide what to talk aboutDecide what to talk about Decide on a vocabulary of predicates, functions, Decide on a vocabulary of predicates, functions,

and constantsand constants Encode general knowledge about the domainEncode general knowledge about the domain Artificial Intelligence vs Cataloging:Artificial Intelligence vs Cataloging:

AI goal: allow computer programs to AI goal: allow computer programs to reasonreason about the about the objects and relationsobjects and relations

Cataloging: Cataloging: organizeorganize the objects and relations for use the objects and relations for use by humansby humans

AI is more ambitious and more difficultAI is more ambitious and more difficult We aren’t covering the reasoning part here.We aren’t covering the reasoning part here.

Try some examplesTry some examples

Let’s defineLet’s define Types of ObjectsTypes of Objects Types of Properties of ObjectsTypes of Properties of Objects Types of Relations between ObjectsTypes of Relations between Objects

Attributes vs. ObjectsAttributes vs. Objects

How do we make this distinction?How do we make this distinction? Say we are clothing manufacturers.Say we are clothing manufacturers.

Fur is a class of objectsFur is a class of objects Animal is an attribute of this classAnimal is an attribute of this class

Say we are naturalists.Say we are naturalists. Animal is a class of objectsAnimal is a class of objects Fur is an attribute of this classFur is an attribute of this class

Garment Maker OntologyGarment Maker Ontology Define the objects; Indicate what types of attributes are used Define the objects; Indicate what types of attributes are used

to define the objects (attributes=properties)to define the objects (attributes=properties) Object Class: Object Class:

GarmentGarment Attribute Types:Attribute Types:

ISA:ISA: Material:Material: Color:Color: Garment_Type:Garment_Type:

Object Class:Object Class: FurFur

Attribute Types:Attribute Types: ISA:ISA: Animal:Animal: Color:Color: Texture: Texture:

Garment Maker OntologyGarment Maker Ontology

Attributes have lists of legal Attributes have lists of legal valuesvalues Object Class: GarmentObject Class: Garment

ISA: ObjectISA: Object Material: Material: furfur, cotton, wool, cotton, wool Color: red, black, brown, white, blueColor: red, black, brown, white, blue Garment_Type: coat, stole, hatGarment_Type: coat, stole, hat

Object Class: FurObject Class: Fur ISA: MaterialISA: Material Animal: fox, rabbit, sableAnimal: fox, rabbit, sable Color: red, black, whiteColor: red, black, white Texture: silky, thick, coarseTexture: silky, thick, coarse

Garment Maker OntologyGarment Maker Ontology Show the assignments of values to attributes for one Show the assignments of values to attributes for one

particular instance of an objectparticular instance of an object Object Class: GarmentObject Class: Garment

ISA: ISA: ObjectObject Material: Material: furfur, cotton, wool, cotton, wool Color: red, black, brown, white, blueColor: red, black, brown, white, blue Garment_Type: Garment_Type: coatcoat, stole, hat, stole, hat

Object Class: FurObject Class: Fur ISA: ISA: MaterialMaterial Animal: fox, rabbit, Animal: fox, rabbit, sablesable Color: Color: redred, black, white, black, white Texture: Texture: silkysilky, thick, coarse, thick, coarse

garment

coatfur

object

silkyred

G_type

ISA

Material

Color Texture

sable

Animal

Garment Maker OntologyGarment Maker Ontology

Usually only one value is allowed for an ISA Usually only one value is allowed for an ISA attributeattribute

In this example, In this example, The value of the color attribute for Garment is The value of the color attribute for Garment is

determined by the color attribute for the garment’s determined by the color attribute for the garment’s Material attributeMaterial attribute

This is called This is called inheritanceinheritancegarment

coatfur

object

silkyred

G_type

ISA

Material

Color Texture

sable

Animal

Garment Makers vs. Garment Makers vs. NaturalistsNaturalists A difference between a class definition and an A difference between a class definition and an

attribute valueattribute value Class Class FurFur

ISA: materialISA: material AnimalAnimal: fox, rabbit, sable: fox, rabbit, sable Color: red, black, whiteColor: red, black, white Texture: silky, thick, coarseTexture: silky, thick, coarse Garment_type: coat, stole, hatGarment_type: coat, stole, hat

Class Class AnimalAnimal ISA: mammalISA: mammal Outer_Covering:Outer_Covering: furfur, skin, scales, skin, scales Number_of_limbs: 4, 6, 8Number_of_limbs: 4, 6, 8 Circulatory_System: cold_blooded, hot_bloodedCirculatory_System: cold_blooded, hot_blooded

Nesting Attributes and Nesting Attributes and ClassesClasses

Class GarmentClass Garment Material: Material:

Class FurClass Fur Animal: fox, rabbit, sableAnimal: fox, rabbit, sable Color: red, black, whiteColor: red, black, white Texture: silky, thick, coarseTexture: silky, thick, coarse

Class CottonClass Cotton Color: red, blue, white, brown, blackColor: red, blue, white, brown, black Thread_Count: 100, 200Thread_Count: 100, 200

Garment_type: stole, coat, hat, t-shirtGarment_type: stole, coat, hat, t-shirt Attributes often must be nestedAttributes often must be nested Alternative: two subclasses of GarmentAlternative: two subclasses of Garment

Next WeekNext Week

Semantic NetsSemantic Nets Facets vs. HierarchiesFacets vs. Hierarchies Lexical SemanticsLexical Semantics Word AssociationsWord Associations