Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Expert Systems Lecture 3 Knowledge Representation Technique.

Similar presentations


Presentation on theme: "1 Expert Systems Lecture 3 Knowledge Representation Technique."— Presentation transcript:

1 1 Expert Systems Lecture 3 Knowledge Representation Technique

2 Agenda Overview Levels of Knowledge –Shallow –Deep Types of knowledge –Declarative –Procedural –Heuristic –Structural Knowledge representation Techniques –Object-attribute-value triplets –Rules –Semantic networks –Frames –logic 10-2

3 Overview Knowledge –Is the understanding of a subject area –Example: is the understanding of the area of medicine (a well-focused topic from the subject area) Domain –A well-focused subject area Knowledge representation –The method used to encode knowledge in an expert system’s knowledge base 10-3

4 Levels of Knowledge Levels of knowledge –Shallow Knowledge Is the presentation of surface level information that can be used to deal with very specific situations. Represent the input-output relationship of a system It can be represented by IF-THEN rules Insufficient in describing the complex problems If gasoline tank is empty then the car won’t start © 2005 Prentice Hall, Decision Support Systems and Intelligent Systems, 7th Edition, Turban, Aronson, and Liang 10-4

5 Levels of Knowledge –Deep Knowledge Is the internal and causal structure of the system’s components Difficult to collect, and computerized © 2005 Prentice Hall, Decision Support Systems and Intelligent Systems, 7th Edition, Turban, Aronson, and Liang 10-5

6 Levels of Knowledge © 2005 Prentice Hall, Decision Support Systems and Intelligent Systems, 7th Edition, Turban, Aronson, and Liang 10-6 starter Brushes Filter

7 Types of Knowledge One of the responsibility as a knowledge engineer is to choose the knowledge representation techniques that best suited for the given problem To accomplish this, you should have an understanding of the various knowledge representation technique and types of knowledge No single technique is ideal 10-7

8 Types of Knowledge 1.Declarative knowledge –Describe what is known about the problem (facts) –A list of statements that describe some object or concept –This type of knowledge is considered shallow or surface level. –Important especially in the initial stage of knowledge acquisition 10-8

9 2.Procedural knowledge –Describes how to perform several activities (how to solve problem) –Provides direction on how to do something (step by step sequence) –It tells us how to use declarative knowledge –Rules, strategies, and procedures are typical types of procedural knowledge used in ES. 10-9 Types of Knowledge

10 3.Heuristic Knowledge –Describes a rule of thumb that guides the reasoning process –Acquired from learning, and past experience of solving problems –Experts will take fundamental knowledge about the problem and compile it into simple heuristics to solve their problems 10-10

11 4.Structural knowledge –Connects declarative and procedural knowledge. –Structural knowledge is knowledge of how the ideas within a domain are integrated and interrelated (Describes the knowledge structure) –Describes an expert’s overall mental model of the problem –The expert’s mental model of concepts, subconcepts and objects 10-11 Types of Knowledge

12 5. Meta knowledge –Knowledge about knowledge –Knowledge about how experts use their knowledge to solve problems © 2005 Prentice Hall, Decision Support Systems and Intelligent Systems, 7th Edition, Turban, Aronson, and Liang 10-12 Types of Knowledge

13 Knowledge representation technique The most common techniques for representing knowledge are: 1.Object-attribute-value triplet 2.Production Rules 3.Semantic networks 4.Frames 5.Logic 10-13

14 1.Object-value-attribute triplets –A fact is a form of declarative knowledge –It provides some understanding of an event of the problem. –A fact may assert a particular property value of some object 10-14 Knowledge representation technique Factobjectpropertyvalue

15 Knowledge representation technique This type of fact is known as “object-attribute-value” The attribute is a property or feature of object. The value specifies the attribute’s assignment (boolean, numeric, or string) The chair’s color is brown Object as “chair” the attribute as “color”, and the value as “brown”. The object represented in an O-A-V can be a physical item as a car or an abstract item like feelings, ideas, concepts,…etc. 10-15 Chair Brown Color

16 In most ES problem, objects have more than feature (attribute) Some attribute can have only one value (single valued fact) Some attribute can have multiple values (multi-valued facts) During the design of your ES, you should determine whether an O-A-V is a single or multivalued 10-16 Knowledge representation technique Ball 1 Foot Red 1 pound weight color Diameter

17 Example (single valued) Statement: A barometric blood pressure Object: barometer attribute: pressure reading Possible values: Falling steady rising Q: please tell me if the barometric pressure is Falling Steady rising A: Falling 10-17 Knowledge representation technique

18 Example (multi-valued) Statement: person’s education level Object: person attribute: education level Possible values: high school college graduate school Q: please select the level of education college graduate school high school A: high school college The ES should permit the user to select several items from a list 10-18 Knowledge representation technique

19 Both single and multi-value O-A-V facts share an important feature –When a user selects a value from a list the system asserts this value into the working memory as True and all other values as False 10-19 Knowledge representation technique

20 Uncertain facts –Our world is not black and white, sometimes we do not know if some events is true or false with complete certainty, rather we have some degree of belief. –A conventional method used in ES for managing uncertain information is called certainty factor (CF). –CF is a numeric value assigned to a statement that represents the degree of belief in the statement –CF originated during the work on MYCIN. –Example 10-20 Knowledge representation technique

21 2.Production Rules –Facts allow the ES to understand the state of the problem. However, ES must have additional knowledge that allows it to work intelligently with these facts to solve a given problem. –One knowledge technique used to provide this additional knowledge is a rule –A rule is a form of procedural knowledge. 10-21 Knowledge representation technique

22 The rule’s structure connects one or more antecedents (premises) contained in the IF part, to one or more consequents (conclusions) contained in the THEN part Example: IF the ball’s color is red Then I like the ball 10-22 Knowledge representation technique

23 A rule may have multiple premises joined with AND statements, OR statements, or a combination of both. Its conclusion can contain single statement or a combination joined with AND. The rule can also contain an ELSE statement, that is inferred to be TRUE, if one or more of its premises are FALSE Example: IF today’s time is after 10 am And Today is a weekday And I am at home OR My boss called and said that I am late for work THEN i am late for work ELSE I am not late for work 10-23 Knowledge representation technique

24 In a rule based expert system, domain knowledge is captured in a set of rules and entered in the system’s knowledge base the system uses these rules along with information contained in the working memory to solve a problem When the IF portion of the rule mtches the information contained in the working memory, the system performs the actions specified in the THEN part of the rule When this happened, the rule fires and its THEN statements are added to the working memory The new statements added to the working memory can also cause other rules to fire 10-24 Knowledge representation technique

25 10-25 Knowledge representation technique Working Memory Knowledge Base IF Ball’s Color is RED THEN I Like the Ball IF I Like the Ball THEN I Will Buy the Ball Ball’s Color is Red I Like the Ball I Will Buy the Ball Q: Ball’s Color? A: Red Step 1 Step 2 Step 4 Step 3 Step 5

26 The processing of rules in a rule based expert system is managed by a module known as “inference engine” Besides concluding new information, a rule can perform some operations IF The area of the square is needed THEN area=Length*width In order to perform more complex operations, most rule based systems are designed to access external programs, e.g., Database. 10-26 Knowledge representation technique

27 Types of Rules –Relationships IF the battery is dead THEN the car will not start –Recommendation IF the car will not start Then take a cab –Directive IF the car will not start AND the fuel system is OK THEN Check out the electrical system –Heuristic IF the car will not start AND the car is a 1957 Ford THEN check the float 10-27 Knowledge representation technique

28 Rules can be also categorized according to the nature of the problem solving strategy –Interpretation problem IF Voltage of the resistor R1 is greater than 2 volts AND the Collector voltage of Q1 is less than 1 volts THEN pre-amplifier section is in the normal range –Diagnosis problem IF The stain of the organism is grampos AND The morphology of the organism is coccus AND The growth of the organism is chains THEN There is evidence that the organism is streptococus 10-28

29 Knowledge representation technique –Design problem IF Current task is assigning a power supply AND The Position of the power supply in the cabinet is known AND There is space in the cabinet for the power supply THEN Put the Power Supply in the cabinet 10-29

30 3.Semantic Network –Provides a graphical view of a problem’s important objects (physical, or abstract), properties and relationships. –It contains nodes and arcs that connect the nodes. –The node can represent: Objects Object properties Property value 10-30 Knowledge representation technique

31 The arcs represent the relationships between the nodes. Both the nodes and arcs have labels that clearly describe the objects represented and their natural relationships. Example: Canary is a bird, Bird has wings and travels by flying 10-31 Knowledge representation technique

32 10-32 Knowledge representation technique Canary Wings Bird Fly IS-A HAS TRAVEL

33 Expanding the network –You van easily expand a semantic network by simply adding nodes and linking them to their related nodes currently in the network. – Theses new nodes represent additional objects or properties –You can add a new node in one of three ways Similar object A more specific object A more general object 10-33 Knowledge representation technique

34 10-34 Canary Wings Bird Fly IS-A HAS TRAVEL Tweety IS-A Penguin IS-A Walk TRAVEL Animal Air IS-A Breath

35 A more specific object is tweety and linked through IS-A arc. –The figure not only tell you that Tweety is a canary, but you can also infer that Tweety is a bird, simply by following the IS_A arc. A similar object is Penguin node and was added and linked to the “bird node” through an IS-A arc A more general object is “Animal” node, that was added and linked to bird through an IS-A arc. –You not only know that “a bird is animal” but by tracing through the network you also know that “Tweety is an animal and breathes air” 10-35 Knowledge representation technique

36 Inheritance in Semantic Networks –The last figure illustrated how nodes added to a semantic network automatically inherit information from the network –Example: “Tweety” breathes air because it is an “Animal”. This feature called inheritance. 10-36 Knowledge representation technique

37 The inheritance feature of a semantic network eases the task of coding knowledge. Example: if you add some specific object node to the network “Tweety”, it inherits information throughout the network via the IS-A links In addition if you add a general object node “Animal”, other nodes inherit its properties. 10-37 Knowledge representation technique

38 One simple way to use a semantic network is to ask some node a question –You can ask the bird node “How do you travel –To answer the question, the node first looks for an arc labled travel, in this case that arc exists. The node then uses the information in the attached node as the answer namely “fly” –If the node is unable to locate the answer via a local arc, it then searches for an answer via its IS-A link. EX: Tweety node has no way to answer the question so it asks the canary node 10-38 Knowledge representation technique

39 Exception Handling –Inheritance is a powerful feature in semantic network, but it can cause problem –Example: penguin node is linked to the bird node, it inherot the information TRAVEL-FLY. –This is a mistake, you can correct via a technique called exception handling –A walk node is attached to the penguin node using a TRAVEL link. –Since a node first looks locally for an answer to a question, an answer of “Walk” is provided to a travel question. 10-39 Knowledge representation technique

40 Question 4 Construct a semantic network for the following situation: Mini is a robin; it lives in a nest, which is on a pine tree in Ms. Wang’s backyard. Robins are birds; they can fly and they have wings. They are an endangered species, and they are protected by government regulations. 10-40 Knowledge representation technique

41 4.Frames –A data structural for representing all knowledge about a particular object. –Content of frame: It has a name Slots: a set of attributes Facets: –attribute values –Default –Range –If added –If changed © 2005 Prentice Hall, Decision Support Systems and Intelligent Systems, 7th Edition, Turban, Aronson, and Liang 10-41 Knowledge representation technique

42 10-42 Knowledge representation technique Frame Name: Properties: unknowncolor WormsEats 2No_Wings TrueFlies UnknownHungry UnknownActivity Bird

43 Parent Frame –A class frame represents the general characteristics of some set of common objects (parent frames). –In each class frame, you define those properties that are common to all the objects within the class, and possibly default values © 2005 Prentice Hall, Decision Support Systems and Intelligent Systems, 7th Edition, Turban, Aronson, and Liang 10-43 Knowledge representation technique

44 Instance frame (child frame) –Describe a specific instance of a class frame –It inherits both properties and property values from the class –You can then change the property values to tailor the description of the object represented by the instance frame and add unique properties. 10-44 Knowledge representation technique

45 10-45 Frame Name: Class Properties: yellowColor WormsEats 1No_Wings Flies UnknownHungry UnknownActivity CageLive Tweety Bird

46 If needed facet –The facet is used in a case when no slot value is given. It triggers a procedure that goes out or computes a value. 10-46 Knowledge representation technique IF Tweety:no_wings <2 Then tweety:Flies = False IF Tweety:no_wings =2 THEN Tweety:Flies = True IF Self:no_wings <2 Then Self:Flies = False IF Self:no_wings =2 THEN Self:Flies = True

47 IF- Changed Facet –A method can also be attached to a that performs some action whenever its value changes 10-47 Knowledge representation technique IF Self: Hungry = True Then Self: Activity = Eating #Self: Eats

48 Hierarchy of Frame –Most AI systems use a collection of frames linked together in a certain way to show their relationships –The root of the tree is at the top –The frames at the bottom called leaves –Each frame inherits the characteristics of all related frames of the higher levels 10-48 Knowledge representation technique

49 © 2005 Prentice Hall, Decision Support Systems and Intelligent Systems, 7th Edition, Turban, Aronson, and Liang 10-49 Knowledge representation technique

50 © 2005 Prentice Hall, Decision Support Systems and Intelligent Systems, 7th Edition, Turban, Aronson, and Liang 10-50 5. Prepare a set of frames of an organization given the following information: Company: 1,050 employees, $130 million annual sales, Mary Sunny is the president Departments: accounting, finance, marketing, production, personnel Production department: five lines of production Product: computers Annual budget: $50,000 + $12,000  number of computers produced Materials: $6,000 per unit produced Working days: 250 per year Number of supervisors: one for every 12 employees Range of number of employees: 400-500 per shift (two shifts per day). Overtime or part-time on a third shift is possible.

51 5.Logic © 2005 Prentice Hall, Decision Support Systems and Intelligent Systems, 7th Edition, Turban, Aronson, and Liang 10-51 Knowledge representation technique

52 Decision table and decision tree –Can represent knowledge of relations –In decision table, knowledge is organized in a spreadsheet format with rows and columns –Decision tree can simplify the the knowledge acquisition process –Decision trees can be easily converted to rules 10-52 Knowledge representation technique

53 © 2005 Prentice Hall, Decision Support Systems and Intelligent Systems, 7th Edition, Turban, Aronson, and Liang 10-53

54 Reasoning in Rule-Based Systems Once the knowledge representation in the knowledge base is completed, it is ready o be used. A computer program is needed to access the knowledge for making inferences. This program is an algorithm that controls a reasoning process and is usually called the inference engine or rule interpreter There are two methods for controlling inferences in rule based ES –Forward chaining –Backward chaining © 2005 Prentice Hall, Decision Support Systems and Intelligent Systems, 7th Edition, Turban, Aronson, and Liang 10-54

55 © 2005 Prentice Hall, Decision Support Systems and Intelligent Systems, 7th Edition, Turban, Aronson, and Liang 10-55

56 EXAMPLE 1 Suppose you want to fly from Denver to Tokyo and there are no direct fights between the two cities. Therefore, you try to find a chain of connecting flights starting from Denver and ending in Tokyo. There are two basic ways you can search for this chain of flights: © 2005 Prentice Hall, Decision Support Systems and Intelligent Systems, 7th Edition, Turban, Aronson, and Liang 10-56 Reasoning in Rule-Based Systems

57 Start with all the flights that arrive in Tokyo and find the city where each flight originated. Then look up all the flights arriving at these cities and determine where they originated. Continue the process until you find Denver. Because you are working backward from your goal (Tokyo), this search process is called backward chaining (or goal-driven). List all the flights leaving Denver and note their destination cities. Then look up all the flights leaving these cities and find where they land; continue this process until you find Tokyo. In this case, you are working forward from Denver toward your goal, and so this search process is called forward chaining ( or data-driven). © 2005 Prentice Hall, Decision Support Systems and Intelligent Systems, 7th Edition, Turban, Aronson, and Liang 10-57 Reasoning in Rule-Based Systems

58 Chaining: Linking a set of pertinent rules Forward chaining. If the premise clauses match the situation, then the process attempts to assert the conclusion Backward chaining. If the current goal is to determine the correct conclusion, then the process attempts to determine whether the premise clauses (facts) match the situation © 2005 Prentice Hall, Decision Support Systems and Intelligent Systems, 7th Edition, Turban, Aronson, and Liang 10-58 Reasoning in Rule-Based Systems

59 Backward Chaining –Is a goal driven approach in which you start from an expectation of what is going to happen (hypothesis) and then seek evidence that supports (or contradict) your expectations © 2005 Prentice Hall, Decision Support Systems and Intelligent Systems, 7th Edition, Turban, Aronson, and Liang 10-59 Reasoning in Rule-Based Systems

60 Consider the following production rules: R1: IF a person has $10,000 to invest and she has a college degree; Then she should invest in security R2:IF a person’s annual income is at least $40,000 and she has a college degree, THEN she should invest in growth stocks R3:IF a person is younger than 30, and if she is investing in security, THEN she should invest in growth stocks R4:IF a person is younger than 30, and older than 22, THEN she has a college degree R5:IF a person wants to invest in growth stock, THEN the stock should be IBM Goal: To determine whether to invest in IBM stock. 60 Example

61 How to solve it? We firstly convert these rules in a simple form that we could work with. We denote: A = Have $10,000 B = Younger than 30 C = Education at college level D = Annual income of at least $40,000 E = Invest in securities F = Invest in growth stocks G = Invest in IBM stock (the potential goal) 61

62 62 The facts: We assume that an investor has $10,000 (i.e., that A is true) and that she is 25 years old (B is true). She would like advice on investing in IBM stock(yes or no for the goal). Then Rules would then be: R1: IF A and C, THEN E R2: IF D and C, THEN F R3: IF B and E, THEN F R4: IF B, THEN C R5: IF F, THEN G

63

64

65

66

67 © 2005 Prentice Hall, Decision Support Systems and Intelligent Systems, 7th Edition, Turban, Aronson, and Liang 10-67 The following is the rule set of a simple weather forecast expert system: 1 IF cyclone THEN clouds 2 IF anticyclone THEN clear sky 3 IF pressure is low THEN cyclone 4 IF pressure is high THEN anticyclone 5 IF arrow is down THEN pressure is low 6 IF arrow is up THEN pressure is high a) Use forward chaining to reason about the weather if the working memory contains the fact: arrow is down. b) Use the backward chaining to reason about the weather if its cloudy or not given the fact that: arrow is up

68 © 2005 Prentice Hall, Decision Support Systems and Intelligent Systems, 7th Edition, Turban, Aronson, and Liang 10-68 Reasoning in Rule-Based Systems

69


Download ppt "1 Expert Systems Lecture 3 Knowledge Representation Technique."

Similar presentations


Ads by Google