@Anupam Basu Frames Lecture 20. @Anupam Basu What is a Frame? A frame is a prototype of a concept...

28
@Anupam Basu Frames Lecture 20

Transcript of @Anupam Basu Frames Lecture 20. @Anupam Basu What is a Frame? A frame is a prototype of a concept...

Page 1: @Anupam Basu Frames Lecture 20. @Anupam Basu What is a Frame? A frame is a prototype of a concept –Denoting the attributes of the concept –The class of.

@Anupam Basu

Frames

Lecture 20

Page 2: @Anupam Basu Frames Lecture 20. @Anupam Basu What is a Frame? A frame is a prototype of a concept –Denoting the attributes of the concept –The class of.

@Anupam Basu

What is a Frame?

• A frame is a prototype of a concept– Denoting the attributes of the concept– The class of objects or concepts to which the

concept in question belongs– And some more things ………

• An instance of a frame is a representation of a SPECIFIC object

• Instantiation of a frame

Page 3: @Anupam Basu Frames Lecture 20. @Anupam Basu What is a Frame? A frame is a prototype of a concept –Denoting the attributes of the concept –The class of.

@Anupam Basu

Example

• Fido is a dog

• The concept dog

• Fido is a particular dog

• How can we represent the concept/notion of the creature “dog”?

Page 4: @Anupam Basu Frames Lecture 20. @Anupam Basu What is a Frame? A frame is a prototype of a concept –Denoting the attributes of the concept –The class of.

@Anupam Basu

Dog {

is a: mammal;no._of_legs: 4;type_of_teeth: sharp;has_tail: yes;color_of_skin: ;owner: ;::

}

Slot name

Slot value

Page 5: @Anupam Basu Frames Lecture 20. @Anupam Basu What is a Frame? A frame is a prototype of a concept –Denoting the attributes of the concept –The class of.

@Anupam Basu

Fido {

is a: Dog;no._of_legs: 4;type_of_teeth: sharp;has_tail: yes;color_of_skin: Black;owner: Rahim;::

}

Page 6: @Anupam Basu Frames Lecture 20. @Anupam Basu What is a Frame? A frame is a prototype of a concept –Denoting the attributes of the concept –The class of.

@Anupam Basu

Object-Attribute-Value <o,a,v>• An instance of a frame denotes an

object• A Frame denotes a class to which the

object belongs• The slots denote the attributes of the

object• The slots can be of different types• The slots are instantiated with values

Page 7: @Anupam Basu Frames Lecture 20. @Anupam Basu What is a Frame? A frame is a prototype of a concept –Denoting the attributes of the concept –The class of.

@Anupam Basu

Semantic Net to Frame

Nellie Elephant

Africa

Animal

head

Page 8: @Anupam Basu Frames Lecture 20. @Anupam Basu What is a Frame? A frame is a prototype of a concept –Denoting the attributes of the concept –The class of.

@Anupam Basu

Slots

• Slots denote attributes• Attributes are typed• Some values are defined in the frame

definition (already instantiated)• Some values are defined in the

instances only• Instantiated slots define facts – may

be used to answer queries

Page 9: @Anupam Basu Frames Lecture 20. @Anupam Basu What is a Frame? A frame is a prototype of a concept –Denoting the attributes of the concept –The class of.

@Anupam Basu

What are there in a slot?

• Values• Types• Constraints over possible values• Predicates

– Daemons / functions

• Compare with object oriented systems• Slots can be structured – frames within

slots – pointers to frames

Page 10: @Anupam Basu Frames Lecture 20. @Anupam Basu What is a Frame? A frame is a prototype of a concept –Denoting the attributes of the concept –The class of.

@Anupam Basu

is_a Human_being

name

age

height

stays_at

studies_in

grades

Boy

string

Int <=15

Float < 7.0

Int

string

*results

Page 11: @Anupam Basu Frames Lecture 20. @Anupam Basu What is a Frame? A frame is a prototype of a concept –Denoting the attributes of the concept –The class of.

@Anupam Basu

is_a Human_being

name

age

height

stays_at

studies_in

grades

Boy

If needed compute CGPA (Boy, results)

If added test (constraint)

Page 12: @Anupam Basu Frames Lecture 20. @Anupam Basu What is a Frame? A frame is a prototype of a concept –Denoting the attributes of the concept –The class of.

@Anupam Basu

instance_of Boy

name Tom Smith

age 12

height 5 stays_at 15 Park

Avenue

studies_in Bright Academy

grades

Tom

If needed compute CGPA (Tom, results)

Page 13: @Anupam Basu Frames Lecture 20. @Anupam Basu What is a Frame? A frame is a prototype of a concept –Denoting the attributes of the concept –The class of.

@Anupam Basu

Predicates in a Slot

• Two types in general– If needed– If added

• If needed predicates state how to find/compute a value

• If added predicates are used to check constraints on the values– Can be used for consistency checking as well.

Page 14: @Anupam Basu Frames Lecture 20. @Anupam Basu What is a Frame? A frame is a prototype of a concept –Denoting the attributes of the concept –The class of.

@Anupam Basu

Generic Values

• Does Tom drink milk?

• The answer is not in the instance description of Tom.

Page 15: @Anupam Basu Frames Lecture 20. @Anupam Basu What is a Frame? A frame is a prototype of a concept –Denoting the attributes of the concept –The class of.

@Anupam Basu

• Tom is an instance of a Boy • Also, Boy is a Human Being• In the description of Human Beings, we

have “Human Beings drink milk”

• All human beings drink milk.• The answer can therefore be INHERITED

Page 16: @Anupam Basu Frames Lecture 20. @Anupam Basu What is a Frame? A frame is a prototype of a concept –Denoting the attributes of the concept –The class of.

@Anupam Basu

• Generic values are values which will hold true for all subclasses of the class and all instances of the class.

• Hence, the generic values can be inherited down the hierarchy.

• Tom has a pen. Does he need ink?

Page 17: @Anupam Basu Frames Lecture 20. @Anupam Basu What is a Frame? A frame is a prototype of a concept –Denoting the attributes of the concept –The class of.

@Anupam Basu

Default Value

• With which hand does Tom write?

• Again the answer is not in the description of Tom.

Page 18: @Anupam Basu Frames Lecture 20. @Anupam Basu What is a Frame? A frame is a prototype of a concept –Denoting the attributes of the concept –The class of.

@Anupam Basu

is_a Human_being

name

age

height

stays_at

studies_in

grades

writes with right hand *

Boy

If needed compute CGPA (Boy, results)

If added test (constraint)

Page 19: @Anupam Basu Frames Lecture 20. @Anupam Basu What is a Frame? A frame is a prototype of a concept –Denoting the attributes of the concept –The class of.

@Anupam Basu

• Since we are not told that Tom is left handed, we will assume that Tom writes with right hand.

• Again inheritance of the Default Value

Page 20: @Anupam Basu Frames Lecture 20. @Anupam Basu What is a Frame? A frame is a prototype of a concept –Denoting the attributes of the concept –The class of.

@Anupam Basu

Inheritance

• The known values can be inherited from the parents unless more specific information is available with the child.

• In the super class (parent) the generic values and the default values are specified.

• The generic values are retained. • Default values may be overwritten.

Page 21: @Anupam Basu Frames Lecture 20. @Anupam Basu What is a Frame? A frame is a prototype of a concept –Denoting the attributes of the concept –The class of.

@Anupam Basu

Multiple Inheritance

• A class or an instance may be a child of multiple parents.

• What to inherit?

Page 22: @Anupam Basu Frames Lecture 20. @Anupam Basu What is a Frame? A frame is a prototype of a concept –Denoting the attributes of the concept –The class of.

@Anupam Basu

Teacher- Politician

Teacher Politician

Quality Education

Vote Bank

Top-Priority

??

Page 23: @Anupam Basu Frames Lecture 20. @Anupam Basu What is a Frame? A frame is a prototype of a concept –Denoting the attributes of the concept –The class of.

@Anupam Basu

Scooter

Automobile Two Wheeler

4 2

Has-wheels

??

Wrong Organization

Page 24: @Anupam Basu Frames Lecture 20. @Anupam Basu What is a Frame? A frame is a prototype of a concept –Denoting the attributes of the concept –The class of.

@Anupam Basu

Scooter

Automobile

Two Wheeler 4

2

Has-wheels

Correct Organization

Page 25: @Anupam Basu Frames Lecture 20. @Anupam Basu What is a Frame? A frame is a prototype of a concept –Denoting the attributes of the concept –The class of.

@Anupam Basu

Inference in a Frame

• Look for candidate frames or instances• Look for the availability of values• If available – solved• Else go to the preceding level and so on• If soled at a higher level, try to have more

specific answer going down the hierarchy through another branch

Page 26: @Anupam Basu Frames Lecture 20. @Anupam Basu What is a Frame? A frame is a prototype of a concept –Denoting the attributes of the concept –The class of.

@Anupam Basu

Answering a Query

Rt.handed Batsman

Opener

Batt. Avg. Sehwag

With which hand does Sehwag bat?

Page 27: @Anupam Basu Frames Lecture 20. @Anupam Basu What is a Frame? A frame is a prototype of a concept –Denoting the attributes of the concept –The class of.

@Anupam Basu

Shapes

Triangle Rectangle Circle

Equilateral Isoceles

Page 28: @Anupam Basu Frames Lecture 20. @Anupam Basu What is a Frame? A frame is a prototype of a concept –Denoting the attributes of the concept –The class of.

@Anupam Basu

Similarity Measure

• Define similarity function based on the matches in <attribute value pair>

• Degree of mismatch may have limited penalty

• For key values one mismatch may rule out a match