csnb234 artificial intelligence
Download
Skip this Video
Download Presentation
CSNB234 ARTIFICIAL INTELLIGENCE

Loading in 2 Seconds...

play fullscreen
1 / 55

CSNB234 ARTIFICIAL INTELLIGENCE - PowerPoint PPT Presentation


  • 166 Views
  • Uploaded on

CSNB234 ARTIFICIAL INTELLIGENCE. Chapter 6 Knowledge Representation. (Chapter 7, pp. 223-258, Textbook) (Chapter 5, pp. 167-197, Ref. #1). Instructor: Alicia Tang Y. C. Knowledge Representation. Knowledge representation is certainly one of the most important topics

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' CSNB234 ARTIFICIAL INTELLIGENCE' - angelo


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
csnb234 artificial intelligence
CSNB234ARTIFICIAL INTELLIGENCE

Chapter 6

Knowledge Representation

(Chapter 7, pp. 223-258, Textbook)

(Chapter 5, pp. 167-197, Ref. #1)

Instructor: Alicia Tang Y. C.

slide2

Knowledge Representation

  • Knowledge representation is certainly one of the most important topics
  • Predicate logic based representations (We do this with an historical focus)
  • Schemes in an "evolutionary order" (This allows the reader to see how the strengths of one representation find their way into succeeding approaches)
slide3

Knowledge Representation

  • Representational schemes can be divided into four rough categories.
  • These categories are not intended to be definitive but rather to assist the students (you) in getting a general perspective.
  • Over the past 25 years, numerous representational schemes have been proposed and implemented, each of them having its own strengths and weaknesses.
slide4

Mylopoulos and Levesque (1984) have classified these into four categories

  • 1. Logical representation schemes.
    • This class of representations uses expressions in formal logic to represent a knowledge base. Inference rules and proof procedures apply this knowledge to problem instances.
  • 2.Network representation schemes.
    • Network representations capture knowledge as a graph in which the nodes represent objects or concepts in the problem domain and the arcs represent relations or associations between them. Semantic network and conceptual graph.
slide5

3. Structured representation schemes.

    • Structured representation languages extend networks by allowing each node to be a complex data structure consisting of named slots with attached values. Scripts and frames.
  • 4. Procedural representation schemes.
    • Procedural schemes represent knowledge as a set of instructions for solving a problem. This contrasts with the declarative representations provided by logic and semantic networks.
    • A production rule system is an example of this approach.
before we begin the four methods let s see this
Before we begin the four methods.. Let’s see this
  • There is a common method used for many non-AI (databases) representation, namely
    • Object-Attribute-Value (O-A-V) Triplets
      • An O-A-V is a more complex type of proposition (fact).
      • It divides statement into three (3) parts as shown:

price

shirt

RM39

attribute

value

object

slide7

There can be single or multiple attribute facts

blue

color

shirt

size

XL

cost

rm39

There can also be single or multiple value facts .

e.g. Is the barometer pressure rising, falling or steady?

semantic networks i
Semantic Networks (I)
  • A semantic net has a binary relation
  • Concepts are represented by nodes
  • Links between nodes represent the relationships
  • Drawbacks:
    • Disjunctive and conjunctive information cannot be included into semantic nets
      • E.g. apple can be either green or red
      • E.g. panda has color black and white
semantic networks ii
Semantic Networks (II)
  • Examples of relationship labeled on arcs (notice that there is an underscore)
    • is_a
    • has_a
    • has_part
  • Examples of concepts (nodes)
    • bird
    • person
    • book
    • famous
    • intelligent
slide10

A semantic net that represents a bird’s property

has_covering

has_property

bird

feathers

flies

is_a

size

has_color

small

blue

bluebird

slide11

Exercise:

Draw a semantic network for the following description:

Lab is a room. Lab has a door. Lab has many computers.

Printer is in lab. Laser printer is a Printer.

conceptual graphs
CONCEPTUAL GRAPHS
  • Developed in 1984
  • Conceptual graphs (networks) overcome the restriction to binary relation
  • Simply makes all links unlabelled
slide13

A Disjunctive Net for Red or Green Apple

Apple

Color

Green

Red

A Conceptual Net that represents “OR”

slide15

A Conjunctive Net for black and white panda

Color

WHITE

PANDA

Color

BLACK

A Conceptual Net that represents “AND”

semantic nets
Semantic Nets
  • It can capture and show inheritance
    • a very good feature (that not found in other schemes)
  • Can be used to combine with other representation methods
  • See next slide for “inheritance” power of semantic nets
inheritance in semantics nets
Inheritance in Semantics Nets

Breathe

Animal

Move

can

can

Fly

Bird

Wings

Feathers

can

has

has

Penguin

We shall see this later

can

Canary Sing

Yellow

Animal’s properties

are inherited to Bird and

Bird’s properties are

inherited to a bird

species called canary

is

exception handling for addressing the problem caused by its inheritance property
Exception Handling (for addressing the problem caused by its inheritance property)

Sometimes, inheritance may cause problems.

Penguin through inheritance gets the property “fly”.

(in practice it cannot)

To avoid this situation, all the specific properties of a node

must be attached to it through local nodes, so that when an

answer is needed, it will search all the local nodes first. If the answer is not available in the local nodes then the general nodes will be used.

For example if we ask “how does penguin travel?”

the reply will be “it walks” (supposed that already stored in local node)

frames
Frames
  • The idea behind frames is to store information in meaningful chunks.
  • This frame has 4 slots:

BOOK

Title : Qualitative Reasoning

Author : Ken D. Forbus

Publisher : Prentice-Hall

Year : 2000

slide20

Converting from Frames to Semantics Nets

has_a

has_a

book

date

publisher

is_a

is_a

has_a

author

novel

encyclopedia

is_a

is_a

Forbus

has_a

editor

QPT

frame description
Frame Description

(Source: Luger’s AI book)

Hotel Room

specialisation of: room

location: the hotel

contains: bed, chair & phone

Hotel Phone

specialisation of: phone

use: calling room service

billing: through room

Hotel Bed

superclass: bed

size: king

contains: mattress, pillow, etc.

::

frames1
Frames
  • You should be able to see now :
    • that a frame describes an object by embedding all the information about that object in “slots”
    • that slots are commonly known in programming terms as fields or attributes with associated value
      • this is an advantage (discuss in later part)
    • that a frame is similar to a database record
    • that a frame describes typical instances of the concepts they represent
scripts
SCRIPTS
  • Similar to frames except that scripts describe a sequence of events rather than just an object.
  • Like frames, scripts portray a stereotyped situation.
  • Components:
    • Entry-condition
    • Results
    • Props
    • Roles
    • Scenes/episodes
components in scripts i
Components in Scripts (I)
  • Entry-conditions
    • must be true for the scripts
    • also called descriptors
  • Results
    • facts that are true once the scripts has ended
  • Props
    • things or objects that support a given script
components in scripts ii
Components in Scripts (II)
  • Roles
    • are actions (hence role) that the individual actors perform or execute
  • Scenes/episodes
    • Schank breaks a script into a series of “episodes” called scenes
      • e.g. entering, ordering, … billing, exiting (for restaurant scenario)
    • a scene is a temporal aspect of the script
production rules i
Production Rules (I)
  • Most Expert Systems are rule-based
    • i.e. the knowledge-base of the ES consists of a huge set of production rules (or just “rules”)
  • Facts, rules and inference engines are required to execute a rule-based expert system
  • Production-rules system captures knowledge in simple “if-then” format.
production rules ii
Production Rules (II)
  • The human mental process is too complex to be represented as an algorithm
  • However, most experts are capable of expressing their knowledge in the form of rules for their problem solving
  • e.g.
      • IF the traffic-light is green THEN the action is go
      • IF the traffic-light is red THEN the action is stop
production rules iii
Production Rules (III)
  • A production rule model consists of two parts:
    • the IF part, called antecedent or premise or condition, and
    • the THEN part, called consequent or conclusion or action
  • In our earlier example:
  • IF <the traffic-light is green> THEN <go>
  • IF <the traffic-light is red> THEN <stop>

condition

action

production rules iv
Production Rules (IV)
  • Multiple conditions are joined by the keywords AND (conjunction), OR (disjunction) or a combination of both.
  • Example:

IF <condition-1>

OR <condition-2>

:

OR <condition-n>

THEN <action>

IF <condition-1>

AND <condition-2>

:

AND <condition-n>

THEN <action>

production rules v
Production Rules (V)
  • Rule-based ES also use mathematical operators to define an object as numerical and assign it to the numerical value

IF Age of the student < 21

AND SPM no. of A’s >= 8

THEN Admit the student to BIT

production rules vi
Production Rules (VI)
  • Rules can represent relations, recommendations, directives and heuristics as follows:

Relations:

IF the fuel tank is empty

THEN the the car will not start

Recommendation:

IF you study hard

AND you study smart

AND you never absent

THEN you will get an “A”

production rules vii
Production Rules (VII)

Strategy:

IF the car is dead

THEN check fuel tank

step 1 is complete

IF step 1 is complete

AND the fuel tank is full

THEN check battery

step 2 is complete

IF step 2 is complete

AND the battery is replaced

THEN check electrical fuel lines

:

:

Heuristics:

IF the spill is liquid

AND the spill pH is < 6

AND the smell is vinegar

THEN the spill material is acetic acid

Directive:

IF the fuel tank is empty

THEN refuel the car

production system model
Production System Model

Short term memory

Long term memory

Facts

Production Rules

Reasoning

Conclusion

Question: why are the rules as long term memory?

basic structure of a production system
Basic structure of a Production system

Knowledge-base

Database

Facts

Production

Rules

Inference Engine

Explanation Facility

User Interface

User

firing of rules
“Firing” of Rules
  • When the condition part of a rule is satisfied, the rule is said to fire and the action part is executed.
  • The inference engine carries out the reasoning whereby the expert system reaches a solution. It links the rules given in the knowledge base with the facts provided in the database.
  • The explanation facility enables the user to ask questions such as “why” & “how”.
reasoning methods in production rule systems
Reasoning Methods in Production Rule Systems

(the design of the reference engine)

  • There are two reasoning methods often use in rule-based ES:

(1) Forward chaining

(2) Backward chaining

forward chaining
Forward Chaining
  • This is the data-driven reasoning.
  • The reasoning starts from the known fact or data and proceeds forward with the data.
  • Each time only the topmost rule is executed.
  • When fired, the rule adds a new fact in the database.
  • Any rule can be executed only once.
  • The match-fire cycle stops when no further rules can be fired.

Powerful

mechanism

rule based system forward reasoning example
Rule-based system (Forward reasoning example)

Rule 1: IF Y is true

AND D is true

THEN Z is true

Rule 2: IF X is true

AND B is true

AND E is true

THEN Y is true

Rule 3: IF A is true

THEN X is true

A

X

B

Y

Z

E

D

slide39

Question 1

Or,

Fact 1: A

Fact 2: B

Fact 3: E

  • Given the facts that
    • A, B and E are true
  • In a Forward Chaining system
    • what type of answer/conclusion the system will return?
    • How do you justify it?
question 2

Question 2

What if ‘D’ is also true?

(i.e. as a fact in the KB)

Give the conclusion of the reasoning process.

backward chaining i
Backward Chaining (I)
  • Backward chaining is the goal-driven
  • In this reasoning method, the expert system is trying to satisfy a goal (i.e. there is a hypothetical solution) and the inference engine move attempts to find the evidence to prove it.
  • If evidences are found, the goal is proved.
  • If not, backtracking is initiated.
backward chaining ii
Backward Chaining (II)
  • Thus the inference engine puts the rule it is working with (the rule is said to stack on) and sets up a new goal (i.e. subgoal), to prove the IF-part of this rule.
  • Then the knowledge base is searched again for rules that can prove the subgoal.
  • The inference engine repeats the process of stacking the rules until no rules are found in the knowledge base to prove the current subgoal.

Backtracking

is done here

backward chaining iii
Backward Chaining (III)
  • In the simplest sense, in backward chaining, to prove a goal G, it is to check:
    • If G is a fact then it is proven & stop.
    • Otherwise, find a rule which can be used to conclude G.
      • In proving G, try to prove each premise (preconditions) of the rule that infers G.
      • G is said to be proven (i.e. it is TRUE) if all the premises are true (valid/hold).
slide45

Formal Logic

  • Advantages
    • Facts asserted independently of use
    • completeness
  • Disadvantages
    • Separation of representation and processing
    • Inefficient with large data sets
    • Very slow with large knowledge bases
production rules
Advantages

Simple syntax

Easy to understand

Simple interpreter

Flexible (easy to add or modify)

Disadvantages

Hard to follow hierarchies

Poor at representing structured descriptive knowledge

Ineffective search strategy

Not all knowledge can be expressed as rules

Production Rules
slide47

Semantic Networks

  • Advantages
    • Easy to follow hierarchy
    • Easy to trace association
    • flexible
  • Disadvantages
    • Meaning attached to nodes might be ambiguous
    • Exception handling is difficult
    • Difficult to program
slide48

Frames

  • Advantages
    • Expressive power
    • Easy to set up slots for new properties and relations
    • Easy to include default information
  • Disadvantages
    • Difficult to program
    • Difficult for inference
    • Lack of inexpensive software
homework 1
Homework #1

Name some Issues in Knowledge Representation.

Explain your answer.

homework 2
Homework #2

Give Two advantages and Two disadvantages of Rule-based ES that are NOT listed in this handouts

slide52

Conflict Resolution

  • Earlier we saw two rules for crossing the road. Let’s add another rule to the knowledge base
      • Rule 1:
      • IF the traffic-light is greenTHEN the action is go
      • Rule 2:
      • IFthe traffic-light is red THEN the action is stop
  • Rule 3:
  • IFthe traffic-light is red THEN the action is go

New rule

slide53

Now, we have 2 rules, rule 2 and rule 3, with the same IF-part. Thus both of them can be set to fire when the condition part is satisfied.

  • These rules represent a conflict set.
  • The I. E must determine which rule to fire from such a set.
  • A method for choosing a rule to fire when more than one rule can be fired is called conflict resolution.
slide54

How do we deal with it?

  • In forward chaining, both rules would be fired.
  • Rule 2 is fired first as the topmost one, as a result, its THEN-part is executed. Value stop is returned.
  • However, Rule 3 is also fired because the condition part of this rule matches the fact ‘traffic light is red’, which is still in the database. As a result the object action takes new value go.
slide55

Methods Used for Conflict Resolution

  • 1) Fire rule with highest priority
      • Rule that attached with highest probability (confident value)
  • 2) Longest matching strategy
      • one that will process and provide more information
  • 3) Data that entered most recently
      • most updated piece of information
ad