400 likes | 2.33k Views
Frames and Scripts. CIS 479/579 Bruce R. Maxim UM-Dearborn. Frames. Can be looked at as being similar to a “pre-defined” semantic network Frames contain information that can be used even if not observed Frames contain attributes true of all instances of object or events
E N D
Frames and Scripts CIS 479/579 Bruce R. Maxim UM-Dearborn
Frames • Can be looked at as being similar to a “pre-defined” semantic network • Frames contain information that can be used even if not observed • Frames contain attributes true of all instances of object or events • Frames contain stereotypical instances of objects or events
Frame Attributes • Based on stereotypes • Slot & filler type static representation • Make use of “if-needed” inheritance or procedural attachment (demons) to fill in missing values • Allow us to use current explanation provided by frame until the “current view” is proven to be incorrect
How are frame used? • People make select a frame from a list of proposed frames candidates based on a small amount of partial evidence (e.g. bigot) • The attributes of a selected frame are instantiated with observed attributes from the current object or event description
How are frame used? • As values for slots are found they are copied to the evolving frame description • If slot values cannot be found or begin to contradict slot constraints a new frame candidate may need to be selected • You may also need to be alert for changes in the object or event while the frame is instantiated
What happens when frame instantiation fails? • One option is to select fragments of the current frame that do match the object or event and try to match them against new frame candidates • Another option is to make an excuse for the failure and use the frame any way? (e.g. three-legged cat)
What happens when frame instantiation fails? • You may be able to follow pre-defined links between frames in a frame system bench table no back, too big no back, too wide drawers chair no back, too high desk stool dresser no kneehole
What happens when frame instantiation fails? • Another option to follow the inheritance links in the hierarchical structure formed by the frames (e.g. dog mammal animal) until a sufficiently “general” frame that does not conflict with the evidence is found • If a “general” frame found using inheritance is not specific enough, consider creating a new frame “just below” that matching frame that contains the missing knowledge
Problems with Frames • Frames are not very frame-like (e.g. there are more atypical mammals than typical mammals) • Definitions are more important than most people think • Cancellation of default properties is very a tricky business
Scripts • If frames can be viewed as using semantic networks to structure static information • Scripts can be viewed as using a series of related frames to represent dynamic information as a sequence a stereotypic events from a some context
Script Attributes • Entry conditions • When does the script apply? • Result • What will be true once script is completed • Props • Roles • Track • Variation or specialization of usual script pattern • Scenes • Actual event sequences
Restaurant Script • Track: Coffee Shop • Props: Tables, menu, food (F), check, money • Roles: Customer (S), waiter (W), cook (C), casher (M), owner (O) • Entry conditions: • S is hungry, S has more money • Results: • S has less money, O has more money, S not hungry, S happy (optional)
Restaurant Script • Scene 1 Entering S PTRANS into restaurant S ATTEND eyes to tables S MBUILD where to sit S PTRANS S to table S move S to sitting position
Restaurant Script • Scene 3 Eating C ATRANS F to W W ATRANS F to S S INGEST F Option: Return to Scene 2 and order more otherwise go to Scene 4
Scripts • Are useful because they record patterns of the occurrence of events from the real world • These patterns are based on causal relationships between events (e.g. agents perform one action to be able to perform another action) • The sequence of script events define a causal chain that will facilitate reasoning about unobserved events
Scripts • When a script is know to be appropriate to a given situation it can be used to predicate the occurrence of future events • Example: • I went to a restaurant, ordered food, paid my bill, and left • Did I eat?
Scripts • Clearly when activating a large script you need to be concerned with whether every slot needs to be filled every time • The alternative is to wait to fill a slot until information is required (e.g. using if-needed inheritance or the equivalent)
Scripts • Can be used in question answering program (e.g. story comprehension) • Why did a waiter bring John a menu? • Scripts can also help to focus attention on unusual events as script departures • John went to a restaurant, was shown to a table, ordered a large steak waited for a long time, got angry, and left. • Why did John get angry?
Strengths of Scripts • Can be used to predicate events and answer questions • Provide a framework for integrating observations into a coherent interpretation • Scripts provide scheme for detecting unusual events
Weaknesses of Scripts • Less general than frames so not appropriate for some knowledge types • If scripts can only account for all details in a restricted domain they are no very interesting • It is unlikely that scripts can account for every real life scenario (even if restricted to restaurant visits only)