0% found this document useful (0 votes)
142 views

Knowledge Representation (KR) - Rule-Based Representation, Semantic Networks, Frames

- Knowledge representation techniques include rule-based representation, semantic networks, and frames. - Rule-based representation uses IF-THEN rules to represent relationships between concepts. Semantic networks use a graph structure with nodes for concepts and labeled links for relationships. Frames represent stereotyped situations and allow for inheritance of properties. - Representing knowledge is important for artificial intelligence as it allows systems to perform inferences and solve problems by manipulating the stored knowledge. The choice of knowledge representation technique depends on the types of relationships and inferences needed.

Uploaded by

Waseem Qassab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
142 views

Knowledge Representation (KR) - Rule-Based Representation, Semantic Networks, Frames

- Knowledge representation techniques include rule-based representation, semantic networks, and frames. - Rule-based representation uses IF-THEN rules to represent relationships between concepts. Semantic networks use a graph structure with nodes for concepts and labeled links for relationships. Frames represent stereotyped situations and allow for inheritance of properties. - Representing knowledge is important for artificial intelligence as it allows systems to perform inferences and solve problems by manipulating the stored knowledge. The choice of knowledge representation technique depends on the types of relationships and inferences needed.

Uploaded by

Waseem Qassab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 51

Knowledge representation (KR).

Rule-based representation,
semantic networks, frames
Knowledge Definition
“The fact or condition of knowing something
with familiarity gained through experience or
association.” (Webster’s Dictionary, 1988)
(Knowing something via seeing, hearing,
touching, feeling, and tasting.)

“The fact or condition of being aware of


something (Sun is hot, balls are round, sky is
blue,…).
The importance of knowledge
representation
Contrary to the beliefs of early workers in AI,
experience has shown that Intelligent Systems
cannot achieve anything useful unless they
contain a large amount of real-world - probably
domain-specific - knowledge.

Humans almost always tackle difficult real-world


problems by using their resources of knowledge
- "experience", "training" etc.
Knowledge Storing
Natural language for people
-Symbols for computer: a number or character
string that represents an object or idea
(Internal representation of the knowledge).
-The core concepts: mapping from facts to an
internal computer representation and also to a
form that people can understand.
Knowledge Representation
- Simple facts or complex relationships
-Mathematical formulas or rules for
natural language syntax
- Associations between related concepts
-Inheritance hierarchies between classes
of objects
Knowledge Representation
The Farmer, The Fox, The Goose and The Grain

The farmer must get a fox, a goose and a sack of


grain across a river, however his boat is small
and he can only carry one thing at a time. His
problem is that if he leaves the fox with the
goose the goose will be eaten, and if he leaves
the goose with the grain, the grain will be eaten.
...
The importance of knowledge
representation
• Contrary to the beliefs of early workers in AI,
experience has shown that Intelligent Systems
cannot achieve anything useful unless they contain a
large amount of real-world - probably domain-
specific - knowledge.
• Humans almost always tackle difficult real-world
problems by using their resources of knowledge -
"experience", "training" etc.
• This raises the problem of how knowledge can be
represented inside a computer, in such a way that an
AI program can manipulate it.
Types of Knowledge
• a priori knowledge
– comes before knowledge perceived through senses
– considered to be universally true
• a posteriori knowledge
– knowledge verifiable through the senses
– may not always be reliable
• procedural knowledge
– knowing how to do something
• declarative knowledge
– knowing that something is true or false
• tacit knowledge
– knowledge not easily expressed by language
Rules for Knowledge Representation
IF...THEN rules can be used to represent knowledge about objects:
IF A THEN B or A → B
For example:
- IF customer closes the account
THEN delete the customer from the database

- IF name is “Ahmet”
AND weather is cold
THEN tell Ahmet 'Wear a coat'
Example
IF … THEN Rules
Rule: Red_Light
antecedent
IF the light is red (left-hand-side)
THEN stop consequent
Rule: Green_Light (right-hand-side)
IF the light is green
THEN go

Production Rules
the light is red ==> stop
the light is green ==> go
Production Rules
• Frequently used to formulate the
knowledge in expert systems
• Excellent modeling of human behavior
• Examples
–IF condition, THEN conclusion
–Conclusion, IF condition
–IF condition, THEN conclusion1 (OR)
ELSE conclusion2
Forms of Rules
• IF premise, THEN conclusion
– IF income is high,
THEN chance of being audited by the IRS is high
• Conclusion, IF premise
– The chance of being audited is high,
IF income is high
• Inclusion of ELSE
– IF income is high, OR deductions are unusual,
THEN chance of being audited by the IRS is high
ELSE chance of being audited is low
• More Complex Rules
– IF credit rating is high AND salary is more than $30,000, OR assets are
more than $75,000, AND payment history is not "poor,"
THEN approve a loan up to $10,000, AND list the loan in category "B”
Rule-based reasoning: rules
• A rule-based system, therefore, either
– identifies a pattern and draws conclusions
about what it means,
or
– identifies a pattern and advises what should
be done about it,
or
– identifies a pattern and takes appropriate
action.
Inferencing
• Reasoning (Thinking)
• The computer is programmed so that it can
make inferences
• Performed by the Inference Engine
Rules - A simple example
Knowledge base consisting of facts and rules, a rule interpreter
to match the rule conditions against facts and for executing the
rules.
Rules:
R1: IF: Raining, Outside(x), Has_Umbrella(x)
THEN: Uses_Umbrella(x)
R2: IF: Raining, Outside(x)
NOT Has_Umbrella(x)
THEN: Wet(x)
R3: IF: Wet(x)
THEN: Gets_Cold(x)
R4: IF: Sunny, Outside(x)
THEN: Gets_Sun_Tan(x)
Initial facts: Raining, Outside(John)
Knowledge and Inference Rules
• Two types of rules are common in AI:
– Knowledge rules and Inference rules
• Knowledge rules (declarative rules), state all the facts and
relationships about a problem
• Inference rules (procedural rules), advise on how to solve a
problem, given that certain facts are known
• Inference rules contain rules about rules (metarules)
• Knowledge rules are stored in the knowledge base
• Inference rules become part of the inference engine
• Example:
– IF needed data is not known THEN ask the user
– IF more than one rule applies THEN fire the one with the highest
priority value first
Rules representing relation,
recommendation and directive
• Relation
IF the ‘fuel tank’ is empty
THEN the car is not running

• Recommendation
IF the season is autumn
AND the sky is cloudy
AND the forecast is drizzle
THEN the advice is ‘take an umbrella’

• Directive
IF the car is not running
AND the ‘fuel tank’ is empty
THEN the action is ‘refuel the car’
Example
Rules for diagnosing household emergency.

Rule 1: IF coughing
THEN smoky
Rule 2: IF wet and NOT raining
THEN burst pipe
Rule 3: IF NOT coughing AND alarm rings
THEN burglary
Rule 4: IF smoky AND hot
THEN fire
Example (continue)
Try to prove fire (R4)
Try to prove smoky and hot (R1 for smoky)
Are you coughing? – no (smoky fails, therefore fire
fails)
Try to prove burst pipe (R2)
Are you getting wet? No (burst pipe fails)
Not coughing (known) and alarm rings.
Is there an alarm ringing? Yes

Conclusion - there’s been a burglary.


Advantages of rule-based systems

• simple and easy to use and understand,


explanation is possible
• straightforward implementation in
computers possible
• capture heuristics
Problems with rule-based systems
• some types of knowledge are not easily expressed in
such rules
• large sets of rules become difficult to understand and
maintain
• Inability to learn. In general, rule-based systems do
not have an ability to learn from the experience.
Such systems cannot automatically modify its
knowledge base, or adjust existing rules or add new
ones. The knowledge engineer is still responsible for
revising and maintaining the system.
Semantic networks
• Devised by Quillian in 1968, as a model of human
memory.
• The technique offered the possibility that computers
might be made to use words in something like the
way humans did, following the failure of early
machine-translators.
• Semantic nets are used to define the meaning of a
concept by its relationships to other concepts. A
graph data structure is used, with nodes used to hold
concepts, and links with natural language labels used
to show the relationships.
Semantic networks
graphical representation for propositional
information
labeled, directed graph
nodes represent objects, concepts, or situations
labels indicate the name
nodes can be instances (individual objects) or classes
(generic nodes)
links represent relationships
the relationships contain the structural information of the
knowledge to be represented
label indicates the type of the relationship
Conceptual graphs
• Conceptual graphs are semantic networks representing the
meaning of (simple) sentences in natural language
• Two types of nodes:
– Concept nodes; there are two types of concepts, individual concepts
and generic concepts
– Relation nodes (binary relations between concepts)

GO
NEW YORK
JOHN
Who Where
How

BUS
Semantic networks
Semantic networks represent propositional information.
Relations between propositions are of primary interest because
they provide the basic structure for organizing knowledge.
Some important relations are:
– “IS-A” (is an instance of). Refers to a member of a class,
where a class is a group of objects with one or more
common attributes (properties). For example, “Tom IS-A
bird”.
– “A-KIND-OF”. Relates one class to another, for example
“Birds are A-KIND-OF animals”.
– “HAS-A”. Relates attributes to objects, for example “Mary
HAS-A cat”.
– “CAUSE”. Expresses a causal relationship, for example “Fire
CAUSES smoke”.
Semantic network
Abraracourcix
Astérix

Cétautomatix

Obélix
Gaul
Panoramix is-a

AKO
is-a Dog
Human

barks-
at Idéfix
Ordralfabetix
Relationships
• without relationships, knowledge is an unrelated collection of
facts
• relationships express structure in the collection of facts
– this allows the generation of meaningful new knowledge
• generation of new facts
• generation of new relationships
• relationships can be arbitrarily defined by the knowledge
engineer
– allows great flexibility
– for reasoning, the inference mechanism must know how
relationships can be used to generate new knowledge
Example of semantic network
has-part
Vehicle Wheels

has-part
isa Motor
has-part
Doors Automobile
num-wheels 4
isa
Size
Small Sports Car 2
num-doors
instance

Corvette
c o v e re d _ b y
a n im a l
tr a v e ls _ b y s k in
f ly in g
is a is a
tr a v e ls _ b y
b ir d fis h
fe a th e r s
c o v e re d _ b y s w im m in g

is a is a is a is a

o s tr ic h p e n g u in can ary r o b in

tr a v e ls _ b y c o lo u r
c o lo u r

w a lk in g y e llo w
tra v e ls _ b y

re d

in s ta n c e _ o f

in s ta n c e _ o f
O pus

T w e e ty

c o lo u r
w h ite
Semantic network

It can answer questions like:


Is tweety an animal ? (it answers “yes”)
What colour is tweety ? (it answers “white”)
Opus is covered_by what ? (it answers “feathers”)
and so on.
Example of semantic network
IS - A Hierarchy
Living Thing
is a is a

Animal Plant
is a is a is a is a

Pet Livestock Tree Bush

is a is a is a is a

Dog Cat Cow Pine

is a is a

German Bull
Shepherd dog
Example of semantic network
IS – PART Hierarchy

Dog
is part is part
is part
Head Body Appendages Tail

is part is part
is part is part
is part
Ears Nose Eyes Mouth Legs Paws
Example of semantic network
Example of semantic network

Animal Wings Machine

is a isa
Bird Aircraft
isa isa
Fly
Flamingo Boeing 747
passenger
John

32
Exceptions in IS - A relation
Nodes and Arcs
• Arcs define binary relationships that hold
between objects denoted by the nodes.
mother age
Sue john 5

age father
age(john,5)
34 Max wife(sue,max)
age age(max,34)
...
OAV-Triples
• object-attribute-value triplets
– can be used to characterize the knowledge in a
semantic net
– quickly leads to huge tables
Object Attribute Value
Astérix profession teacher
Obélix size extra large
Idéfix size petite
Panoramix wisdom infinite
OAV-Triples
Object Attribute Value

Airplane NumberOfEngines 2
Airplane NumberOfEngines 3
Airplane NumberOfEngines 4
Airplane TypeOfEngines Jet
Airplane TypeOfEngines Propeller
Airplane TypeOfWings Conventional
Airplane TypeOfWings SweptBack
Advantages of Semantic Networks
• Easy to visualize
• Formal definitions of semantic networks have
been developed.
• Related knowledge is easily clustered.
• Efficient in space requirements
– Objects represented only once
– Relationships handled by pointers
Problems with Semantic Networks
• expressiveness
– no internal structure of nodes
– relationships between multiple nodes
– no easy way to represent heuristic information
– extensions are possible
– best suited for binary relationships
• efficiency
– may result in large sets of nodes and links
Frames
• Offered by Marvin Minsky in 1975
• frames consist of a group of slots (attributes) and fillers
(associated values) to define a stereotypical objects
Slots can contain all kinds of items
rules, facts, images, video, comments, debugging info,
questions, hypotheses, other frames
Frame Name
Slot # 1 Value #1

Slot # 2 Value #2

Slot # 3 Value #3

Slot # 4 Value #4
Frames
• Frames – semantic net with properties
• A frame can represent a specific entry, or a general
concept
• Frames are implicitly associated with one another
because the value of a slot can be another frame

3 components of a frame
Book Frame
• frame name Slot → Filler
• attributes (slots) • Title → AI. A modern Approach
• values (fillers: list of values,
• Author → Russell & Norvig
range, string, etc.)
• Year → 2003
Frame Example
Slot Name Filler
name Astérix
height small
weight low
profession teacher
intension teaching
intelligence very high
marital status Single
Property inheritance
Semantic networks and Frames support the
useful form of inference - property
inheritance.
Semantic Networks and Frames use different
notations but are effectively the same.
They provide a simple and intuitive way of
representing facts about objects, and
essentially semantic networks are just
diagrammatic forms of frames.
Semantic Network
subclass animal subclass

has-part
reptile mammal head

subclass

size colour
large elephant grey

instance instance

likes
clyde nellie apples
Frame
Mammal:
Subclass: Animal
Has_part: head
Elephant:
Subclass: mammal
Colour: grey
Size: large
Nellie:
Instance: elephant
Likes: apples
Frame and semantic net
Example of Frame
Vehicle
isa Wheels: Yes
isa

Automobile
Doors: Yes Cycle
Motor: Yes Wheels: <4
Wheels: 4
isa
isa
Spots Car Bicycle
Doors: 2 Motor: No
Size: Small Wheels: 2

instance
Corvette
License:xyz2
Inheritance feature of frame

Hotel Chair
•what → chair
Hotel Room •height →20-40cm
Hotel Phone
•what → room •legs →4
•what → phone
•where →hotel
•billing → guest
•contains→
–hotel chair
–hotel phone
Hotel Bed
–hotel bed •what → bed
•size →king
Mattress
•part → mattress
•price → 100$
Example of Frame

hotel chair
hotel room superclass: chair
superclass: room height: 20-40cm
location:hotel legs: 4
contains: (hotel
chair, hotel phone use: sitting
hotel bed)
hotel phone
superclass: phone
use: calling room service
hotel bed billing: through room
superclass: bed
mattress
use: sleeping
superclass: cushion
size: king
firmness: firm
part: (mattress frame)
Frame Advantages
• fairly intuitive for many applications
– similar to human knowledge organization
– suitable for causal knowledge
– easier to understand than logic or rules
• very flexible

You might also like