+ All Categories
Home > Documents > Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example...

Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example...

Date post: 09-May-2020
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
101
ES-1 © Gunnar Gotshalks Expert Systems Knowledge Based Systems
Transcript
Page 1: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-1 © Gunnar Gotshalks!

Expert Systems!Knowledge Based Systems!

Page 2: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-2 © Gunnar Gotshalks!

Example Areas of Use!

◊  Medical diagnosis!» Disease identification!

Page 3: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-3 © Gunnar Gotshalks!

Example Areas of Use – 2!

◊  Medical diagnosis!»  Disease identification!

◊  Natural resource exploration!» Analyzing geological data !

Page 4: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-4 © Gunnar Gotshalks!

Example Areas of Use!

◊  Medical diagnosis!»  Disease identification!

◊  Natural resource exploration!»  Analyzing geological data !

◊  Customizing complex equipment!» Computer systems!

Page 5: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-5 © Gunnar Gotshalks!

Properties!

◊  Behaves like an expert in a narrow area !

Page 6: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-6 © Gunnar Gotshalks!

Properties – 2!

◊  Behaves like an expert in a narrow area !

◊  Has a knowledge base of the information in the area !

Page 7: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-7 © Gunnar Gotshalks!

Properties – 3!

◊  Behaves like an expert in a narrow area !

◊  Has a knowledge base of the information in the area !

◊  Ability to explain its behaviour!

Page 8: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-8 © Gunnar Gotshalks!

Properties – 4!

◊  Behaves like an expert in a narrow area !

◊  Has a knowledge base of the information in the area !

◊  Ability to explain its behaviour!

◊  Ability to deal with uncertain data!

Page 9: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-9 © Gunnar Gotshalks!

Structure!

!

Knowledge base Inference Engine User Interface

Shell

Page 10: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-10 © Gunnar Gotshalks!

If … Then … Else rules!

◊  The most popular form of knowledge representation!

◊  Typical types of rules!»  If condition P holds then conclude C !

»  If situation S exists then do action A !

»  If conditions P and Q hold then! !conditions C1 and C2 cannot hold!

Page 11: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-11 © Gunnar Gotshalks!

Kitchen leak example!

◊  Figure 15.5 in Bratko!

» How do you read the graph?!

Page 12: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-12 © Gunnar Gotshalks!

Kitchen leak example – 2!

◊  Figure 15.5 in Bratko!» Can see how if…then…else rules can represent the

graph on the left hand side !

» Note the use of AND / OR for inputs!> Arc represents AND of inputs!> No arc represents OR of inputs!

Page 13: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-13 © Gunnar Gotshalks!

Other examples!

◊  See Figures 15.2 & 15.4 in Bratko!

!

Page 14: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-14 © Gunnar Gotshalks!

Properties of if…then…else rules!

◊  Moduarity!» Each rule or group of rules encapsulates a part of

the domain!

Page 15: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-15 © Gunnar Gotshalks!

Properties of if…then…else rules – 2!

◊  Moduarity!»  Each rule or group of rules encapsulates a part of the domain!

◊  Incrementabiity!» Add / delete rules as needed!

Page 16: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-16 © Gunnar Gotshalks!

Properties of if…then…else rules – 3!

◊  Moduarity!»  Each rule or group of rules encapsulates a part of the domain!

◊  Incrementabiity!»  Add / delete rules as needed!

◊  Modifiability!» Can modify small parts of the knowledge as

needed!

Page 17: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-17 © Gunnar Gotshalks!

Properties of if…then…else rules – 4!

◊  Moduarity!»  Each rule or group of rules encapsulates a part of the domain!

◊  Incrementabiity!»  Add / delete rules as needed!

◊  Modifiability!»  Can modify small parts of the knowledge as needed!

◊  Supports transparency!» Relatively easy to explain and guide system’s

behaviour!

Page 18: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-18 © Gunnar Gotshalks!

Probabilistic behaviour!

◊  Can extend rule syntax to include probability information!»  If condition A then! ! conclude C with probability P!

» See Figure 15.3 in Bratko!

Page 19: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-19 © Gunnar Gotshalks!

Inference Engine!

» With if…then…else rules there are two ways of making inferences.!

» What are they? !

Page 20: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-20 © Gunnar Gotshalks!

Inference Engine – 2!

» With if…then…else rules there are two ways of making inferences.!

» What are they? !

> Backward chaining !

> Forward chaining!

Page 21: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-21 © Gunnar Gotshalks!

Backward chaining!

» What is backward chaining?!

Page 22: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-22 © Gunnar Gotshalks!

Backward chaining – 2!

» What is backward chaining?!> The way Prolog works from conclusions to the

base facts, the confirmed facts, the evidence!

> See pages 348..349!

Page 23: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-23 © Gunnar Gotshalks!

Problems with backward chaining!

» What are the problems with backward chaining?!

Page 24: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-24 © Gunnar Gotshalks!

Problems with backward chaining – 2!

» What are the problems with backward chaining?!

> Syntax is not suitable of people unfamiliar with Prolog!

> Cannot distinguish knowledge base from the rest of the system!

!

Page 25: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-25 © Gunnar Gotshalks!

Problems with backward chaining – 3!

» What are the problems with backward chaining?!> Syntax is not suitable of people unfamiliar with

Prolog!> Cannot distinguish knowledge base from the

rest of the system!

» How can we overcome these problems?!!

Page 26: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-26 © Gunnar Gotshalks!

Problems with backward chaining – 4!

» What are the problems with backward chaining?!> Syntax is not suitable of people unfamiliar with

Prolog!> Cannot distinguish knowledge base from the

rest of the system!

» How can we overcome these problems?!> Customize the syntax with new operators!

–  Bottom of page 349 !

Page 27: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-27 © Gunnar Gotshalks!

Problems with backward chaining – 5!

» What are the problems with backward chaining?!> Syntax is not suitable of people unfamiliar with

Prolog!> Cannot distinguish knowledge base from the

rest of the system!

» How can we overcome these problems?!> Customize the syntax with new operators!

–  Bottom of page 349���

Page 28: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-28 © Gunnar Gotshalks!

Problems with backward chaining – 6!

» What do we need to do?!

Page 29: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-29 © Gunnar Gotshalks!

Problems with backward chaining – 6!

» What do we need to do?!> Build an inference engine for the new rules!

–  Figure 15.6 and program text

Page 30: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-30 © Gunnar Gotshalks!

Forward chaining!

» What is forward chaining?!

Page 31: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-31 © Gunnar Gotshalks!

Forward chaining – 2!

» What is forward chaining?!> Work from the base facts, the confirmed facts,

the evidence, to the conclusion!

Page 32: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-32 © Gunnar Gotshalks!

Forward chaining – 3!

» What is forward chaining?!> Work from the base facts, the confirmed facts,

the evidence, to the conclusion!

» What do we need to do?!

Page 33: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-33 © Gunnar Gotshalks!

Forward chaining – 4!

» What is forward chaining?!> Work from the base facts, the confirmed facts,

the evidence, to the conclusion!

» What do we need to do?!> Build a forward chained inference engine!

–  Figure 15.7 and program text

Page 34: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-34 © Gunnar Gotshalks!

Forward vs backward chaining!

◊  Abstract view !

Backward chaining <---------!input information à … à derived information!

-------> Forward chaining!!See Figure 15.5 !

Page 35: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-35 © Gunnar Gotshalks!

Forward vs backward chaining – 2!

◊  More concrete views!» data à … à goals!» evidence à … à hypotheses!» findings, observations à … à explanations, diagnosis!» manifestations à … à diagnoses, causes!

Page 36: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-36 © Gunnar Gotshalks!

Which is better!

◊  Forward chaining?!

◊  Backward chaining?!

Page 37: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-37 © Gunnar Gotshalks!

Which is better!

◊  Depends upon the problem!

Page 38: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-38 © Gunnar Gotshalks!

Which is better – 2!

◊  Depends upon the problem!» Check if a hypothesis is true!

> Work backward!

Page 39: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-39 © Gunnar Gotshalks!

Which is better – 3!

◊  Depends upon the problem!» Check if a hypothesis is true!

> Work backward!

» Many hypotheses, cannot choose!> Work forward!

Page 40: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-40 © Gunnar Gotshalks!

Which is better – 3!

◊  Depends upon the problem!» Check if a hypothesis is true!

> Work backward!» Many hypotheses, cannot choose!

> Work forward!

◊  Forward is better when!» Accumulating evidence, data!

Page 41: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-41 © Gunnar Gotshalks!

Shape heuristic!

» When input information is sparse relative to derived information!

» Work forward or backward?!

Page 42: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-42 © Gunnar Gotshalks!

Shape heuristic – 2!

» When input information is sparse relative to derived information!

» Work forward or backward?!> Use forward chaining!

!

Page 43: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-43 © Gunnar Gotshalks!

Shape heuristic – 3!

» When input information is sparse relative to derived information!

» Work forward or backward?!> Use forward chaining!

» When input information is rich relative to derived information!

» Work forward or backward?!

Page 44: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-44 © Gunnar Gotshalks!

Shape heuristic – 5!

» When input information is sparse relative to derived information!

» Work forward or backward?!> Use forward chaining!

» When input information is rich relative to derived information!

» Work forward or backward?!> Use backward chaining!

Page 45: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-45 © Gunnar Gotshalks!

Reality!

◊  Do we work forward or backward?!

Page 46: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-46 © Gunnar Gotshalks!

Reality – 2!

◊  As tasks get more complex!» Better to interleave forward and backward chaining!

Page 47: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-47 © Gunnar Gotshalks!

Reality Example!

◊  Doctor uses initial observations, evidence to form hypothesis!

!

Page 48: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-48 © Gunnar Gotshalks!

Reality Example – 2!

◊  Doctor uses initial observations, evidence to form hypothesis!» Forward direction!

!

Page 49: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-49 © Gunnar Gotshalks!

Reality Example – 3!

◊  Doctor uses initial observations, evidence to form hypothesis!» Forward direction!

◊  Pursues most likely hypothesis!

Page 50: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-50 © Gunnar Gotshalks!

Reality Example – 4!

◊  Doctor uses initial observations, evidence to form hypothesis!» Forward direction!

◊  Pursues most likely hypothesis!» Backward direction to find if there is confirming

evidence!

!

Page 51: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-51 © Gunnar Gotshalks!

Reality Example – 5!

◊  Doctor uses initial observations, evidence to form hypothesis!» Forward direction!

◊  Pursues most likely hypothesis!» Backward direction to find if there is confirming

evidence!

◊  Can lead to forming new hypotheses!

Page 52: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-52 © Gunnar Gotshalks!

Reality Example – 6!

◊  Doctor uses initial observations, evidence to form hypothesis!» Forward direction!

◊  Pursues most likely hypothesis!» Backward direction to find if there is confirming

evidence!

◊  Can lead to gathering more evidence, need new hypothesis!» Forward direction, again!

Page 53: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-53 © Gunnar Gotshalks!

Reality Example 2!

◊  Also top page 353!

Page 54: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-54 © Gunnar Gotshalks!

Generating explanations!

» There are two types of explanationWhat are they?!

Page 55: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-55 © Gunnar Gotshalks!

Generating explanations!

» There are two types of explanationWhat are they?!

> How !

> Why!

Page 56: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-56 © Gunnar Gotshalks!

Generating explanations – how!

◊  How did you find the answer?!» What do you present?!

Page 57: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-57 © Gunnar Gotshalks!

Generating explanations – how – 2!

◊  How did you find the answer?!» What do you present?!

> Typically present a path trace!

Page 58: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-58 © Gunnar Gotshalks!

Generating explanations – how – 3!

◊  How did you find the answer?!» What do you present?!

> Typically present a path trace !

» There is a problem in the kitchen, which was concluded from the hall being wet and the bathroom dry!

> And!» No water came from the outside, which was

concluded from the window being closed!

Page 59: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-59 © Gunnar Gotshalks!

Proof tree!

◊  The how answer is to print out the proof tree!» Top page 354, Figure 15.8!

> Given program text!> Compare with Figure 15.6!

Page 60: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-60 © Gunnar Gotshalks!

Proof tree – 2!

◊  The how answer is to print out the proof tree!» Top page 354, Figure 15.8!

> Given program text!> Compare with Figure 15.6!

◊  The main work is printing the result in a readable format!

Page 61: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-61 © Gunnar Gotshalks!

Generating explanations – why!

◊  The why explanation is required during the reasoning process!» What do you present?!

Page 62: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-62 © Gunnar Gotshalks!

Generating explanations – why – 2!

◊  The why explanation is required during the reasoning process!» What do you present?!

> The system asks the user for information!

Page 63: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-63 © Gunnar Gotshalks!

Generating explanations – why – 3!

◊  The why explanation is required during the reasoning process!» The system asks the user for information!

» The user may ask why!

Page 64: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-64 © Gunnar Gotshalks!

Generating explanations – why – 4!

◊  The why explanation is required during the reasoning process!» The system asks the user for information!

» The user may ask why!

» The system then gives an explanation!

Page 65: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-65 © Gunnar Gotshalks!

Generating explanations – why – 5!

◊  The why explanation is required during the reasoning process!» The system asks the user for information!

» The user may ask why!

» The system then gives an explanation!

> Pages 354 .. 355!

Page 66: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-66 © Gunnar Gotshalks!

Generating explanations – why – 5!

◊  The why explanation is required during the reasoning process!» The system asks the user for information!

» The user may ask why!

» The system then gives an explanation!

> Pages 354 .. 355 !

> Figure 15.9 and program text!

Page 67: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-67 © Gunnar Gotshalks!

On introducing uncertainty!

◊  Chapter 15 introduces an ad hoc way of dealing with probabilities!

Page 68: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-68 © Gunnar Gotshalks!

On introducing uncertainty – 2!

◊  Chapter 15 introduces an ad hoc way of dealing with probabilities!» We will not look at these methods!

Page 69: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-69 © Gunnar Gotshalks!

On introducing uncertainty – 3!

◊  Chapter 15 introduces an ad hoc way of dealing with probabilities!» We will not look at these methods !

» We defer to Chapter 16 where we handle probabilities in a proper mathematical way!

Page 70: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-70 © Gunnar Gotshalks!

On introducing uncertainty – 4!

◊  Chapter 15 introduces an ad hoc way of dealing with probabilities!» We will not look at these methods !

» We defer to Chapter 16 where we handle probabilities in a proper mathematical way!

> Use Bayesian networks!

Page 71: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-71 © Gunnar Gotshalks!

On introducing uncertainty – 5!

◊  Chapter 15 introduces an ad hoc way of dealing with probabilities!» We will not look at these methods !

» We defer to Chapter 16 where we handle probabilities in a proper mathematical way!

> Use Bayesian networks!> A sound and correct way of dealing with

probability and uncertainty!

Page 72: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-72 © Gunnar Gotshalks!

On introducing uncertainty – 6!

◊  Chapter 15 introduces an ad hoc way of dealing with probabilities!» We will not look at these methods !

» We defer to Chapter 16 where we handle probabilities in a proper mathematical way!

> Use Bayesian networks!> A sound and correct way of dealing with

probability and uncertainty!> Modern approach!

Page 73: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-73 © Gunnar Gotshalks!

Semantic networks & frames!

◊  Structure facts so as to elicit information!

Page 74: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-74 © Gunnar Gotshalks!

Semantic networks & frames – 2!

◊  Structure facts so as to elicit information!

◊  Introduce concepts that were adapted by object-oriented programming!

Page 75: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-75 © Gunnar Gotshalks!

Semantic networks & frames – 3!

◊  Structure facts so as to elicit information!

◊  Introduce concepts that were adapted by object-oriented programming!

◊  Amounts to adopting a particular style of programming and organizing a program!

Page 76: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-76 © Gunnar Gotshalks!

Semantic networks & frames – 4!

◊  Structure facts so as to elicit information!

◊  Introduce concepts that were adapted by object-oriented programming!

◊  Amounts to adopting a particular style of programming and organizing a program!

» Requires discipline!> The programming environment does not directly

support the style!

Page 77: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-77 © Gunnar Gotshalks!

Semantic networks!

◊  Consist of!» Entities!

Page 78: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-78 © Gunnar Gotshalks!

Semantic networks – 2!

◊  Consist of!» Entities!

» Relations between Entities!

Page 79: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-79 © Gunnar Gotshalks!

Semantic networks – 3!

◊  Consist of!» Entities!

» Relations between Entities!

» Some similarity with Entity-Relation model in databases!

Page 80: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-80 © Gunnar Gotshalks!

Semantic networks – 4!

◊  Consists of!» Entities!

» Relations between Entities!

» Some similarity with Entity-Relation model in databases!

» A graph representation is used!

Page 81: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-81 © Gunnar Gotshalks!

Example semantic network!

◊  Page 361 Bratko, E4!

!

Page 82: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-82 © Gunnar Gotshalks!

Semantic method representation!

◊  The graph is represented in Prolog as a set of facts!» Functor a relation name!» Arguments are the entities at the head and tail of a

relation!

moving_method (kiwi , walk)!colour ( kiwi , brown)!is_a ( ‘Kim’ , kiwi)!active_at ( kiwi , night)!

Page 83: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-83 © Gunnar Gotshalks!

Inheritance representation!

◊  Inheritance can be represented as a custom rule for each relationship!

moving_method ( X , Method ) :-! !is_a ( X , SuperX ) ,! !moving_method ( SuperX , Method) .!

Page 84: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-84 © Gunnar Gotshalks!

Inheritance representation – 2!

◊  Inheritance can be represented as a custom rule for each relationship!

◊  Cumbersome to use extensively!

moving_method ( X , Method ) :-! !is_a ( X , SuperX ) ,! !moving_method ( SuperX , Method) .!

Page 85: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-85 © Gunnar Gotshalks!

Inheritance representation – 3!

◊  Inheritance can be represented as a custom rule for each relationship!

◊  Cumbersome to use extensively!» Need a separate rule for each relation!

moving_method ( X , Method ) :-! !is_a ( X , SuperX ) ,! !moving_method ( SuperX , Method) .!

Page 86: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-86 © Gunnar Gotshalks!

Inheritance representation – 2!

◊  A better way is to have a general rule for is_a based on facts!» Argument to fact is a compound term!

>  relation_name ( Arg1 , Arg2)!

fact ( Fact ) :- Fact , ! .!!fact ( Fact ) :-! !Fact =.. [ Relation , Arg1 , Arg2 ] ,! !is_a ( Arg1 , SuperArg ) ,! !SuperFact =.. [ Relation , SuperArg , Arg2 ] ,! !fact ( SuperFact ) .!

Page 87: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-87 © Gunnar Gotshalks!

Frames!

◊  A frame is data structure whose components are slots!

Page 88: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-88 © Gunnar Gotshalks!

Frames – 2!

◊  A frame is data structure whose components are slots!

◊  Slots have a name and a value!

Page 89: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-89 © Gunnar Gotshalks!

Frames – 3!

◊  A frame is data structure whose components are slots!

◊  Slots have a name and a value!

!

FRAME: bird!!a_kind_of: ! animal!!moving_method: fly!!active_at: ! daylight!

Page 90: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-90 © Gunnar Gotshalks!

Frames – 4!

◊  A frame is data structure whose components are slots!

◊  Slots have a name and a value!» The value can be!

> What?!

!

Page 91: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-91 © Gunnar Gotshalks!

Frames – 5!

◊  A frame is data structure whose components are slots!

◊  Slots have a name and a value!» The value can be!

> Simple values!

!

Page 92: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-92 © Gunnar Gotshalks!

Frames – 6!

◊  A frame is data structure whose components are slots!

◊  Slots have a name and a value!» The value can be!

>  Simple values!

> References to other frames!

!

Page 93: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-93 © Gunnar Gotshalks!

Frames – 7!

◊  A frame is data structure whose components are slots!

◊  Slots have a name and a value!» The value can be!

>  Simple values!>  References to other frames!

> Procedures to compute the slot value!!

!

Page 94: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-94 © Gunnar Gotshalks!

Frames – 8!

◊  A frame is data structure whose components are slots!

◊  Slots have a name and a value!» The value can be!

>  Simple values!>  References to other frames!>  Procedures to compute the slot value!

> Unfilled!

!

Page 95: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-95 © Gunnar Gotshalks!

Frames – 9!

◊  A frame is data structure whose components are slots!

◊  Slots have a name and a value!» The value can be!

>  Simple values!>  References to other frames!>  Procedures to compute the slot value!

> Unfilled!–  How would they be filled?

!

Page 96: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-96 © Gunnar Gotshalks!

Frames – 10!

◊  A frame is data structure whose components are slots!

◊  Slots have a name and a value!» The value can be!

>  Simple values!>  References to other frames!>  Procedures to compute the slot value!

> Unfilled!–  They are filled by inference

!

Page 97: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-97 © Gunnar Gotshalks!

Frame representation in Prolog!

◊  The frame name is the functor for a set of predicates.!

◊  The arguments of the predicate are!» The slot name!» The slot value!

FRAME: bird!!a_kind_of: ! animal!!moving_method: fly!!active_at: ! daylight!

bird ( a_kind_of , animal ).!bird ( moving_method , fly ).!bird ( active_at , daylight ).!

Page 98: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-98 © Gunnar Gotshalks!

Frame inheritance!

◊  Inheritance is shown by having a slot value being the name of a frame!

FRAME: bird!!a_kind_of: ! animal!!moving_method: fly!!active_at: ! daylight!

FRAME: albatross!!a_kind_of: bird!!color: ! fly!!size: ! 115!

Page 99: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-99 © Gunnar Gotshalks!

Frame instance!

◊  A frame instance references the frame of which it is an instance!

FRAME: Albert!!instance_of: albatross!!!

FRAME: albatross!!a_kind_of: bird!!color: ! fly!!size: ! 115!

Page 100: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-100 © Gunnar Gotshalks!

Frame instance – 2!

◊  A frame instance references a frame!

◊  Can override slot values !

FRAME: Albert!!instance_of: albatross!!size: ! 120!!!

FRAME: albatross!!a_kind_of: bird!!color: ! fly!!size: ! 115!

Page 101: Expert Systems Knowledge Based Systems - York University · © Gunnar Gotshalks! ES-3! Example Areas of Use – 2! Medical diagnosis! » Disease identification Natural resource exploration!

ES-101 © Gunnar Gotshalks!

Frame example!

◊  Figure 15.12!

◊  Program text pages 365 .. 366!


Recommended