Transcript Document

Frame Based Representation

Fragment of Semantic Network (Quiz)

Living Organism Plant Fly isa isa isa Animal no.of legs

Locomotion

isa isa isa … Bird

Locomotion

Mammal 4 walk

Locomotion

Swim isa isa Penguin isa Eagle isa isa

Eat

… Sparrow Man isa Cat family

Eat

no.of legs House Cats 2 isa Fred Tom Morris Rodents isa Mice

Implementation Questions

• •

simple and efficient representation schemes for semantic nets

tables that list all objects and their properties

tables or linked lists for relationships conversion into different representation methods

predicate logic

• •

nodes correspond variables or constants links correspond to predicates

propositional logic

nodes and links have to be translated into propositional variables and properly combined with logical connectives

• • •

Problems in Semantic Nets

expressiveness

– – – –

no internal structure of nodes no easy way to represent heuristic information extensions are possible, but cumbersome best suited for binary relationships efficiency

may result in large sets of nodes and links

search may lead to combinatorial explosion

especially for queries with negative results usability

lack of standards for link types

naming of nodes

classes, instances

Logic equivalent

• • • •

Use predicates Subclass, Instance and Default: Subclass(x,y)

Instance(a,x)

Instance(a,y) Subclass(x,y)

Subclass(y,z))

Subclass(x,z) Instance(a,x)

Certain(x,p,v)

Value(a,p,v) Instance(a,x)

Default(x,p,v)

Normal(a,x,p)

Value(a,p,v)

New Look

• • • • • •

Subclass( Subclass( Subclass( Certain( Ostrich,Bird Tiger,Mammal Whale,Mammal ) ) ) Bird,Covering,Feathers) Default( Bird,locomotion,Flies) Default( Mammal,locomotion,Walks )

...

OAV-Triples

object-attribute-value triplets Object Astérix Obélix Idéfix Attribute profession warrior size size Panoramix wisdom Value extra large petite infinite

Frames

• • • • •

A Frame system is a collection of object prototypes.

Each frame contains a number of slots.

A slot represents an attribute.

Each slot has a value.

The value of an attribute can be another object.

Each object is like a C struct

the struct has a name and contains a bunch of named values (which can be pointers)

Frame Example

Bird Covering: Feathers Locomotion: Flies Ostrich Subclass-of: Bird Locomotion: Walks Mammal Covering: Hair Locomotion: Walks Tiger subclass-of: Mammal Whale Tweety Subclass-of: Mammal Locomotion: Swims Instance-of: Bird Fred Instance-of: Ostrich Hobbes Instance-of: Tiger Moby Instance-of: Whale

Knowledge Representation using Frames

PHILOSOPY Frame system = Semantic Net + structured nodes + procedural attachment INFERENCE PROCESSES:

Inheritance

Procedural attachment (demons)

Frame Matching (a type of unification) HISTORY

Minsky, 1975 (first ideas)

By 1980 in wide-spread use (KRL, FRL, SRL)

By 1985 in robust packaged form (CRL, KEE, FrameKit,…)

By 1990 in general use for knowledge bases, and evolved into object-oriented data bases (OODBs)

Procedural Attachments

With slots

If needed demons / predicates

If added demons / predicates

Slots

each slot contains one or more facets; facets may take the following forms:

values

• •

Default generic

range

what kind of information can appear in the slot

– –

predicates may contain frames, rules, semantic networks, or other types of knowledge

[Rogers 1999]

Simple Frame Example

Slot Name

name height weight profession armor intelligence marital status

Filler (value)

Astérix small low warrior helmet very high presumed single

Slots (attributes) as objects

• •

It is often useful to consider attributes as objects so they can inherit properties.

Examples of attribute properties:

– – – –

Type Constraints Default value Rules for attribute inheritance

FRAME [PC [DELL-150/L SLOT

Example Frames

FACET FILLER [isa [value [manufacturer [type-str [retail-price [if needed [marked [owner get_price(marked,wholesale)] [range-min 500] [range-max [unit 10000] Rs]] [type-str COMPUTER]] COMPANY]] ]] LEGAL-ANIMATE]]] [isa [wholesale [value [manufacturer [value [processor [value [value PC]] DELL]] pentium-4L]] 1400]]]

Slot Interpretation

• •

Instance-of and Subclass-of slots translate directly into predicate logic.

Instance and Subclass predicates Other slots can be interpreted as either:

– –

Certain predicates Default predicates MONOTONIC NONMONOTONIC

Inheritance using Frames

Given an object that contains an Instance-of of Subclass-of slot:

The properties of the objects of the named class are inherited.

For example: The class Ostrich inherits all the slots from the class Birds

Usage of Frames

• – – – –

after selecting (or instantiating) a frame in the current context, the primary process is filling in details called for by the slots of the frame: can inherit the value directly can get a default value these two are relatively inexpensive can derive information through the attached procedures (or methods) that also take advantage of current context (slot-specific heuristics)

filling in slots also confirms that frame or script is appropriate for this particular situation

[

batsman

Frame Based Inference

Cricketer

perform .

handed Get (rec) right bowler handed Jim { instance_of: bowler handed: left age: } #x<100 Tom Jim left

Tom get (rec) Cricketer

perform .

handed right bowler Tom{ instance_of: bowler handed: age: } # x<100 Jim handed Bowler { is_a: Cricketer handed : right (D) perform: ## get (rec) }

Queries

• • • •

What is the bowling hand of Jim?

What is the bowling hand of Tom?

Which bowler bowls with a right hand?

X { is_a: bowler handed: right Query Frame perform: }

Queries

What is the bowling performance of Tom?

Advantages of Frames

fairly intuitive for many applications

similar to human knowledge organization

suitable for causal knowledge

easier to understand than logic or rules

Captures Meaning (NLP)

Frame Problems

• •

it is tempting to use frames as definitions of concepts

not appropriate because there may be valid instances of a concept that do not fit the stereotype

exceptions can be used to overcome this

can get very messy inheritance

not all properties of a class stereotype should be propagated to subclasses

alteration of slots can have unintended consequences in subclasses

Quiz

1.

2.

3.

What is the advantage of frame systems over Rule Based Systems? Over Semantic Net?

Do you find any similarity between Object Oriented Systems and Frame Systems? What are the demons in the former?

Tom is a boy who studies in Class IV. How many legs does Tom have? Does Tom study Arithmetic?

Can you answer these question using a frame based representation of domain knowledge? How?