SlideShare une entreprise Scribd logo
1  sur  68
Télécharger pour lire hors ligne
CHAPTER 2 
KNOWLEDGE REPRESENTATION
What is AI 
AI Techniques 
AI Applications
- Raw facts 
- Static 
- E.g. Liza, S’pore 
- Processed data 
- Has some meaning and purposes 
- E.g. Liza was born in S’pore 
- Derived from information 
- Stored in human brain 
- What we know
1.Introduction 
2.Semantic Networks 
3.Decision Tables 
4.Decision Trees 
5.Frames 
6.Production Rules 
7.Logic 
a.Propositional Logic 
b.Predicate Calculus 
Learning Outcome 
Analysis Representation 
Coding Representation
“The know-how to program a computer to mimic the thought processes of an expert through an appropriate representation scheme” is called knowledge representation (KR) 
It involves knowledge of a shell or a programming language that will represent the expert knowledge
A number of KR schemes shares 2 common characteristics: 
a.They contain facts that can be used in reasoning 
b.They can be programmed with existing computer languages
There are generally 2 types of KR schemes: 
a.Analysis representation 
Support knowledge acquisition during scope establishment and initial knowledge gathering 
Most techniques are pictorial such as 
-semantic networks - decision trees -tables 
b.Coding representation 
The working code of the ES either in the form of 
-frames or - production rules
Knowledge Representation 
Analysis Representation 
Coding Representation 
Inference 
Frames Production rules 
Semantic networks Decision tables Decision trees 
Selected KR Schemes 
Key Idea
Analysis Coding 
Semantic Networks 
Decision Tables 
Decision Trees
Semantic networks are the most general representation scheme. 
Represent a graphical representation of knowledge that show hierarchical relationships between objects. 
Made up of a network of nodes and arc. 
The nodes represent objects and the arc the relationships between objects. 
KR Scheme 1 
Node 
Arc
Example: 
KR Scheme 1
Example: 
License 
Seal 
Examination 
Air rescue 
Emergency landing procedures 
Olesek 
Insignia 
Shirt sleeve 
Two 
Male 
Harding 
Person 
Apparel 
Uniform 
Black 
Cap 
has-a 
certifies 
has-a 
in-a 
in-an 
has- an 
is-on 
is-a 
number- of 
has-a 
is-a 
race-is 
is-a 
wears 
is-a 
is-an 
KR Scheme 1
Nodes represent the objects, concepts, or events in the world. 
Names of the arcs 
correspond to names of relations 
indicate which concepts or objects are linked by the relations. 
KR Scheme 1
The 2 common arcs used are: 
IS-A is used to show class relationship. 
HAS-A is used to identify characteristics or attributes of the object nodes 
other arcs are used for definitional purpose only 
KR Scheme 1
Organized in a spreadsheet format, using columns and rows 
The table divided into two parts: 
A list of attributes is developed and for each attribute, all possible values are listed 
A list of possible conclusions. The different configurations of attributes are match against the conclusion. 
Attributes 
Conclusions 
KR Scheme 2
Decision Table for Gift Problem 
Decision Factors 
Result 
Money 
Age 
Gift 
Much 
Adult 
Car 
Much 
Child 
Computer 
Little 
Adult 
Toaster 
Little 
Childs 
Calculator 
KR Scheme 2
KR Scheme 2
A hierarchical arranged semantic network and is closely related to a decision table 
It is composed of nodes representing goals and links representing decisions 
Rules can be extracted from the decision tree, that can be executed by computer program 
A major advantage can simplify knowledge acquisition process 
KR Scheme 3
KR Scheme 3
A decision tree for an electrical system diagnosis 
Terminals 
Battery Voltage 
Distributor 
Charger 
Not Loose 
Loose 
Tighten Terminals 
<12 
>12 
OK 
OK 
Bad 
Bad 
Check Starter 
Replace Distributor 
Replace Charger 
Replace Battery 
KR Scheme 3
Analysis Coding 
Frames 
Production Rules 
Logic
A frame is a data structure for representing common concepts and situations (stereotype knowledge). 
Like semantic nets, frames can be organized in a hierarchy with general concepts near the top and specific concepts placed at the lower levels. 
General -top 
Specific -lower 
KR Scheme 4
Unlike semantic nets, each frame or node in this hierarchy can be very rich in supplementary information. 
KR Scheme 4
Values that describe one object are grouped together into single unit. 
Knowledge partition into slots. 
Each slot describes: 
• declarative knowledge (colour of a car) 
• procedural knowledge (activate a certain rule if the value exceeds a certain value) 
KR Scheme 4
Frames describe an object in great detail. The detail in form of slots that describe the various and characteristic of the object or situation. 
KR Scheme 4
Basic frame design 
Frame Name: 
Class: 
Properties: 
Frame1 
**Eg: Bird 
***2 
***Eg: No. of wings 
***Worms 
***Eg: Eat 
Value2 
Property2 
Value1 
Property1 
KR Scheme 4
Class frame 
 Represents general characteristics of some set of common objects. For example Cars, Boats, and Birds. 
 Defines those properties that are common to all the objects within the class, and possibly default property values. 
static: describe an object feature whose value doesn’t change 
dynamic: is a feature whose value is likely to change during operation of the system 
KR Scheme 4
Example of Class Frame 
Class Name: 
Properties: 
Bird 
Try 
Flies 
2 
No Wings 
Worms 
Eats 
Unknown 
Color 
Unknown 
Hungry 
Unknown 
Activity 
KR Scheme 4
Class Name: 
Properties: 
KR Scheme 4
 An Instance of Frame 
 Describes a specific instance (sub-class or examples) of a class frame. 
 The instance inherits both properties and property values from its frame class. 
 The property values can be changed (recall: static/dynamic) to tailor the object represented in the instance. 
 Many instances of the frame class can be created. 
 The instances immediately inherit the frame’s properties. 
 Can speed up system coding. 
KR Scheme 4
Instance frame 
Frame Name: 
Class Name: 
Properties: 
Tweety 
Bird 
False 
Flies 
1 
No Wings 
Eats 
Yellow 
Color 
Hungry 
Activity 
Lives 
Cage 
KR Scheme 4
Frame Inheritance 
 From example, “Tweety” is an instance of Bird class. 
 Can allow an instance to accept the class default values or provide values unique to the instance. 
Like most bird Tweety eats worms, but has only one wing and cannot fly. 
Can also provide unique properties. e.g. if Tweety lives in a cage. 
KR Scheme 4
Frame Inheritance 
 Inheriting behaviour 
 Beside inheriting descriptive information from its class, an instance also inherits its behaviour. 
 Need to include a procedure (method) within class frame that define some actions that the frame performs. 
KR Scheme 4
A form of procedural knowledge that describe how to solve a problem. 
The procedural and/or factual knowledge is represented as rules, called productions, in the form of condition-action pairs. 
Are stated as follows: 
"IF this condition occurs, THEN do this action; or this result (or conclusion or consequence) will occur. 
KR Scheme 5
Examples 
IF flammable liquid was spilled, 
THEN call the fire department. 
IF the pH of the spill is less than 6, 
THEN the spill material is an acid. 
IF the spill material is an acid, 
and the spill smells like vinegar, 
THEN the spill material is acetic acid. 
KR Scheme 5
When the IF portion of a rule is satisfied by the facts, the action specified by the THEN is performed. 
When this happens, the rule is said to "fire" or "execute". 
KR Scheme 5
Relationship 
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 is okay 
THEN check out the electrical system 
KR Scheme 5
Strategy 
IF The car will not start 
THEN first check out the fuel system then check out electrical system 
Heuristic 
IF The car will not start 
AND The car is a 1957 Ford 
THEN check the float 
KR Scheme 5
Uncertain Rules 
IF inflation is high 
THEN Almost certainly interest rates are high 
Can assign Certainty Factors: 
IF inflation is high 
THEN interest are high CF=0.8 
KR Scheme 5
Meta-Rules 
A rule that describe how other rules should be used. 
IF the car will not start 
AND the electrical system is operating normally 
THEN use rules concerning the fuel system 
KR Scheme 5
Rules are easy to understand 
Inference and explanation are easy to derive 
Modifications and maintenance are relatively easy 
Uncertainty is easily combined with rules 
Each rule is usually independent of all others 
KR Scheme 5
The oldest form of knowledge representation in a computer is logic 
Logic is concerned with the truthfulness of a chain of statements. 
An argument is true if and only if, when all assumptions are true, then all conclusions are also true. 
2 kinds of logic: 
Propositional Logic 
Predicate Calculus 
Both use symbols to represent knowledge and operators applied to the symbols to produce logical reasoning 
KR Scheme 6
Propositional logic represents and reasons with propositions. 
PL assigns symbolic variable to a proposition such as 
A = The car will start 
In PL, if we are concern with the truth of the statement, we will check the truth of A. 
KR Scheme 6a
KR Scheme 6a
Propositions that are linked together with connectives, such as AND, OR, NOT, IMPLIES, and EQUIVALENT, are called compound statements. 
Example: 
IF The students work hard 
AND Always come to lectures 
AND Do all their homework 
THEN They will get a good grade 
Using logic symbols: A  B  C -> D 
Propositional logic is concerned with the truthfulness of compound statements, depending on the connectives. 
KR Scheme 6a
F 
F 
F 
F 
T 
T 
F 
T 
F 
T 
T 
F 
T 
F 
F 
T 
F 
F 
T 
T 
T 
T 
F 
T 
Truth Table 
KR Scheme 6a
Implies Operator: C = A  B (C is A implies B) 
For an implication of C, if A is true, then B is implied to be true 
(A  B)  ( A  B) 
The implies return an F when A is TRUE and B is FALSE Otherwise it returns TRUE. 
A 
B 
A  B 
F 
F 
T 
F 
T 
T 
T 
F 
F 
T 
T 
T 
KR Scheme 6a
Example to illustrate Implies 
IF The battery is dead (A) 
THEN The car won’t start (B) 
A 
B 
A  B 
F 
F 
T 
F 
T 
T 
T 
F 
F 
T 
T 
T 
KR Scheme 6a
PL offers techniques for capturing facts or rules in a symbolic form and then operates on them through use of logical operators. 
PL provides methods for managing statements that are either TRUE or FALSE. 
KR Scheme 6a
Some PL weakness: 
1.Limited ability to express knowledge and lose much of their meanings. 
The Pacific Ocean contains water. 
Florida is a state within the USA. 
Only assigning a true value without making any statement about ‘oceanhood’ or ‘statehood’. 
KR Scheme 6a
Some PL weakness: 
2. Not all statements can be represented. 
All men are mortals. 
Some dogs like cats. 
Thus, need a more general form of logic that capable of representing the details. 
Therefore Predicate Calculus is introduced. 
KR Scheme 6a
Enhances processing by allowing the use of variables and functions. 
Use symbols that represent 
• constants 
• predicates 
• variables 
• functions 
Operate on these symbols using PL operators ( . 
KR Scheme 6b
Specific objects or properties about a problem. 
Begin with lower case. 
Example: ahmad, elephant and temperature 
KR Scheme 6b
Divide a proposition into 2 parts: 
predicate: assertion about object 
argument: represents the object 
To represent a statement “John likes Mary.” in a predicate calculus. 
likes(john, mary) 
A predicate Arguments 
KR Scheme 6b
Represents general classes of objects or properties. 
Written as symbols beginning with upper case. 
likes(john, X) 
KR Scheme 6b
Permits symbols to be used to represent functions. 
A function denotes a mapping from entities of a set to a unique element of another set. 
father_of(john) mother_of(john) 
Can be also used within predicates. For example: 
married(father_of(john), mother_of(john)) 
KR Scheme 6b
PC uses the same operators as in PL. 
Proposition: 
David is John’s father. father(david, john) 
Jane is John’s mother. mother(jane, john) 
If X is John’s father and Y is John’s mother then X is Y’s husband. 
father(X, john)  mother(Y, john)  husband(X, Y) 
KR Scheme 6b
PC introduces 2 symbols called variable quantifiers. 
1.  universal quantifier: for all 
2.  existential quantifier: there exist 
KR Scheme 6b
 indicates an expression is TRUE for all values of designated variable. 
Example: 
X likes (X, mary) 
means for all values of X, X likes Mary. 
“Everyone likes Mary.” 
KR Scheme 6b
 indicates an expression is TRUE for some values of the variable; at least one value existed that makes the statement is true: 
Example: 
 X likes (X,mary) 
means there exist X where X likes Mary. 
“Someone likes Mary.” 
KR Scheme 6b
Parentheses are used to indicate the scope of quantification 
X (likes(X,mary)  nice(mary)  nice (X)) 
determines all instances of X who like Mary and if Mary is nice, then it is implied that those who like Mary are nice too. 
X (man(X)  mortal(X)) 
All men are mortal. 
Man(X) 
KR Scheme 6b
PC can provide reasoning capability to intelligent systems 
Reasoning requires the ability to infer conclusions from available facts. 
One simple form of inference is modus ponens: 
IF A is true 
AND A  B is true 
THEN B is true 
Based on the available facts below: X (man(X)  mortal(X)) man(socrates) 
We can infer a conclusion of mortal(socrates) 
KR Scheme 6b
father(david, john) 
mother(jane, john) 
father(X, john)  mother(Y, john)  husband(X, Y) 
Who is X? Who is Y? Who is Y’s husband? 
From the above facts and rule, we can infer some more conclusions ….. 
KR Scheme 6b
The semantic network and its equivalent predicate calculus. 
is_a(E1,elephant) name(E1, clyde) num_trunk(elephant, 1) tail(elephant, 1) num_legs(elephant, 4) skin_colour(elephant, grey)
Convert the predicate calculus below into its equivalent semantic networks. 
has_size(bluebird, small) has_covering(bird, feathers) has_colour(bluebird, blue) has_property(bird, flies) is_a(bluebird, bird) is_a(bird, vetebrate)
Represent the following English sentences in predicate calculus: 
1.Monkeys like bananas. 
2.Dogs chase cats. 
3.John doesn’t like ice-creams. 
4.If weather is good, I go jogging.
Prepare a frame of an automobile that you know, show 2 levels of hierarchy. Fill some property and property values. (static and dynamic)
Try to crank the starter. If it is dead or cranks slowly, turn on the headlights. If the headlights are bright (or dim only slightly), the trouble is either in the starter itself, the solenoid, or in the wiring. To find the trouble, short the two large solenoid terminals together (not to ground). If the starter cranks normally, the problem is in the wiring or in the solenoid; check them up to the ignition switch. If the starter does not work normally, check the bushings (see section 7-3 of the manual for instructions). If the bushings are good send the starter to the test station or replace it. If the headlights are out or very dim, check the battery (see section 7-4 for instructions). If the battery and connecting wires are not at fault, turn the headlights on and try to crank the starter. If the lights dim drastically, it is probably because the starter is shorted to the ground. Have the starter tested or replace it. (Based on Carrice et al. [5]).

Contenu connexe

Tendances

Artificial intelligence and first order logic
Artificial intelligence and first order logicArtificial intelligence and first order logic
Artificial intelligence and first order logicparsa rafiq
 
6 shallow parsing introduction
6 shallow parsing introduction6 shallow parsing introduction
6 shallow parsing introductionThennarasuSakkan
 
Lecture 1: Semantic Analysis in Language Technology
Lecture 1: Semantic Analysis in Language TechnologyLecture 1: Semantic Analysis in Language Technology
Lecture 1: Semantic Analysis in Language TechnologyMarina Santini
 
Lec 3 knowledge acquisition representation and inference
Lec 3  knowledge acquisition representation and inferenceLec 3  knowledge acquisition representation and inference
Lec 3 knowledge acquisition representation and inferenceEyob Sisay
 
Linguistic variable
Linguistic variable Linguistic variable
Linguistic variable Math-Circle
 
AI PPT-ALR_Unit-3-1.pdf
AI PPT-ALR_Unit-3-1.pdfAI PPT-ALR_Unit-3-1.pdf
AI PPT-ALR_Unit-3-1.pdflokesh406075
 
Backtracking & branch and bound
Backtracking & branch and boundBacktracking & branch and bound
Backtracking & branch and boundVipul Chauhan
 
Knowledge representation and Predicate logic
Knowledge representation and Predicate logicKnowledge representation and Predicate logic
Knowledge representation and Predicate logicAmey Kerkar
 
Single server queue (Simulation Project)
Single server queue (Simulation Project)Single server queue (Simulation Project)
Single server queue (Simulation Project)Md.zahedul Karim Tuhin
 
Syntax Analysis in Compiler Design
Syntax Analysis in Compiler Design Syntax Analysis in Compiler Design
Syntax Analysis in Compiler Design MAHASREEM
 
Logics for non monotonic reasoning-ai
Logics for non monotonic reasoning-aiLogics for non monotonic reasoning-ai
Logics for non monotonic reasoning-aiShaishavShah8
 

Tendances (20)

Flat unit 3
Flat unit 3Flat unit 3
Flat unit 3
 
Information Extraction
Information ExtractionInformation Extraction
Information Extraction
 
Specification-of-tokens
Specification-of-tokensSpecification-of-tokens
Specification-of-tokens
 
Mycin
MycinMycin
Mycin
 
Artificial intelligence and first order logic
Artificial intelligence and first order logicArtificial intelligence and first order logic
Artificial intelligence and first order logic
 
6 shallow parsing introduction
6 shallow parsing introduction6 shallow parsing introduction
6 shallow parsing introduction
 
Lecture 1: Semantic Analysis in Language Technology
Lecture 1: Semantic Analysis in Language TechnologyLecture 1: Semantic Analysis in Language Technology
Lecture 1: Semantic Analysis in Language Technology
 
Lec 3 knowledge acquisition representation and inference
Lec 3  knowledge acquisition representation and inferenceLec 3  knowledge acquisition representation and inference
Lec 3 knowledge acquisition representation and inference
 
Linguistic variable
Linguistic variable Linguistic variable
Linguistic variable
 
Hidden Markov Model
Hidden Markov Model Hidden Markov Model
Hidden Markov Model
 
AI PPT-ALR_Unit-3-1.pdf
AI PPT-ALR_Unit-3-1.pdfAI PPT-ALR_Unit-3-1.pdf
AI PPT-ALR_Unit-3-1.pdf
 
Semantic Networks
Semantic NetworksSemantic Networks
Semantic Networks
 
Flat unit 1
Flat unit 1Flat unit 1
Flat unit 1
 
Backtracking & branch and bound
Backtracking & branch and boundBacktracking & branch and bound
Backtracking & branch and bound
 
Reasoning in AI
Reasoning in AIReasoning in AI
Reasoning in AI
 
Knowledge representation and Predicate logic
Knowledge representation and Predicate logicKnowledge representation and Predicate logic
Knowledge representation and Predicate logic
 
Single server queue (Simulation Project)
Single server queue (Simulation Project)Single server queue (Simulation Project)
Single server queue (Simulation Project)
 
Rule Based System
Rule Based SystemRule Based System
Rule Based System
 
Syntax Analysis in Compiler Design
Syntax Analysis in Compiler Design Syntax Analysis in Compiler Design
Syntax Analysis in Compiler Design
 
Logics for non monotonic reasoning-ai
Logics for non monotonic reasoning-aiLogics for non monotonic reasoning-ai
Logics for non monotonic reasoning-ai
 

En vedette

Knowledge representation in AI
Knowledge representation in AIKnowledge representation in AI
Knowledge representation in AIVishal Singh
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial IntelligenceRohan Vadsola
 
01bkb05p
01bkb05p01bkb05p
01bkb05phoware
 
Artificial Intelligence: Knowledge Acquisition
Artificial Intelligence: Knowledge AcquisitionArtificial Intelligence: Knowledge Acquisition
Artificial Intelligence: Knowledge AcquisitionThe Integral Worm
 
History of Knowledge Representation (SIKS Course 2010)
History of Knowledge Representation (SIKS Course 2010)History of Knowledge Representation (SIKS Course 2010)
History of Knowledge Representation (SIKS Course 2010)Rinke Hoekstra
 
Getting Started With SlideShare
Getting Started With SlideShareGetting Started With SlideShare
Getting Started With SlideShareSlideShare
 
What is information?
What is information?What is information?
What is information?Johan Koren
 
Artificial Intelligence
Artificial Intelligence Artificial Intelligence
Artificial Intelligence Muhammad Ahad
 
Lecture 4 Meta Knowledge
Lecture 4 Meta KnowledgeLecture 4 Meta Knowledge
Lecture 4 Meta KnowledgeSimon Shurville
 
(Radhika) presentation on chapter 2 ai
(Radhika) presentation on chapter 2 ai(Radhika) presentation on chapter 2 ai
(Radhika) presentation on chapter 2 aiRadhika Srinivasan
 
Knowledge-based Systems
Knowledge-based SystemsKnowledge-based Systems
Knowledge-based Systemssaimohang
 
Amit ppt
Amit pptAmit ppt
Amit pptamitp26
 
Chap19
Chap19Chap19
Chap19himo
 
Artificial Intelligence
Artificial Intelligence Artificial Intelligence
Artificial Intelligence Muhammad Ahad
 
Predicate Logic
Predicate LogicPredicate Logic
Predicate Logicgiki67
 

En vedette (20)

Knowledge representation in AI
Knowledge representation in AIKnowledge representation in AI
Knowledge representation in AI
 
KNOWLEDGE: REPRESENTATION AND MANIPULATION
KNOWLEDGE: REPRESENTATION AND MANIPULATIONKNOWLEDGE: REPRESENTATION AND MANIPULATION
KNOWLEDGE: REPRESENTATION AND MANIPULATION
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
 
01bkb05p
01bkb05p01bkb05p
01bkb05p
 
Artificial Intelligence: Knowledge Acquisition
Artificial Intelligence: Knowledge AcquisitionArtificial Intelligence: Knowledge Acquisition
Artificial Intelligence: Knowledge Acquisition
 
History of Knowledge Representation (SIKS Course 2010)
History of Knowledge Representation (SIKS Course 2010)History of Knowledge Representation (SIKS Course 2010)
History of Knowledge Representation (SIKS Course 2010)
 
Artificial intelligence
Artificial intelligenceArtificial intelligence
Artificial intelligence
 
Introduction to Artificial Intelligence and few examples
Introduction to Artificial Intelligence and few examplesIntroduction to Artificial Intelligence and few examples
Introduction to Artificial Intelligence and few examples
 
Getting Started With SlideShare
Getting Started With SlideShareGetting Started With SlideShare
Getting Started With SlideShare
 
What is information?
What is information?What is information?
What is information?
 
Artificial Intelligence
Artificial Intelligence Artificial Intelligence
Artificial Intelligence
 
Lecture 4 Meta Knowledge
Lecture 4 Meta KnowledgeLecture 4 Meta Knowledge
Lecture 4 Meta Knowledge
 
(Radhika) presentation on chapter 2 ai
(Radhika) presentation on chapter 2 ai(Radhika) presentation on chapter 2 ai
(Radhika) presentation on chapter 2 ai
 
Knowledge-based Systems
Knowledge-based SystemsKnowledge-based Systems
Knowledge-based Systems
 
Amit ppt
Amit pptAmit ppt
Amit ppt
 
Chap19
Chap19Chap19
Chap19
 
Artificial Intelligence
Artificial Intelligence Artificial Intelligence
Artificial Intelligence
 
Learning
LearningLearning
Learning
 
Forward Backward Chaining
Forward Backward ChainingForward Backward Chaining
Forward Backward Chaining
 
Predicate Logic
Predicate LogicPredicate Logic
Predicate Logic
 

Similaire à Ai sem1 2012-13-w2-representation

SL5 OBJECT: SIMPLER LEVEL 5 OBJECT EXPERT SYSTEM LANGUAGE
SL5 OBJECT: SIMPLER LEVEL 5 OBJECT EXPERT SYSTEM LANGUAGE SL5 OBJECT: SIMPLER LEVEL 5 OBJECT EXPERT SYSTEM LANGUAGE
SL5 OBJECT: SIMPLER LEVEL 5 OBJECT EXPERT SYSTEM LANGUAGE ijscmcjournal
 
Introduction to database-Normalisation
Introduction to database-NormalisationIntroduction to database-Normalisation
Introduction to database-NormalisationAjit Nayak
 
Lecture 16
Lecture 16Lecture 16
Lecture 16butest
 
WEKA:Data Mining Input Concepts Instances And Attributes
WEKA:Data Mining Input Concepts Instances And AttributesWEKA:Data Mining Input Concepts Instances And Attributes
WEKA:Data Mining Input Concepts Instances And Attributesweka Content
 
WEKA: Data Mining Input Concepts Instances And Attributes
WEKA: Data Mining Input Concepts Instances And AttributesWEKA: Data Mining Input Concepts Instances And Attributes
WEKA: Data Mining Input Concepts Instances And AttributesDataminingTools Inc
 
Bt8903, c# programming
Bt8903, c# programmingBt8903, c# programming
Bt8903, c# programmingsmumbahelp
 
Accurately and Reliably Extracting Data from the Web:
Accurately and Reliably Extracting Data from the Web: Accurately and Reliably Extracting Data from the Web:
Accurately and Reliably Extracting Data from the Web: butest
 
decisiontree-110906040745-phpapp01.pptx
decisiontree-110906040745-phpapp01.pptxdecisiontree-110906040745-phpapp01.pptx
decisiontree-110906040745-phpapp01.pptxABINASHPADHY6
 
Building data fusion surrogate models for spacecraft aerodynamic problems wit...
Building data fusion surrogate models for spacecraft aerodynamic problems wit...Building data fusion surrogate models for spacecraft aerodynamic problems wit...
Building data fusion surrogate models for spacecraft aerodynamic problems wit...Shinwoo Jang
 
Advanced software engineering lab 2
Advanced software engineering lab 2Advanced software engineering lab 2
Advanced software engineering lab 2asimnawaz54
 
OPTIMAL CHOICE: NEW MACHINE LEARNING PROBLEM AND ITS SOLUTION
OPTIMAL CHOICE: NEW MACHINE LEARNING PROBLEM AND ITS SOLUTIONOPTIMAL CHOICE: NEW MACHINE LEARNING PROBLEM AND ITS SOLUTION
OPTIMAL CHOICE: NEW MACHINE LEARNING PROBLEM AND ITS SOLUTIONijcsity
 
Covering (Rules-based) Algorithm
Covering (Rules-based) AlgorithmCovering (Rules-based) Algorithm
Covering (Rules-based) AlgorithmZHAO Sam
 
Paper-Allstate-Claim-Severity
Paper-Allstate-Claim-SeverityPaper-Allstate-Claim-Severity
Paper-Allstate-Claim-SeverityGon-soo Moon
 
CSCI-383 Lecture 3-4: Abstraction
CSCI-383 Lecture 3-4: AbstractionCSCI-383 Lecture 3-4: Abstraction
CSCI-383 Lecture 3-4: AbstractionJI Ruan
 
Java 2 chapter 10 - basic oop in java
Java 2   chapter 10 - basic oop in javaJava 2   chapter 10 - basic oop in java
Java 2 chapter 10 - basic oop in javalet's go to study
 
Information extraction for Free Text
Information extraction for Free TextInformation extraction for Free Text
Information extraction for Free Textbutest
 
[CIKM 2014] Deviation-Based Contextual SLIM Recommenders
[CIKM 2014] Deviation-Based Contextual SLIM Recommenders[CIKM 2014] Deviation-Based Contextual SLIM Recommenders
[CIKM 2014] Deviation-Based Contextual SLIM RecommendersYONG ZHENG
 

Similaire à Ai sem1 2012-13-w2-representation (20)

SL5 OBJECT: SIMPLER LEVEL 5 OBJECT EXPERT SYSTEM LANGUAGE
SL5 OBJECT: SIMPLER LEVEL 5 OBJECT EXPERT SYSTEM LANGUAGE SL5 OBJECT: SIMPLER LEVEL 5 OBJECT EXPERT SYSTEM LANGUAGE
SL5 OBJECT: SIMPLER LEVEL 5 OBJECT EXPERT SYSTEM LANGUAGE
 
Introduction to database-Normalisation
Introduction to database-NormalisationIntroduction to database-Normalisation
Introduction to database-Normalisation
 
Lecture 16
Lecture 16Lecture 16
Lecture 16
 
WEKA:Data Mining Input Concepts Instances And Attributes
WEKA:Data Mining Input Concepts Instances And AttributesWEKA:Data Mining Input Concepts Instances And Attributes
WEKA:Data Mining Input Concepts Instances And Attributes
 
WEKA: Data Mining Input Concepts Instances And Attributes
WEKA: Data Mining Input Concepts Instances And AttributesWEKA: Data Mining Input Concepts Instances And Attributes
WEKA: Data Mining Input Concepts Instances And Attributes
 
Unit 1 dsa
Unit 1 dsaUnit 1 dsa
Unit 1 dsa
 
Bt8903, c# programming
Bt8903, c# programmingBt8903, c# programming
Bt8903, c# programming
 
Accurately and Reliably Extracting Data from the Web:
Accurately and Reliably Extracting Data from the Web: Accurately and Reliably Extracting Data from the Web:
Accurately and Reliably Extracting Data from the Web:
 
decisiontree-110906040745-phpapp01.pptx
decisiontree-110906040745-phpapp01.pptxdecisiontree-110906040745-phpapp01.pptx
decisiontree-110906040745-phpapp01.pptx
 
Building data fusion surrogate models for spacecraft aerodynamic problems wit...
Building data fusion surrogate models for spacecraft aerodynamic problems wit...Building data fusion surrogate models for spacecraft aerodynamic problems wit...
Building data fusion surrogate models for spacecraft aerodynamic problems wit...
 
Algorithm
AlgorithmAlgorithm
Algorithm
 
class diagram
class diagramclass diagram
class diagram
 
Advanced software engineering lab 2
Advanced software engineering lab 2Advanced software engineering lab 2
Advanced software engineering lab 2
 
OPTIMAL CHOICE: NEW MACHINE LEARNING PROBLEM AND ITS SOLUTION
OPTIMAL CHOICE: NEW MACHINE LEARNING PROBLEM AND ITS SOLUTIONOPTIMAL CHOICE: NEW MACHINE LEARNING PROBLEM AND ITS SOLUTION
OPTIMAL CHOICE: NEW MACHINE LEARNING PROBLEM AND ITS SOLUTION
 
Covering (Rules-based) Algorithm
Covering (Rules-based) AlgorithmCovering (Rules-based) Algorithm
Covering (Rules-based) Algorithm
 
Paper-Allstate-Claim-Severity
Paper-Allstate-Claim-SeverityPaper-Allstate-Claim-Severity
Paper-Allstate-Claim-Severity
 
CSCI-383 Lecture 3-4: Abstraction
CSCI-383 Lecture 3-4: AbstractionCSCI-383 Lecture 3-4: Abstraction
CSCI-383 Lecture 3-4: Abstraction
 
Java 2 chapter 10 - basic oop in java
Java 2   chapter 10 - basic oop in javaJava 2   chapter 10 - basic oop in java
Java 2 chapter 10 - basic oop in java
 
Information extraction for Free Text
Information extraction for Free TextInformation extraction for Free Text
Information extraction for Free Text
 
[CIKM 2014] Deviation-Based Contextual SLIM Recommenders
[CIKM 2014] Deviation-Based Contextual SLIM Recommenders[CIKM 2014] Deviation-Based Contextual SLIM Recommenders
[CIKM 2014] Deviation-Based Contextual SLIM Recommenders
 

Ai sem1 2012-13-w2-representation

  • 1. CHAPTER 2 KNOWLEDGE REPRESENTATION
  • 2. What is AI AI Techniques AI Applications
  • 3. - Raw facts - Static - E.g. Liza, S’pore - Processed data - Has some meaning and purposes - E.g. Liza was born in S’pore - Derived from information - Stored in human brain - What we know
  • 4. 1.Introduction 2.Semantic Networks 3.Decision Tables 4.Decision Trees 5.Frames 6.Production Rules 7.Logic a.Propositional Logic b.Predicate Calculus Learning Outcome Analysis Representation Coding Representation
  • 5. “The know-how to program a computer to mimic the thought processes of an expert through an appropriate representation scheme” is called knowledge representation (KR) It involves knowledge of a shell or a programming language that will represent the expert knowledge
  • 6. A number of KR schemes shares 2 common characteristics: a.They contain facts that can be used in reasoning b.They can be programmed with existing computer languages
  • 7. There are generally 2 types of KR schemes: a.Analysis representation Support knowledge acquisition during scope establishment and initial knowledge gathering Most techniques are pictorial such as -semantic networks - decision trees -tables b.Coding representation The working code of the ES either in the form of -frames or - production rules
  • 8. Knowledge Representation Analysis Representation Coding Representation Inference Frames Production rules Semantic networks Decision tables Decision trees Selected KR Schemes Key Idea
  • 9. Analysis Coding Semantic Networks Decision Tables Decision Trees
  • 10. Semantic networks are the most general representation scheme. Represent a graphical representation of knowledge that show hierarchical relationships between objects. Made up of a network of nodes and arc. The nodes represent objects and the arc the relationships between objects. KR Scheme 1 Node Arc
  • 12. Example: License Seal Examination Air rescue Emergency landing procedures Olesek Insignia Shirt sleeve Two Male Harding Person Apparel Uniform Black Cap has-a certifies has-a in-a in-an has- an is-on is-a number- of has-a is-a race-is is-a wears is-a is-an KR Scheme 1
  • 13. Nodes represent the objects, concepts, or events in the world. Names of the arcs correspond to names of relations indicate which concepts or objects are linked by the relations. KR Scheme 1
  • 14. The 2 common arcs used are: IS-A is used to show class relationship. HAS-A is used to identify characteristics or attributes of the object nodes other arcs are used for definitional purpose only KR Scheme 1
  • 15. Organized in a spreadsheet format, using columns and rows The table divided into two parts: A list of attributes is developed and for each attribute, all possible values are listed A list of possible conclusions. The different configurations of attributes are match against the conclusion. Attributes Conclusions KR Scheme 2
  • 16. Decision Table for Gift Problem Decision Factors Result Money Age Gift Much Adult Car Much Child Computer Little Adult Toaster Little Childs Calculator KR Scheme 2
  • 18. A hierarchical arranged semantic network and is closely related to a decision table It is composed of nodes representing goals and links representing decisions Rules can be extracted from the decision tree, that can be executed by computer program A major advantage can simplify knowledge acquisition process KR Scheme 3
  • 20. A decision tree for an electrical system diagnosis Terminals Battery Voltage Distributor Charger Not Loose Loose Tighten Terminals <12 >12 OK OK Bad Bad Check Starter Replace Distributor Replace Charger Replace Battery KR Scheme 3
  • 21. Analysis Coding Frames Production Rules Logic
  • 22. A frame is a data structure for representing common concepts and situations (stereotype knowledge). Like semantic nets, frames can be organized in a hierarchy with general concepts near the top and specific concepts placed at the lower levels. General -top Specific -lower KR Scheme 4
  • 23. Unlike semantic nets, each frame or node in this hierarchy can be very rich in supplementary information. KR Scheme 4
  • 24. Values that describe one object are grouped together into single unit. Knowledge partition into slots. Each slot describes: • declarative knowledge (colour of a car) • procedural knowledge (activate a certain rule if the value exceeds a certain value) KR Scheme 4
  • 25. Frames describe an object in great detail. The detail in form of slots that describe the various and characteristic of the object or situation. KR Scheme 4
  • 26. Basic frame design Frame Name: Class: Properties: Frame1 **Eg: Bird ***2 ***Eg: No. of wings ***Worms ***Eg: Eat Value2 Property2 Value1 Property1 KR Scheme 4
  • 27. Class frame  Represents general characteristics of some set of common objects. For example Cars, Boats, and Birds.  Defines those properties that are common to all the objects within the class, and possibly default property values. static: describe an object feature whose value doesn’t change dynamic: is a feature whose value is likely to change during operation of the system KR Scheme 4
  • 28. Example of Class Frame Class Name: Properties: Bird Try Flies 2 No Wings Worms Eats Unknown Color Unknown Hungry Unknown Activity KR Scheme 4
  • 29. Class Name: Properties: KR Scheme 4
  • 30.  An Instance of Frame  Describes a specific instance (sub-class or examples) of a class frame.  The instance inherits both properties and property values from its frame class.  The property values can be changed (recall: static/dynamic) to tailor the object represented in the instance.  Many instances of the frame class can be created.  The instances immediately inherit the frame’s properties.  Can speed up system coding. KR Scheme 4
  • 31. Instance frame Frame Name: Class Name: Properties: Tweety Bird False Flies 1 No Wings Eats Yellow Color Hungry Activity Lives Cage KR Scheme 4
  • 32. Frame Inheritance  From example, “Tweety” is an instance of Bird class.  Can allow an instance to accept the class default values or provide values unique to the instance. Like most bird Tweety eats worms, but has only one wing and cannot fly. Can also provide unique properties. e.g. if Tweety lives in a cage. KR Scheme 4
  • 33. Frame Inheritance  Inheriting behaviour  Beside inheriting descriptive information from its class, an instance also inherits its behaviour.  Need to include a procedure (method) within class frame that define some actions that the frame performs. KR Scheme 4
  • 34. A form of procedural knowledge that describe how to solve a problem. The procedural and/or factual knowledge is represented as rules, called productions, in the form of condition-action pairs. Are stated as follows: "IF this condition occurs, THEN do this action; or this result (or conclusion or consequence) will occur. KR Scheme 5
  • 35. Examples IF flammable liquid was spilled, THEN call the fire department. IF the pH of the spill is less than 6, THEN the spill material is an acid. IF the spill material is an acid, and the spill smells like vinegar, THEN the spill material is acetic acid. KR Scheme 5
  • 36. When the IF portion of a rule is satisfied by the facts, the action specified by the THEN is performed. When this happens, the rule is said to "fire" or "execute". KR Scheme 5
  • 37. Relationship 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 is okay THEN check out the electrical system KR Scheme 5
  • 38. Strategy IF The car will not start THEN first check out the fuel system then check out electrical system Heuristic IF The car will not start AND The car is a 1957 Ford THEN check the float KR Scheme 5
  • 39. Uncertain Rules IF inflation is high THEN Almost certainly interest rates are high Can assign Certainty Factors: IF inflation is high THEN interest are high CF=0.8 KR Scheme 5
  • 40. Meta-Rules A rule that describe how other rules should be used. IF the car will not start AND the electrical system is operating normally THEN use rules concerning the fuel system KR Scheme 5
  • 41. Rules are easy to understand Inference and explanation are easy to derive Modifications and maintenance are relatively easy Uncertainty is easily combined with rules Each rule is usually independent of all others KR Scheme 5
  • 42. The oldest form of knowledge representation in a computer is logic Logic is concerned with the truthfulness of a chain of statements. An argument is true if and only if, when all assumptions are true, then all conclusions are also true. 2 kinds of logic: Propositional Logic Predicate Calculus Both use symbols to represent knowledge and operators applied to the symbols to produce logical reasoning KR Scheme 6
  • 43. Propositional logic represents and reasons with propositions. PL assigns symbolic variable to a proposition such as A = The car will start In PL, if we are concern with the truth of the statement, we will check the truth of A. KR Scheme 6a
  • 45. Propositions that are linked together with connectives, such as AND, OR, NOT, IMPLIES, and EQUIVALENT, are called compound statements. Example: IF The students work hard AND Always come to lectures AND Do all their homework THEN They will get a good grade Using logic symbols: A  B  C -> D Propositional logic is concerned with the truthfulness of compound statements, depending on the connectives. KR Scheme 6a
  • 46. F F F F T T F T F T T F T F F T F F T T T T F T Truth Table KR Scheme 6a
  • 47. Implies Operator: C = A  B (C is A implies B) For an implication of C, if A is true, then B is implied to be true (A  B)  ( A  B) The implies return an F when A is TRUE and B is FALSE Otherwise it returns TRUE. A B A  B F F T F T T T F F T T T KR Scheme 6a
  • 48. Example to illustrate Implies IF The battery is dead (A) THEN The car won’t start (B) A B A  B F F T F T T T F F T T T KR Scheme 6a
  • 49. PL offers techniques for capturing facts or rules in a symbolic form and then operates on them through use of logical operators. PL provides methods for managing statements that are either TRUE or FALSE. KR Scheme 6a
  • 50. Some PL weakness: 1.Limited ability to express knowledge and lose much of their meanings. The Pacific Ocean contains water. Florida is a state within the USA. Only assigning a true value without making any statement about ‘oceanhood’ or ‘statehood’. KR Scheme 6a
  • 51. Some PL weakness: 2. Not all statements can be represented. All men are mortals. Some dogs like cats. Thus, need a more general form of logic that capable of representing the details. Therefore Predicate Calculus is introduced. KR Scheme 6a
  • 52. Enhances processing by allowing the use of variables and functions. Use symbols that represent • constants • predicates • variables • functions Operate on these symbols using PL operators ( . KR Scheme 6b
  • 53. Specific objects or properties about a problem. Begin with lower case. Example: ahmad, elephant and temperature KR Scheme 6b
  • 54. Divide a proposition into 2 parts: predicate: assertion about object argument: represents the object To represent a statement “John likes Mary.” in a predicate calculus. likes(john, mary) A predicate Arguments KR Scheme 6b
  • 55. Represents general classes of objects or properties. Written as symbols beginning with upper case. likes(john, X) KR Scheme 6b
  • 56. Permits symbols to be used to represent functions. A function denotes a mapping from entities of a set to a unique element of another set. father_of(john) mother_of(john) Can be also used within predicates. For example: married(father_of(john), mother_of(john)) KR Scheme 6b
  • 57. PC uses the same operators as in PL. Proposition: David is John’s father. father(david, john) Jane is John’s mother. mother(jane, john) If X is John’s father and Y is John’s mother then X is Y’s husband. father(X, john)  mother(Y, john)  husband(X, Y) KR Scheme 6b
  • 58. PC introduces 2 symbols called variable quantifiers. 1.  universal quantifier: for all 2.  existential quantifier: there exist KR Scheme 6b
  • 59.  indicates an expression is TRUE for all values of designated variable. Example: X likes (X, mary) means for all values of X, X likes Mary. “Everyone likes Mary.” KR Scheme 6b
  • 60.  indicates an expression is TRUE for some values of the variable; at least one value existed that makes the statement is true: Example:  X likes (X,mary) means there exist X where X likes Mary. “Someone likes Mary.” KR Scheme 6b
  • 61. Parentheses are used to indicate the scope of quantification X (likes(X,mary)  nice(mary)  nice (X)) determines all instances of X who like Mary and if Mary is nice, then it is implied that those who like Mary are nice too. X (man(X)  mortal(X)) All men are mortal. Man(X) KR Scheme 6b
  • 62. PC can provide reasoning capability to intelligent systems Reasoning requires the ability to infer conclusions from available facts. One simple form of inference is modus ponens: IF A is true AND A  B is true THEN B is true Based on the available facts below: X (man(X)  mortal(X)) man(socrates) We can infer a conclusion of mortal(socrates) KR Scheme 6b
  • 63. father(david, john) mother(jane, john) father(X, john)  mother(Y, john)  husband(X, Y) Who is X? Who is Y? Who is Y’s husband? From the above facts and rule, we can infer some more conclusions ….. KR Scheme 6b
  • 64. The semantic network and its equivalent predicate calculus. is_a(E1,elephant) name(E1, clyde) num_trunk(elephant, 1) tail(elephant, 1) num_legs(elephant, 4) skin_colour(elephant, grey)
  • 65. Convert the predicate calculus below into its equivalent semantic networks. has_size(bluebird, small) has_covering(bird, feathers) has_colour(bluebird, blue) has_property(bird, flies) is_a(bluebird, bird) is_a(bird, vetebrate)
  • 66. Represent the following English sentences in predicate calculus: 1.Monkeys like bananas. 2.Dogs chase cats. 3.John doesn’t like ice-creams. 4.If weather is good, I go jogging.
  • 67. Prepare a frame of an automobile that you know, show 2 levels of hierarchy. Fill some property and property values. (static and dynamic)
  • 68. Try to crank the starter. If it is dead or cranks slowly, turn on the headlights. If the headlights are bright (or dim only slightly), the trouble is either in the starter itself, the solenoid, or in the wiring. To find the trouble, short the two large solenoid terminals together (not to ground). If the starter cranks normally, the problem is in the wiring or in the solenoid; check them up to the ignition switch. If the starter does not work normally, check the bushings (see section 7-3 of the manual for instructions). If the bushings are good send the starter to the test station or replace it. If the headlights are out or very dim, check the battery (see section 7-4 for instructions). If the battery and connecting wires are not at fault, turn the headlights on and try to crank the starter. If the lights dim drastically, it is probably because the starter is shorted to the ground. Have the starter tested or replace it. (Based on Carrice et al. [5]).