Presentation is loading. Please wait.

Presentation is loading. Please wait.

FT228/4 Knowledge Based Decision Support Systems

Similar presentations


Presentation on theme: "FT228/4 Knowledge Based Decision Support Systems"— Presentation transcript:

1 FT228/4 Knowledge Based Decision Support Systems
Frame-Based Expert Systems Have been talking so far about expert systems that represent knowledge as rules Have talked about general production rules but also about how to handle uncertainty because it may not always be possible to represent full knowledge as a set of rules Going to now look at another representation technique called frames You may recognise some things talked about from JESS Ref: Artificial Intelligence A Guide to Intelligent Systems, Michael Negnevitsky – Aungier St. Call No

2 Knowledge Representation
In building a knowledge base, the programmer must select the significant objects and relations in the domain and map these into formal language The resulting program must contain sufficient knowledge to solve the problem of the domain, it must make correct inferences and it must do so quickly We can consider a knowledge base as a mapping between objects and relations in a problem domain and the computational objects and relations in a program The results of inferences on the knowledge base should correspond to the results of actions or observations in the world The computational objects, relations and inferences are determined by the knowledge representation language the programmer selects.

3 Knowledge Representation
General principles and issues Class hierarchies are found in both scientific and common sense classification schemes How do we provide a general mechanism for representing them? How may we represent definitions? How may we represent exceptions? When should a knowledge based system make default assumptions about missing information, and how should it adjust its reasoning if these assumptions prove wrong? How may we best represent time? How may we best represent causality? How may we best represent uncertainty?

4 Knowledge Representation
Medium of representation is the language Scheme is how we use the language Classification of schemes Logical representation schemes: Use expressions in formal logic to represent a knowledge base. Inference rules and proof procedures apply this knowledge to problem instances Procedural representation schemes: Knowledge represented as a set of instructions for solving a problem. In a rule based system, an if…then may be seen as a procedure for solving a goal in a problem domain, by solving the premises in order.

5 Knowledge Representation
Classification of schemes (contd.) Network representation schemes: Network representations capture knowledge as a graph in which the nodes represent objects or concepts in the problem domain and the arcs represent relations or associations between them Structured representation schemes: Extension of networks by allowing each node to be a complex data structures consisting of slots with attached values. These values may be simple numeric or symbolic data, pointers to other frames or even procedures for performing a particular task.

6 Issues in Knowledge Representation
Most of the issues in knowledge representation are motivated by the effort to program a computer to understand natural languages such as English. Issues raised: Exactly what things can be represented by the objects and relations in the language. E.g. if a predicate relates an object to a value, such as hascolour(car,red) how can that be used to represent “John’s car is redder than Mary’s”. What level of complexity is required for our objects. How do we distinguish between intensional and extensional knowledge? The intension determines what a concept means at an abstract level (ball is round). The extension is the set of all things denoted by the object (set of all balls). A database denotes the extension of the object, whereas an expert system includes the intension of the object.

7 Issues in Knowledge Representation
Issues raised (contd.): How do we represent meta-knowledge, or knowledge about the objects and structures of the representation language itself? This type of knowledge helps us represent things such as “George believes thaty Tom knows that Mary’s car is red” How do we represent into class hierarchies, use inheritance, excpetions, overriding, overloading, default values etc.

8 Frames “Thinking always begins with suggestive but imperfect plans and images; these are progressively replaced by better–but usually still imperfect–ideas”

9 What is a frame ? Minsky 1975 : “When one encounters a new situation (or makes a substantial change in one’s view of a problem) one selects from memory a structure called a ‘frame’. This is a remembered framework to be adapted to fit reality by changing details as necessary” Basically what we are talking about is yet another model of human cognition: the structure of knowledge in memory. Have to keep in mind constantly what we are trying to do with expert systems. We are trying to acquire and represent the knowledge used by experts and the act on it in a way that mimics an expert. Basically the idea is that we adjust to new experiences or situations by calling up information structured from past experiences. When then specifically fashion or revise the details from these past experiences to represent individual differences in the new situation.

10 What is a frame ? Complex unit that represent situations or objects in our domain of interest Data structure with typical knowledge about a particular object or concept Proposed by Marvin Minsky in 1970s Used to capture and represent knowledge in frame-based expert systems

11 Example John kicked the ball John Person Male 6’4” Ball Round White
Black spots

12 Frame Examples Quantas Boarding Pass Carrier: Quantas Name: Mr. Black
Flight: Q 101 Date: 12 Dec Seat: 24A From: Melbourne To: Sydney Boarding: 0600 Gate: 4 Air New Zealand Boarding Pass Carrier: Air New Zealand Name: Mr. White Flight: NZ 101 Date: 13 Dec Seat: 25A From: Melbourne To: Christchurch Boarding: 1800 Gate: 7 Think of them as templates – each frame has its own name and a set of attributes or slots associated with it. So we have slots above. Slots may have a procedure to determine the value

13 Frames Has a name A set of attributes or slots associated with it
E.g. Frame Boarding Pass has attributes Carrier, Name, Flight, Date,Seat,From, To, Boarding,Gate Each slot has a value associated with it Slot may have a procedure associated with it to determine its value Slot may be a pointer to another frame or set of rules May recognise this from jess – often used in conjunction with production rules Basically frame is a way of organising knowledge to describe various attributes/characteristics of an object An application of object-oriented programming for expert systems to an extent Object is a concept – abstraction or a things with a crisp boundary or meaning for the problem at hand Objects have an identity and are clearly distinguishable Think of our example of lab exercise patient, doctor, disease, symptom Object can combine both data and behaviour into a single entity – contrast with rule based expert systems where facts and rules are separated. Basically a frame is an object. Talking about using frames to represent well-understood stereotypical situations

14 Frames Rule Based systems may work with facts scattered through the knowledge base May have to search through knowledge that is not relevant Search may be slow Frames better organise the knowledge in the knowledge base

15 Slots Frame is a collection of slots. May include information such as
Frame name Relationship of frame to other frames E.g. frame DELL Laptop may be member of class Computer which may belong to class Hardware Slot Value Can be symbolic, numeric or Boolean. Can be assigned when the frame is created or during an expert system session Default Slot Value Taken to be true when no evidence to contrary is found. Range of Slot Value Determines where a particular object or concept complies with the stereotype requirements Procedural Information Procedure executed when the slot is changed or needed Slot Value: in our boarding pass example slot name had symbolic values, slot gate had numeric value Presence, absence or amount of detail in each of these depends on the particular problem-solving situation addressed

16 Facets A facet is a means of providing extended knowledge about an attribute of a frame Used to establish the attribute value, control end-user queries and tell the inference engine how to process the attribute Value facet Specify default and initial values Prompt facet Enable the end-user to enter the attribute online Inference facet Allow us to stop the inference process when a value of a specified attribute changes What is the correct level of decomposition ? What is a frame, what is a slot, what is a facet ? There is no correct level. Depends on the nature of the problem and the judgement of the knowledge engineer. Work through an example – Lab4 exercise.

17 Classes and Instances Frame may refer to a particular object or a group of similar objects Class-frame describes a group of objects with common attributes Instance-frame refers to a particular instance of an object Each frame ‘knows’ its class Implicit property of the frame

18 Class and Instance Example
CLASS: Boarding Pass Carrier: [Str] Name: [Str] Flight: [Str] Date: [Str] Seat: [Str] From: [Str] To: [Str] Boarding: [Num] Gate: [Num] INSTANCE: Air New Zealand Boarding Pass Carrier: Air New Zealand Name: Mr. White Flight: NZ 101 Date: 13 Dec Seat: 25A From: Melbourne To: Christchurch Boarding: 1800 Gate: 7 INSTANCE: Quantas Boarding Pass Carrier: Quantas Name: Mr. Black Flight: Q 101 Date: 12 Dec Seat: 24A From: Melbourne To: Sydney Boarding: 0600 Gate: 4 In other words a frames class is an implicit property of the frame For example instances identify their class in a slot Class Frames basically make it easier for us to organise our knowledge hierarchically Also allows us to think of an object as a single entity and ignore the details of the internal structure i.e. don’t care about the mechanical organisation of a car until it breaks down we just use it – then want to know the details. Why bother with classes ? We are less concerned with defining strictly and exhaustively all the properties of an object we are more concerned with the salient properties typical for the entire class. Based on the idea that humans seem to be more concerned with salient properties – idea of proto-types Prototypical bird can fly so we tend to think of this as a property of a bird even though there are birds that can’t fly. There is also the sense that for example an eagle is a better example of the bird category than the penguin because it is more typical of its class. Nonetheless the existence of the penguin means that we are forced to qualify generalisation such that birds can fly

19 Class Inheritance Attributes of a class-frame represent things that are typically true for all objects in the class Slots and default values of a class frame are inherited across the class/sub-class and class/member hierarchy. Slots in instance-frames can be filled with actual data uniquely specified for each instance Default values are only assigned to selected slots to be used only if other information is not available When an instance of a frame is created the system will attempt to fill its slots either by querying the user, accepting the default from the class frame or executing some procedure to obtain the instance value. The inheritance of default values can mean that the data description of the problem is incorrect, lets us make incorrect assumptions and can lead to incorrect conclusions

20 Relationships among classes
Subclass is related to its superclass by an ‘is-a’ relation An instance-frame can overwrite some of the typical attribute values in the hierarchy The instance-frame remains a member of the class with access to properties further up the hierarchy even if it violates the typical value in its class Relationships in such a hierarchy constitute a process of specialisation Frame at the top of the hierarchy represents some generic concept, frames further down represent more restricted concepts

21 Relationships among objects
Generalisation denotes ‘a-kind-of’ or ‘is-a’ relationship. E.g. car is a vehicle, boat is a vehicle Aggregation denotes a ‘part-of’ or ‘part-whole’ relationship in which subclasses representing components are associated with a superclass representing a whole. E.g. an engine is part of a car Association describes some semantic relationship between different classes unrelated otherwise. Usually appear as verbs and are bi-directional. E.g. Mr. Black owns a house, Mr. Black owns a car, John kicked a ball Bi-directional : does not imply that the verb is the same in both directions. The house does not own Mr. Black it is owned by or belongs to. Can use the inverse of the relationship.

22 More about inheritance
Inheritance is the process by which all characteristics of a class-frame are assumed by an instance frame. Instance-frame inherits from its parent-frame. Can have multiple inheritance All parents must have unique attribute names Means code reuse Reduces number of independent and specific features of an expert system Have already said that a common use is to impose default values on all instance-frames. Can view as a tree-like structure that is turned over. Highest level of abstraction is at the top I.e. root. Branches illustrate lower levels of abstraction, leaves at the bottom are instance frames. Each frame inherits characteristics from those higher in the hierarchy. Multiple inheritance : job of the knowledge engineer is to group similar classes together and reuse common code.

23 Disadvantages Cannot distinguish between essential properties and accidental properties May become impossible to construct composite concepts when using multiple inheritance Leave the knowledge engineer with difficult decisions to make about the hierarchical structure of the systems and its inheritance paths All seems very simple – what is the catch Simplicity has been lost at implementation stage Essential property – property frame must have to be considered member of its class Accidental property – properties instances just happen to have Instances inherit all typical properties and because it is possible to overwrite them anywhere in the frame hierarchy it may become impossible to construct composite concepts when using multiple inheritance Appeals to so-called typical properties do not always work so we get unexpected results Frame-based expert systems cannot offer safeguards against creating coherent structures but do provide data and control structures that are more suited for simulation of human reasoning than conventional programming languages – also combine two approaches to knowledge representation, rules and frames

24 Methods and Demons A method is a procedure associated with a frame attribute that is executed whenever requested Method can determine an attributes specific value or execute a series of actions when the value changes A demon generally has an IF-THEN structure Executed when attribute in IF statement changes Two types of method WHEN CHANGED Executed immediately when an attribute value changes WHEN NEEDED Used to obtain attribute value only when needed Expert systems are not only required to store information but also to validate and manipulate it. To add actions to frames need methods and demons Method – equivalent to series of commands in a macro When needed - Executed when information associated with attribute value is needed for soling the problem but attribute value is undetermined Demon – executed when attribute in IF changes. Often used as synonym for method but demon is limited to IF then structure. Methods used for more complex procedures.

25 Interaction of Rules and Frames – Inference Engine
Rule-Based Expert System Inference engine links rules in knowledge base with data in database When goal is set up, inference engine searches knowledge base to find rule with that goal in its consequent If it finds such a rule and if part matches data in database, rule is fired and goal obtains its value. If no such rule found , the queries user for value Most frame based expert systems allow use of a set of rules to evaluate information contained in frames

26 Inference Engine Frame-Based System
Inference engine also searches for goal Rules play auxiliary role. Frames represent major source of knowledge. Methods and demons used to add actions to frames. Goal can be established either in method or demon.

27 Inference engine Frame-based system
Based on goal, inference engine finds rules whose consequents find goal of interest Examines these rules one at a time in order they appear in the rule base Examines the validity of each antecedent in the first rule This may require the If all antecedents are valid, concludes the goal If any of the antecedents are invalid, concludes goal is invalid and will proceed to next rule

28 Inference engine Has to obtain value from WHEN NEEDED method only when it has not been determined from rule base Search order for attribute value has to be determined first Attach a SEARCH ORDER facet to an attribute to indicate where and in what order to obtain attribute value E.g. set the order so that it first searches the rule base and only when this fails executes when needed

29 Rule-Based Expert Systems
Set of rules represents the domain knowledge useful for problem solving. Each rule captures some heuristic of the problem. Each rule adds some new knowledge and thus makes the system smarter. Rule base can be easily modified by changing, adding and subtracting rules. Principal difference is how the knowledge is viewed and represented in the system.

30 Frame-based Expert Systems
Overall hierarchical structure of knowledge is decided first. Classes and attributes are identified. Hierarchical relationship between frames are established. Architecture allows us to add actions to the frames through methods and demons. Problem is viewed in a different manner

31 Building Frame-based Expert System
Specify the problem and define the scope of the system Determine the classes and their attributes Define instances. Design displays. Define WHEN CHANGED and WHEN NEEDED methods, and demons. Define rules. Evaluate and expand the system. Basic steps are the same as when developing rule-based expert systems Knowledge engineer has to obtain general understanding of problem and overall knowledge structure They then decide on the tool to use to develop the prototype system They then create the knowledge base and test it by running a number of consultations Expert system is then expanded, tested and revised until it does what the user wants


Download ppt "FT228/4 Knowledge Based Decision Support Systems"

Similar presentations


Ads by Google