Knowledge Representation. Introduction Knowledge is organized in knowledge base in one or more...

32
Knowledge Representation Knowledge Representation

Transcript of Knowledge Representation. Introduction Knowledge is organized in knowledge base in one or more...

Page 1: Knowledge Representation. Introduction Knowledge is organized in knowledge base in one or more configurations. A good knowledge representation ‘naturally’

Knowledge Knowledge RepresentationRepresentation

Page 2: Knowledge Representation. Introduction Knowledge is organized in knowledge base in one or more configurations. A good knowledge representation ‘naturally’

IntroductionIntroduction

Knowledge is organized in knowledge base in Knowledge is organized in knowledge base in oneone or or moremore configurations. configurations.

A good knowledge representation ‘naturally’ A good knowledge representation ‘naturally’ represents the represents the problem domainproblem domain

A variety of A variety of knowledge representationknowledge representation schemes exist schemes exist

Can be programmed with programming languagesCan be programmed with programming languages

Contents of knowledge base can be manipulated by Contents of knowledge base can be manipulated by inference mechanism inference mechanism 22

Page 3: Knowledge Representation. Introduction Knowledge is organized in knowledge base in one or more configurations. A good knowledge representation ‘naturally’

Knowledge Representation Schemes:Knowledge Representation Schemes: Logical FormLogical Form

Propositional LogicPropositional Logic Predicate CalculusPredicate Calculus

Production RulesProduction Rules Semantic NetworkSemantic Network ScriptsScripts FramesFrames ListList Decision Table & Decision TreeDecision Table & Decision Tree O-A-V Triplet O-A-V Triplet

33

IntroductionIntroduction

Page 4: Knowledge Representation. Introduction Knowledge is organized in knowledge base in one or more configurations. A good knowledge representation ‘naturally’

A statement that can be either A statement that can be either true or falsetrue or false

Once known, it becomes a premise that can be used to Once known, it becomes a premise that can be used to derive derive new propositions or inferencesnew propositions or inferences

Rules Rules are used to determine the truth (T) or falsity (F) are used to determine the truth (T) or falsity (F) of the new propositionof the new proposition

To create compound propositions use To create compound propositions use connectivesconnectives, , such as AND, OR, NOT, IMPLIESsuch as AND, OR, NOT, IMPLIES

Elementary propositions or statements represented Elementary propositions or statements represented with with statement letters A, B, … statement letters A, B, … 44

Propositional LogicPropositional Logic

Page 5: Knowledge Representation. Introduction Knowledge is organized in knowledge base in one or more configurations. A good knowledge representation ‘naturally’

Simple Proposition:Simple Proposition: Statement: A = The mail carrier comes Monday Statement: A = The mail carrier comes Monday

thru Friday thru Friday Statement: B = Today is SundayStatement: B = Today is Sunday ConclusionConclusion: C = The mail carrier will not come : C = The mail carrier will not come

today today

Propositional logic: Propositional logic: limitedlimited in representing real- in representing real-world knowledge world knowledge 55

Propositional LogicPropositional Logic

Page 6: Knowledge Representation. Introduction Knowledge is organized in knowledge base in one or more configurations. A good knowledge representation ‘naturally’

A proposition can be A proposition can be brokenbroken down into a predicate and down into a predicate and the subject of the predicatethe subject of the predicate

A A predicatepredicate is a is a logic functionlogic function; possible values are ; possible values are TT andand F F

Predicate calculusPredicate calculus uses variables and functions of uses variables and functions of variables in a symbolic logic statementvariables in a symbolic logic statement

A proposition A proposition Smith is a workerSmith is a worker will be written as: will be written as:is-a(smith, worker)is-a(smith, worker)where where is-ais-a is the name of the predicate is the name of the predicate

66

Predicate CalculusPredicate Calculus

Page 7: Knowledge Representation. Introduction Knowledge is organized in knowledge base in one or more configurations. A good knowledge representation ‘naturally’

Predicate calculus is the basis for Predicate calculus is the basis for PrologProlog (PROgramming in (PROgramming in LOGic)LOGic)

Prolog Statement ExamplesProlog Statement Examples comes_on(mail_carrier, Monday).comes_on(mail_carrier, Monday). likes(jay, chocolate).likes(jay, chocolate).

(Note - the period “.” is part of the statement)(Note - the period “.” is part of the statement)

The values of the The values of the argument argument of a predicate depend on the of a predicate depend on the contextcontext

Arguments of a predicate could take both qualitative and Arguments of a predicate could take both qualitative and quantitative values quantitative values

7 7

Predicate CalculusPredicate Calculus

Page 8: Knowledge Representation. Introduction Knowledge is organized in knowledge base in one or more configurations. A good knowledge representation ‘naturally’

One of the most common modes of knowledge One of the most common modes of knowledge representations in representations in expert systemsexpert systems

Condition-Action PairsCondition-Action Pairs IFIF this condition (or premise or antecedent) occurs, this condition (or premise or antecedent) occurs, THENTHEN some action (or result, or conclusion, or consequence) will some action (or result, or conclusion, or consequence) will

(or should) occur(or should) occur

IF the stop light is red AND you have stopped, THEN a right IF the stop light is red AND you have stopped, THEN a right turn is OKturn is OK

Two types of rules: Two types of rules: declarative declarative and and proceduralprocedural

MetarulesMetarules: Rules about rule: Rules about rule

88

Production RulesProduction Rules

Page 9: Knowledge Representation. Introduction Knowledge is organized in knowledge base in one or more configurations. A good knowledge representation ‘naturally’

Each production rule in a knowledge base represents Each production rule in a knowledge base represents an an autonomous chunkautonomous chunk of of expertise expertise

When combined and fed to the When combined and fed to the inference engineinference engine, the , the set of rules behaves synergisticallyset of rules behaves synergistically

RulesRules can be viewed as a simulation of the cognitive can be viewed as a simulation of the cognitive behavior of behavior of human expertshuman experts

Rules represent a Rules represent a modelmodel of actual human behaviorof actual human behavior 99

Production RulesProduction Rules

Page 10: Knowledge Representation. Introduction Knowledge is organized in knowledge base in one or more configurations. A good knowledge representation ‘naturally’

Forms of RulesForms of Rules IF IF premise, premise, THENTHEN conclusion conclusion

IF your income is high, THEN your chance of being IF your income is high, THEN your chance of being audited by the IRS is highaudited by the IRS is high

Conclusion, IF premiseConclusion, IF premise Your chance of being audited is high, IF your income is Your chance of being audited is high, IF your income is

highhigh

Inclusion of ELSEInclusion of ELSE IF your income is high, OR your deductions are unusual, IF your income is high, OR your deductions are unusual,

THEN your chance of being audited by the IRS is high, OR THEN your chance of being audited by the IRS is high, OR ELSE your chance of being audited is lowELSE your chance of being audited is low

1010

Production RulesProduction Rules

Page 11: Knowledge Representation. Introduction Knowledge is organized in knowledge base in one or more configurations. A good knowledge representation ‘naturally’

More Complex RulesMore Complex Rules IF credit rating is high AND salary is IF credit rating is high AND salary is

more than $30,000, OR assets are more more than $30,000, OR assets are more than $75,000, AND pay history is not than $75,000, AND pay history is not "poor," THEN approve a loan up to "poor," THEN approve a loan up to $10,000, and list the loan in category $10,000, and list the loan in category "B.”"B.”

Action part may have more informationAction part may have more information: : THEN "approve the loan" and "refer to THEN "approve the loan" and "refer to an agent" an agent"

1111

Production RulesProduction Rules

Page 12: Knowledge Representation. Introduction Knowledge is organized in knowledge base in one or more configurations. A good knowledge representation ‘naturally’

Production Rules: Production Rules: Knowledge Knowledge and Inference Rulesand Inference Rules

Common Types of RulesCommon Types of Rules Knowledge rulesKnowledge rules, or declarative rules, state all the facts , or declarative rules, state all the facts

and relationships about a problem and relationships about a problem

Inference rulesInference rules, or procedural rules, advise on how to , or procedural rules, advise on how to solve a problem, given that certain facts are knownsolve a problem, given that certain facts are known

Inference rules contain rules about rules (Inference rules contain rules about rules (metarulesmetarules))

Knowledge rules are stored in the Knowledge rules are stored in the knowledge baseknowledge base

Inference rules become part of the Inference rules become part of the inference engineinference engine

1212

Page 13: Knowledge Representation. Introduction Knowledge is organized in knowledge base in one or more configurations. A good knowledge representation ‘naturally’

Production Rules: Production Rules: Major Major AdvantagesAdvantages

Easy to understand (natural form of Easy to understand (natural form of knowledge)knowledge)

Easy to derive inference and explanationsEasy to derive inference and explanations

Easy to modify and maintainEasy to modify and maintain

Easy to combine with uncertaintyEasy to combine with uncertainty

Rules are frequently independentRules are frequently independent 1313

Page 14: Knowledge Representation. Introduction Knowledge is organized in knowledge base in one or more configurations. A good knowledge representation ‘naturally’

Complex knowledge requires many Complex knowledge requires many rulesrules

Builders like rules (hammer syndrome)Builders like rules (hammer syndrome)

Search limitations in systems with Search limitations in systems with many rulesmany rules

14

Production Rules: Production Rules: Major Major LimitationsLimitations

Page 15: Knowledge Representation. Introduction Knowledge is organized in knowledge base in one or more configurations. A good knowledge representation ‘naturally’

Production Rules: Production Rules: Major Major CharacteristicsCharacteristics

First PartFirst Part

(IF …)(IF …)Second PartSecond Part

(THEN …)(THEN …)NamesNames 1. Premise

2. Antecedent3. Situation

1. Conclusion2. Consequence3. Action

SizeSize Can have many IFs Usually has one conclusion

StatementsStatements OR If any condition is true, the conclusion is true

AND If all conditions are true, the conclusion is true

15

Page 16: Knowledge Representation. Introduction Knowledge is organized in knowledge base in one or more configurations. A good knowledge representation ‘naturally’

A simple and graphic depiction of knowledge A simple and graphic depiction of knowledge consisting of consisting of nodes and linksnodes and links

Nodes Nodes represent objects, concepts, events, actions, represent objects, concepts, events, actions, attribute of an objectattribute of an object

Nodes are interconnected by Nodes are interconnected by linkslinks or or arcsarcs; two ; two frequent associations are frequent associations are is-a is-a and and has-ahas-a

Semantic network can show Semantic network can show inheritanceinheritance; ; is-ais-a association shows the specializationassociation shows the specialization

1616

Semantic NetworkSemantic Network

Page 17: Knowledge Representation. Introduction Knowledge is organized in knowledge base in one or more configurations. A good knowledge representation ‘naturally’

ShortcomingsShortcomings Does not distinguish between the Does not distinguish between the class of an objectclass of an object

and a and a particular objectparticular object

Does not have Does not have appropriateappropriate structure for structure for accommodating the complex associations of the accommodating the complex associations of the attributes of an object with other objectsattributes of an object with other objects

The presentation and structure for complex systems The presentation and structure for complex systems could become could become unmanageableunmanageable

1717

Semantic NetworkSemantic Network

Page 18: Knowledge Representation. Introduction Knowledge is organized in knowledge base in one or more configurations. A good knowledge representation ‘naturally’

Semantic NetworkSemantic Network

AgeAge22 22 yearsyears

PersonPersonTeacherTeacherDebraDebraIS-AIS-A IS-AIS-A

HASHAS HASHAS

IS-AIS-A

18

Page 19: Knowledge Representation. Introduction Knowledge is organized in knowledge base in one or more configurations. A good knowledge representation ‘naturally’

FramesFrames

Frame: Frame: Data structureData structure that includes all the that includes all the knowledge about a particular objectknowledge about a particular object

Knowledge organized in a hierarchy for Knowledge organized in a hierarchy for diagnosis of knowledge independencediagnosis of knowledge independence

Form of Form of object-oriented programmingobject-oriented programming for AI for AI and ES.and ES.

Each Frame Each Frame Describes Describes One ObjectOne Object

1919

Page 20: Knowledge Representation. Introduction Knowledge is organized in knowledge base in one or more configurations. A good knowledge representation ‘naturally’

Provide a concise, structural representation of Provide a concise, structural representation of knowledge in a knowledge in a natural mannernatural manner

Frame encompasses Frame encompasses complex objectscomplex objects, entire , entire situations or a management problem as a single situations or a management problem as a single entityentity

Frame knowledge is partitioned into Frame knowledge is partitioned into slotsslots

Slot can describe Slot can describe declarative knowledgedeclarative knowledge or or procedural knowledge procedural knowledge

Hierarchy of Frames: Hierarchy of Frames: InheritanceInheritance

2020

FramesFrames

Page 21: Knowledge Representation. Introduction Knowledge is organized in knowledge base in one or more configurations. A good knowledge representation ‘naturally’

Terminology for Frames:Terminology for Frames: DefaultDefault DemonDemon FacetFacet Hierarchy of framesHierarchy of frames If addedIf added Instance of Instance of InstantiationInstantiation Master frameMaster frame ObjectObject RangeRange SlotSlot Value (entry)Value (entry)

2121

FramesFrames

Page 22: Knowledge Representation. Introduction Knowledge is organized in knowledge base in one or more configurations. A good knowledge representation ‘naturally’

Capabilities Capabilities of Frames:of Frames: Ability to clearly document information about a Ability to clearly document information about a

domain model; domain model; for examplefor example, a machines and the , a machines and the

associated attributesassociated attributes

The related ability The related ability to constrainto constrain the allowable values the allowable values

that an attribute can take onthat an attribute can take on

Modularity of informationModularity of information -> Ease of system -> Ease of system

expansion and maintenance expansion and maintenance

More readable and consistent syntax for referencing More readable and consistent syntax for referencing

domain objects in the rulesdomain objects in the rules

Access to a mechanism that supports the Access to a mechanism that supports the

inheritance of information down a class hierarchyinheritance of information down a class hierarchy

FramesFrames

Page 23: Knowledge Representation. Introduction Knowledge is organized in knowledge base in one or more configurations. A good knowledge representation ‘naturally’

FramesFrames

OBJECT: Marketable SecuritiesOBJECT: Marketable SecuritiesPARENTCLASS:PARENTCLASS: MEMBERSLOTS:MEMBERSLOTS:

OWNSLOTS:OWNSLOTS: Issued-byIssued-by RiskRisk MarketableMarketable LOCALSLOTS:LOCALSLOTS: Total_Portfolio_ValueTotal_Portfolio_Value OBJECT: BondsOBJECT: Bonds

PARENTCLASS: Marketable SecuritiesPARENTCLASS: Marketable Securities MEMBERSLOTS:METHOD:MEMBERSLOTS:METHOD: RISK: LowRisk_EvalRISK: LowRisk_Eval MARKETABLE: YesMARKETABLE: Yes OWNSLOTS:OWNSLOTS: Face_Value:=1000Face_Value:=1000 Face_Interest_ValueFace_Interest_Value MaturityMaturity LOCALSLOTS:LOCALSLOTS: Bonds_Market_ValueBonds_Market_Value

OBJECT: 9245631 IBM Class COBJECT: 9245631 IBM Class CMEMBERCLASS: BondsMEMBERCLASS: Bonds MEMBERSLOTS:MEMBERSLOTS: Issued-by: IBMIssued-by: IBM Face_Interest_Value:=6.875Face_Interest_Value:=6.875 Maturity:=31 DEC.2007Maturity:=31 DEC.2007 LOCALSLOTS:LOCALSLOTS: Market_Value:=1276Market_Value:=1276

Page 24: Knowledge Representation. Introduction Knowledge is organized in knowledge base in one or more configurations. A good knowledge representation ‘naturally’

ScriptsScripts

Knowledge Representation Scheme Knowledge Representation Scheme Describing a Sequence of EventsDescribing a Sequence of Events

Elements include Elements include Entry ConditionsEntry Conditions PropsProps RolesRoles Tracks Tracks ScenesScenes

Page 25: Knowledge Representation. Introduction Knowledge is organized in knowledge base in one or more configurations. A good knowledge representation ‘naturally’

ListsLists

Written Series of Related ItemsWritten Series of Related Items

Normally used to represent Normally used to represent hierarchical knowledge where hierarchical knowledge where objects are grouped, categorized or objects are grouped, categorized or graded according tograded according to Rank or Rank or RelationshipRelationship

Page 26: Knowledge Representation. Introduction Knowledge is organized in knowledge base in one or more configurations. A good knowledge representation ‘naturally’

Decision TablesDecision Tables(Induction Table)(Induction Table)

Knowledge Organized in a Knowledge Organized in a Spreadsheet FormatSpreadsheet Format

Attribute List Attribute List

Conclusion List Conclusion List

Different attribute configurations are Different attribute configurations are matched against the conclusionmatched against the conclusion

Page 27: Knowledge Representation. Introduction Knowledge is organized in knowledge base in one or more configurations. A good knowledge representation ‘naturally’

Decision TreesDecision Trees

Related to tables Related to tables

Similar to decision trees in decision theorySimilar to decision trees in decision theory

Can simplify the knowledge acquisition Can simplify the knowledge acquisition processprocess

Knowledge diagramming is frequently Knowledge diagramming is frequently more natural to experts than formal more natural to experts than formal representation methodsrepresentation methods

Page 28: Knowledge Representation. Introduction Knowledge is organized in knowledge base in one or more configurations. A good knowledge representation ‘naturally’

O-A-V TripletO-A-V Triplet

Objects, Attributes and ValuesObjects, Attributes and Values

O-A-V TripletO-A-V Triplet

Objects may be physical or conceptualObjects may be physical or conceptual

Attributes are the characteristics of the Attributes are the characteristics of the objectsobjects

Values are the specific measures of the Values are the specific measures of the attributes in a given situationattributes in a given situation

O-A-V tripletsO-A-V triplets

Page 29: Knowledge Representation. Introduction Knowledge is organized in knowledge base in one or more configurations. A good knowledge representation ‘naturally’

O-A-V TripletO-A-V Triplet

ObjectsObjects AttributesAttributes ValuesValues

Class-room Size 12 X 15, 10 X 12 etc.

Admissions to MBA program

GMAT score 500, 510, 520 ….

Admissions to MBA program

GPA 3.0, 3.3, 3.5 …

Page 30: Knowledge Representation. Introduction Knowledge is organized in knowledge base in one or more configurations. A good knowledge representation ‘naturally’

Considerations for Evaluating a Considerations for Evaluating a Knowledge RepresentationKnowledge Representation

Naturalness, uniformity and understandabilityNaturalness, uniformity and understandability

Degree to which knowledge is explicit (declarative) Degree to which knowledge is explicit (declarative) or embedded in procedural codeor embedded in procedural code

Modularity and flexibility of the knowledge baseModularity and flexibility of the knowledge base

Efficiency of knowledge retrieval and the heuristic Efficiency of knowledge retrieval and the heuristic power of the inference procedurepower of the inference procedure

Page 31: Knowledge Representation. Introduction Knowledge is organized in knowledge base in one or more configurations. A good knowledge representation ‘naturally’

No single knowledge representation method is ideally No single knowledge representation method is ideally suited by itself for all tasks (Table 14.5)suited by itself for all tasks (Table 14.5)

Multiple knowledge representations: each tailored to Multiple knowledge representations: each tailored to a different subtaska different subtask

Production Rules and Frames works well in practiceProduction Rules and Frames works well in practice

Object-Oriented Knowledge RepresentationsObject-Oriented Knowledge Representations HypermediaHypermedia

Considerations for Evaluating a Considerations for Evaluating a Knowledge RepresentationKnowledge Representation

Page 32: Knowledge Representation. Introduction Knowledge is organized in knowledge base in one or more configurations. A good knowledge representation ‘naturally’

Knowledge Representation Knowledge Representation Schemes (Turban and Aronson, Schemes (Turban and Aronson,

1998)1998)

SchemeScheme AdvantagesAdvantages DisadvantagesDisadvantagesProduction Rules Simple syntax

Easy to understandEasy to modifyModular

Inefficient for large systemsDifficult to follow hierarchiesCan not be used to represent all knowledge

Semantic Networks Easy to follow hierarchiesEasy to trace associations

Meaning attached to nodes may be ambiguousDifficult to program

Frames Easy to set up slots for new properties and relationsEasy to include default informationEasy to detect missing values

Difficult to programDifficult to make inference

Formal Logic PrecisionCompleteness

Inefficient with large knowledge bases