Anda di halaman 1dari 33

Knowledge Representation

What is Knowledge ?
Knowledge
Knowledge
Information

Data

Signal

Knowledge = FactsRulesControl Strategy


+(sometimes ) Faiths
Knowledge Representation
Knowledge representation is an issue
that arises in both cognitive science and
AI.
In cognitive science it is concerned with how
people store and process information.
In AI, the primary aim is to store knowledge so
that programs can process it and achieve the
verisimilitude of human intelligence.
AI researchers have borrowed representation
theories from cognitive science.
Methodology of KR
Logic
Production System
Semantic Net/Associative nets
Frame
Script
Semantic Nets
Intuition base:
An important feature of human memory is
the high number of connections or
associations between the different pieces of
information contained in it.
There are two types of primitive
Nodes correspond to objects, or classes of
objects, in the world
Links are unidirectional connections between
nodes and correspond to relationships
between these objects
Semantic Nets
Major problem with semantic nets is that
although the name of this knowledge
representation language is semantic nets,
there is not, ironically, clear semantics of
the various network representations. For
the above example,
it can be interpreted as the representation of a
specific bird named Tweety, or
it can be interpreted as a representation of
some relationship between Tweety, birds and
animals.
Few Common used links
The commonly used links in semantic net are of
the following types.
- Isa /Subset_of/subclass/ako subclass of entity
(e.g., child hospital is subclass of hospital)
- Instance/inst/type_of particular instance of a
class (e.g., India is an instance of country)
- Prop/property/has property link (e.g., property of
dog is bark)
Representation of Knowledge in Sem Net

Every human, animal and bird is living


thing who breathe and eat. All birds
can fly. All man and woman are humans
who have two legs. Cat is an animal
and has a fur. All animals have skin and
can move. Giraffe is an animal who is
tall and has long legs. Parrot is a bird
and is green in color.
Representation in Predicate Logic
Every human, animal and bird is Cat is an animal and has a fur.
living thing who breathe and eat. animal(cat) has(cat, fur)
X [human(X) living(X)] All animals have skin and can
X [animal(X) living(X)] move.
X [bird(X) living(X)] X [animal(X) has(X, skin)
All birds are animal and can fly. canmove(X)]
X [bird(X) canfly(X)] Giraffe is an animal who is tall
Every man and woman are and has long legs.
humans who have two legs. animal(giraffe) has(giraffe,
X [man(X) haslegs(X)] long_legs) is(giraffe, tall)
X [woman(X) haslegs(X)] Parrot is a bird and is green in
color.
X [human(X) has(X, legs)] bird(parrot) has(parrot,
green_colour)
Representation in Semantic Net
Semantic Net
breathe, eat
Living_thing prop
isa isa
two legs isa fly
Human Animal Bird
isa isa inst isa inst
prop green
Man Woman Giraffe Cat Parrot
prop prop prop
inst fur
john skin, move tall, long legs
Coding of Semantic Net in Prolog
Isa facts Instance facts Property facts

isa(living_thing, nil). inst(john, man). prop(breathe, living_thing).


isa(human, living_thing). inst(giraffe, animal). prop(eat, living_thing).
isa(animals, living_thing). inst(parrot, bird) prop(two_legs, human).
isa(birds, living_thing). prop(skin, animal).
isa(man, human ). prop(move, animal).
isa(woman, human). prop(fur, bird).
isa(cat, animal). prop(tall, giraffe).
prop(long_legs, giraffe).
prop(tall, animal).
prop(green, parrot).
Analysis of Semantic Net
For a particular Domain, you
make up a set of link-types
create a set of nodes
connect them together
ascribe meaning
Write Programs to manipulate the
knowledge
Lisp
Prolog
Examples of Semantic Net (2)
My car is tan and Johns car is green

I
owner
color
car1 tan
is-a

car
is-a color
car2 green
owner

john
A Semantic Network
Mammal

Is-a
has-part
Person Nose

uniform- instance
color team
Blue M S Dhoni India

Predicate logic representation:-


isa(person,mammal), instance (dhoni,person)
team(dhoni,India) uniformcolor(dhoni,blue)
Representing Nonbinary Predicates
cont.
How to represent unary relations
Ex:- man(sharukh)
solution:- instance(sharukh ,man)

How to represent N-Place relations(N>3)


Solution:- Create one new object for entire statement.
Introduce binary predicates to describe relations to this new object
of each of original arguments.
This procedure is known as Reification.

Ex:- score(india ,pak, 5-3)


so here create a generalized class T20 to represent games. And introduce
following predicates-
score(T20,5-3) hometeam(T20,india) visiting team(T20,Pak).
Representing Nonbinary Predicates
cont.

Game

visiting- Is-a
team score
Pak T20 5-3

home-team

India
A Semantic Net Representing a
Sentence
John gave the book to Mary.

Give Book

instance instance
agent object
John EV7 BK23

beneficiary

Mary
Inference in a Semantic Net
Basic inference mechanism:
follow links between nodes.

Two methods to do this:


1 Intersection search
2 Inheritance
Inference in a Semantic Net (1)
Inheritance
the is-a and instance-of representation provide a mechanism to
implement this.

IS-A IS-A IS-A


A B C A C

IS-A can can


clyde bird bird fly clyde fly
inheritance
Inheritance also provides a
means of dealing with default
reasoning
ex
we could represent:
Emus are birds.
Typically birds fly and have
wings.
Emus run.
Advantage of inheritance
Inheritance mechanism allows knowledge to be
stored at the highest possible level of abstraction
which reduces the size of knowledge base.
It facilitates inferencing of information associated with
semantic nets.
It is a natural tool for representing taxonomically
structured information and ensures that all the members
and sub-concepts of a concept share common
properties.
It also helps us to maintain the consistency of the
knowledge base by adding new concepts and members
of existing ones.
Properties attached to a particular object (class)
are to be inherited by all subclasses and
members of that class.
Inheritance Rules in Prolog
Instance rules:
instance(X, Y) :- inst(X, Y).
instance (X, Y) :- inst(X, Z), subclass(Z,Y).
Subclass rules:
subclass(X, Y) :- isa(X, Y).
subclass(X, Y) :- isa(X, Z), subclass(Z, Y) .
Property rules:
property(X, Y) :- prop(X, Y).
property(X, Y) :- instance(Y,Z), property(X,
Z).
property(X, Y) :- subclass(Y, Z), property(X,
Z).
Inference in a Semantic Net (2)
Intersection search
The notion that spreading activation out of two
nodes and finding their intersection finds
relationships among objects.
Many advantages including entity-based
organization and fast parallel implementation.
However very structured questions need
highly structured networks
Extending semantic nets
partitioned nets
extensions to Semantic nets that overcome a few problems or extend their
expression of knowledge.
Partitioned Networks Partitioned Semantic Networks allow for:
propositions to be made without commitment to truth.
expressions to be quantified.
Basic idea: Break network into spaces which consist of groups of nodes and
arcs and regard each space as a node.
Partitioned semantic net-for belief
representation
Andrew believes that earth is flat
Encode belief earth is flat in space.
Link this space to rest of network to
represent andrews belief.
Partitioned semantic net
Partitioned semantic net for
generalized stmt
Steps:-
1. Create a general statement, GS, special class.
2. Make node g an instance of GS
3. Add with Every node g at least 2 attributes:
a form that states which relation is being asserted.
one or more forall( ) or exists( ) connections;
Example :-Semantic Nets(simple)
a)The dog bit the mail carrier.

Dogs Bite Mail-carrier

Is- Is-a Is-a


a assailant victim
d b m

28
Partitioned Semantic Nets cont.
b) Every dog has bitten a mail carrier.

SA

GS Dogs Bite Mail-carrier

Is- S1 Is-a Is-a Is-a


a form assailant victim
d b m
g
Partitioned Semantic Nets cont.
c) Every dog in town has bitten the
constable.
SA
Dogs

GS Bite Constables
Town-Dogs

Is-a S1 Is-a Is-a Is-a


form assailant victim
d b c
g

30
Partitioned Semantic Nets cont.
d) Every dog has bitten every mail carrier.

SA
Dogs Bite Mail-carrier

S1 Is- Is- Is-a


a assailant a victim
d b m

form

GS g
Is-a
Advantages of Semantic nets
Inference is simple,natural & efficient as
compared to logical theorem proving (resolution)
in logic.
Can represent default values for classes and still
one of its object can have different value ex:-
person has 2 legs but john has one leg. Note:-
this is not possible in logic KB as it
contradicts,but in SN if search is done it would
start from object itself and stops as soon as it
finds value,hence we get overridden values of
object directly
Drawbacks of semantic nets
No clear semantics
If Multiple inheritance ,possible to get conflicting values.
Ex:-
Only binary relations easy to express,for non-binary
relations, reification process needed
not very expressive in representation of negation, belief,
quantified statements etc .Need using partitioned semantic
net.
If Paritioned semantic net used, we lose its advantage of
simplicity and transparency of inference process.

Anda mungkin juga menyukai