Expert System Knoweldge Representation

11
1 Knowledge Representation and key concepts Harmony Kwawu [email protected] 1 30 December 2016 2 Knowledge Representation 30 December 2016 2 3 Compare and contrast various knowledge representation techniques 30 December 2016 3 4 Knowledge Representation Formalism Definition and brief explanation Categories of Representation Formalism Logic Simple Proposition Logic Simple Predicate Logic Production Rule Semantic Network Frames and Frame hierarchy Selecting KR Formalism for your project Key points to take away 30 December 2016 4 5 Intelligent behaviour is not so much about method of reasoning but the amount of knowledge available to reason with. Human experts and computer agents need access to information and knowledge in order to reach reasoned decision, form judgement or solve a problem. In computing and expert systems in particular, deciding on the right way to organise information so that it’s easy for a system to access and use when needed can be tricky but essential 30 December 2016 5 6 This presentation is devoted rather briefly to various techniques used to represent knowledge in expert systems. We will first define the goal of Knowledge Representation (KR). This is followed with a quick discussion of concepts such as Artificial Intelligence agents and logic as a KR formalism. In a previous slide (key expert system concepts) we explored rule base knowledge representation. In this follow on, we examine Proposition logic and First order predicate logic as ways of organising knowledge in expert systems. We conclude by encouraging the reader to test their knowledge by completing the end of text quiz 30 December 2016 6

Transcript of Expert System Knoweldge Representation

Page 1: Expert System Knoweldge Representation

1

Knowledge Representation and key concepts

Harmony [email protected]

30 December 2016 2

Knowledge Representation

30 December 2016 2

3

� Compare and contrast various knowledge representation techniques

30 December 2016 3 4

� Knowledge Representation Formalism

� Definition and brief explanation

� Categories of Representation Formalism

� Logic

� Simple Proposition Logic

� Simple Predicate Logic

� Production Rule

� Semantic Network

� Frames and Frame hierarchy

� Selecting KR Formalism for your project

� Key points to take away

30 December 2016 4

5

� Intelligent behaviour is not so much about method of reasoning but the amount of knowledge available to reason with.

� Human experts and computer agents need access to

information and knowledge in order to reach reasoned

decision, form judgement or solve a problem.

In computing and expert systems in particular, deciding

on the right way to organise information so that it’s easy

for a system to access and use when needed can be

tricky but essential

30 December 2016 5 6

� This presentation is devoted rather briefly to various techniques used to represent knowledge in expert systems. We will first define the goal of Knowledge Representation (KR).

� This is followed with a quick discussion of concepts such as Artificial Intelligence agents and logic as a KR formalism.

� In a previous slide (key expert system concepts) we explored rule base knowledge representation. In this follow on, we examine Proposition logic and First order predicate logic as ways of organising knowledge in expert systems.

� We conclude by encouraging the reader to test their knowledge bycompleting the end of text quiz

30 December 2016 6

Page 2: Expert System Knoweldge Representation

7

The Goal of Knoweldge Representation techniques

30 December 2016 7 8

� The purpose of knowledge representation is to ensure expert system agents have access to the knowledge (combination of relevant facts and rules) they need to reason and reach conclusion

� Knowledge representation is an active part of knowledge base systems and AI Applications development

� It is dedicated to presenting information in a form that a computer agent can access, understand and use.

� knowledge in expert system can be represented in many different ways to satisfy different knowledge requirements, format and problem domains

30 December 2016 8

9

Working

memory

Knowledge

base

Interface

Engine

Experts Knowledge Engineer Developer

End user

With computer

& interface

Receives

expert advice

Ask question

or query

9 10

What is meant by Artificial Intelligence

Agent?

30 December 2016 10

11

� An artificial intelligence agents (like software Robots, chat bots etc) are a special purpose computer application designed to serve a particular purpose or provide a distinct service.

� Examples are; web crawlers in search engines, chat bots (SIRI & Cortana ), business analytics Bots (Cortanaintelligence) etc

� They are generally autonomous and acts in collaboration with other agents or compete with other agents for computer resources

30 December 2016 11 12

I. What is knowledge in knowledge base?

II. Is knowledge the same as fact or information?

30 December 2016 12

Page 3: Expert System Knoweldge Representation

13

Logic as a Knowledge Representation formalism

30 December 2016 13 14

� Logic is broadly defined as the area of science dedicated to understanding methods for evaluating reasoned arguments.

� Put simply, logic is the school of thought devoted to assessing valid reasoning.

30 December 2016 14

15

� Logic is an important and useful tool when evaluating argument and reasoning.

� Without logic, it would be difficult if not impossible to evaluate the soundness or validity of an argument

� Reason, not instinct is the guiding principle for all rational human beings, so say the philosophers

30 December 2016 15 16

Human Doctor?

Mycin Expert System

OR

30 December 2016 16

17

Logical Argument

30 December 2016 17 18

� Generally, an argument is made up of two parts: Making a proposition and drawing conclusion from it

� Note that a proposition is an expression or statement that can be believed, or is either true or false (www.merriam-webster.com)

� For example: I propose that all human beings are created equal. This statement is open to agreement or rejection after careful consideration

� Either way, the fact that the statement above has an expression and a possible outcome makes it a valid argument

30 December 2016 18

Page 4: Expert System Knoweldge Representation

19

� The value of logic is more than a tool for verifying lines of reasoning

� Logic offers an effective way to organise knowledge

� In computing for example, principles of logic are used to design electronic circuits board and for representing knowledge in intelligent systems such as AI Technologies

30 December 2016 19 20

� Logic can be expressed in many different forms depending on complexity of the situation and application environment.

� Examples of logic used in representing knowledge in AI applications are:

� Proposition logic

� First order predicate logic

� Fuzzy logic

� Both Proposition logic and First order predicate logic are briefly discussed below

30 December 2016 20

21

Proposition Logic

30 December 2016 21 22

� Often humans generally and experts in particular makes statements that may turn out to be true or false.

� Statement of truth or false as we have learned previously is called proposition

� A single proposition can be true and not false at the same time.

� Confusing, you are not along. It get clearer over time

30 December 2016 22

23

� To recap recall that concept describing proposition and conclusion statement is known as proposition logic.

� Proposition logic is therefore a statement of truth or false andpossible outcome

� This can be illustrated as below:

Proposition or

expressionEvaluate

Outcome

Outcome

Y

N

30 December 2016 23 24

� The following statements are propositions

1)James put in a lot more effort in her studies than most students.

1b)Conclusion: He achieve high grade in all his exams

2)All priests are kind and loving

2b)conclusion: Count Dracula is a priest

3)Mothers are more protective of their children than fathers

3b)conclusion: Maria is a mother because she is protective of her children

30 December 2016 24

Page 5: Expert System Knoweldge Representation

25

� Each set of the above propositions can be expressed in proposition logic as follow:

� If James puts in a lot more effort in his studies than most THEN James will achieve high grade in all her exams

� IF Count Dracula is a priest THEN Count Dracula is kind and loving

� Mothers are more protective of their children than fathers this IMPLIES that Maria is more protective of her children than their father

30 December 2016 25 26

Rules of logical inference for

compound proposition

30 December 2016 26

27

� Two or more propositions can be combined to form a chain of statements using what is known as connectives

� Examples of connectives are: AND, OR, NOT and IMPLICATION

30 December 2016 27 28

� Negation NOT {e.g. X is true if the proposition is false}

� Conjunction AND {e.g. only true if all possible propositions are true}

� Disjunction OR {e.g. only true if one of the proposition is true}

� Implication {this depends on what the proposition implies. If a proposition implies another is true or false then that is considered to be the case.}

30 December 2016 28

29

Truth Table as proposition evaluate tool and more

30 December 2016 29 30

� Truth Tables are generally used to evaluate compound proposition.

� They can be used to produce possible combinations of all truth values of basic propositions.

30 December 2016 30

Page 6: Expert System Knoweldge Representation

31

Try to workout and complete the truth table in

the slide below

30 December 2016 31 32

� The truth table below is for evaluating loan decision for bank customers: copy and use your own knowledge from previous class discussions to complete the table

30 December 2016 32

33

The rule of Inference

Bank customer (B)

Has good credit record (G)

Negation

(NOT)

Conjunction

(AND)

Disjunction

(OR)

Implication(any thing goes inference)

T T

T F

F T

F F

See the end of slide for solution

30 December 2016 33 34

How did you do: show your answer to and discuss it with a friend

30 December 2016 34

35

Application of Proposition Logic

30 December 2016 35 36

� Proposition logic can be used in implementing the following:

� Translation of business rules

� Implementing Rule Based Expert Systems

� Design of logic gates circuit board for computing devices

� Any more? Please add your own example to extend the list

30 December 2016 36

Page 7: Expert System Knoweldge Representation

37

Basic Predicate Logic as another form of KR Techniques

30 December 2016 37 38

� While it’s possible to make a number of compound statements using proposition logic, it’s often difficult to apply it to more complex situations

� Proposition logic is not appropriate for expressing and representing assertions in fields such as mathematics and physics

30 December 2016 38

39

� To overcome this limitation, a new type of logic was introduced. This is known as predicate logic

� Detail discussion of predicate logic is beyond the scope of thismodule, we would therefore limit ourselves to basic definition and application of it

30 December 2016 39 40

� Predicate logic provides formalism for performing a more complex analysis of proposition and additional methods for reasoning with quantified expressions.

� Predicate logic allow proposition to be broken into components.

� The two main components are: argument and predicates.

30 December 2016 40

41

� It can be used to represent and evaluate statements such as:

� X is Equivalence to Y

� 6 is greater than 4

� M is Less than K, etc

30 December 2016 41 42

� Predicates are verbs or action phrases that describes a property of objects, events or a relationship.

� Object in predicate logic are represented by variables.

� Predicate may be used to illustrate actions or relationship

30 December 2016 42

Page 8: Expert System Knoweldge Representation

43

Predicate and proposition logic difference

30 December 2016 43 44

� Compared to proposition logic, which can only be used to make simple true or false statements, predicate logics are more expressive.

� In addition to the connectives used in propositional logic, predicate logic also uses variables, constants, action phrases (predicates) and universal qualifiers to make more expressive proposition statements.

30 December 2016 44

45

� Universal quantifiers in proposition logic are used when making general inference about objects. For example, when referring to all objects in a population.

� Such as all our student are male

� This is detonated by the symbol (for all) and existential quantifiers (for one object) out of many

30 December 2016 45 46

� The following statement, “Every one of our students comes from UK”

• This is interpreted as: for any object y, if y is a student, THEN y comes from UK

30 December 2016 46

47

� Identify the subjects and predicates in the statement below:

� All students goes to college 5 days in a week

� Michael is a Nigerian male and drives a Green car

� All the men from UK are very tall

30 December 2016 47 48

� Other knowledge representation formalisms include:

� Rules base knowledge represntation,

� Semantics network, and

� Frames

30 December 2016 48

Page 9: Expert System Knoweldge Representation

49

What is Semantic Network Anyway?

30 December 2016 49 50

� Semantic network, also known as concept network is any such formalism which aims to capture and express meaning (semantics) in a graphical form.

� Semantics network could be used for propositional atomic information analysis.

� A proposition is always true or false and is called atomic because the truth value in such a proposition can not be further divided

30 December 2016 50

51

� Semantic network consists of nodes and arch connecting them.

Nodes are objects and arches are used to describe links between nodes.

� The links are used to express relationship between the nodes anddependencies

� One major strength of semantic network is that it can be used torepresent how humans store and manipulate knowledge

30 December 2016 51 52

� Semantic network was originally designed to represent human memory and understanding

� It can be used to:

� Workout common interest among a group of customers, household, group of students etc

� Determining the difference between people, their age, occupation, education and other related properties

� Areas of application include:

� Search engines

30 December 2016 52

53

Hospital

Patient

Female

Patient

Male

Patient

Osy Stella

Edward Mary AfumeIs the husband of

Is the son of Is mother of

Lives at the same address

Is a Is a

Is a Is a

Is the doctor of

Hospital patient

semantic network

30 December 2016 53 54

Expert Systems Frame

30 December 2016 54

Page 10: Expert System Knoweldge Representation

55

� Frame knowledge representation formalisms are used for information that are multi-faceted and hierarchical

� This is similar to how data is described, structured and stored in object oriented or enhanced entity relational databases.

� Data or information fields in frames are known as slots and values stored in the slots are known as fillers

30 December 2016 55 56

Student Frame

Course

Lecturer:

SName:

SContact:

Type:

Course level:

Lecturer Frame

Specialism

Lecturername:

Assignments:

SContact:

Research Interest

Course level:

Student and lecturer Frame

30 December 2016 56

57

� Each slot in a frame contain information in various representations, including logical sentences and production rules.

� A slot in frames can also contain another frame, to form a hierarchical relationship.

� Each frame represents object or situation and can be accessed bythe inference engine

30 December 2016 57 58

Student

Frame

Hierarchy

PartTime Student

academic Grade

Frame

International FullTime

Student Frame

PartTime student

address Frame

Home FullTime

Student Frame

FullTime student

address frame

Frame Hierarchy

30 December 2016 58

59

� Frame are used to arrange knowledge about objects, situations, events and their associations for expert systems

� Frame as knowledge representation formalism can store information about an object, events as well as any methods and procedural associated with them

30 December 2016 59 60

� KR is using different methods to organise informatiion and presenting it in a way that is accessible to the inference engine of expert system

� Where knowledge is presented according to the the problem the system is designed to solve

� Knoweldge in Expert System can be presented as Rules, Semantics network, Logic or Frames

30 December 2016 60

Page 11: Expert System Knoweldge Representation

61

� What is knowledge representation?

� Why are there different knowledge representation techniques and system?

� Which one is best and why?

30 December 2016 61 62

� Fuzzy logic and Expert system Project ideas and

challenges

30 December 2016 62

63

The rule of inference

Bank customer (B)

Has good credit record (G)

Negation

(NOT)

Conjunction

(AND)

Disjunction

(OR)

Implication(any thing goes inference)

T T F T T T

T F F F T F

F T F F T T

F F T F F T

30 December 2016 63 64

� To find out more, logon to the web site below:

http://groups.csail.mit.edu/medg/ftp/psz/k-rep.html

30 December 2016 64

65

END

30 December 2016 65