Unit 4
Unit 4
Knowledge representation
Introduction:
Humans are best at understanding, reasoning, and interpreting knowledge. Human
knows things, which is knowledge and as per their knowledge they perform various
actions in the real world. But how machines do all these things comes under
knowledge representation and reasoning Hence we can describe Knowledge
representation as following:
o Object: All the facts about objects in our world domain. E.g., Guitars contains
strings, trumpets are brass instruments.
o Events: Events are the actions which occur in our world.
o Facts: Facts are the truths about the real world and what we represent.
1
Sentences (Here, sentences are used as a technical term and not identical with
the English language).
Types of knowledge
Following are the various types of knowledge:
1. Declarative Knowledge:
2. Procedural Knowledge
3. Meta-knowledge:
4. Heuristic knowledge:
2
o Heuristic knowledge is representing knowledge of some experts in a filed or
subject.
o Heuristic knowledge is rules of thumb based on previous experiences, awareness
of approaches, and which are good to work but not guaranteed.
5. Structural knowledge:
o It describes relationships between various concepts such as kind of, part of, and
grouping of something.
o It describes the relationship that exists between concepts or objects.
Let's suppose if you met some person who is speaking in a language which you don't
know, then how you will able to act on that. The same thing applies to the intelligent
behavior of the agents.
As we can see in below diagram, there is one decision maker which act by sensing the
environment and using knowledge. But if the knowledge part will not present then, it
cannot display intelligent behavior.
3
AI knowledge cycle:
An Artificial intelligence system has the following components for displaying intelligent
behavior:
o Perception
o Learning
o Planning
o Execution
4
Example: The following is the simple relational knowledge representation.
2. Inheritable knowledge:
o In the inheritable knowledge approach, all data must be stored into a hierarchy
of classes.
o All classes should be arranged in a generalized form or a hierarchal manner.
3. Inferential knowledge:
o Inferential knowledge approach represents knowledge in the form of formal
logics.
o This approach can be used to derive more facts.
5
o It guaranteed correctness.
a. Marcus is a man
man(Marcus)
∀x = man (x) ----------> mortal (x)s
4. Procedural knowledge:
o Procedural knowledge approach uses small programs and codes which describes
how to do specific things, and how to proceed.
o In this approach, one important rule is used which is If-Then rule.
1. 1. Representational Accuracy:
KR system should have the ability to represent all kind of required knowledge.
2. 2. Inferential Adequacy:
KR system should have ability to manipulate the representational structures to
produce new knowledge corresponding to existing structure.
3. 3. Inferential Efficiency:
The ability to direct the inferential knowledge mechanism into the most
productive directions by storing appropriate guides.
6
4. 4. Acquisitional efficiency- The ability to acquire the new knowledge easily
using automatic methods.
Kind-of-relation
Example: Following are some statements which we need to represent in the form of
nodes and arcs.
Statements:
a. Jerry is a cat.
b. Jerry is a mammal
c. Jerry is owned by Priya.
d. Jerry is brown colored.
e. All Mammals are animal.
7
Drawbacks in Semantic representation:
1. Semantic networks take more computational time at runtime as we need to
traverse the complete network tree to answer some questions. It might be
possible in the worst case scenario that after traversing the entire tree, we find
that the solution does not exist in this network.
2. Semantic networks try to model human-like memory (Which has 1015 neurons
and links) to store the information, but in practice, it is not possible to build such
a vast semantic network.
4. Semantic networks do not have any standard definition for the link names.
5. These networks are not intelligent and depend on the creator of the system.
8
Some assertion systems are even considered as the model of the reasonable structures underlying
the characteristic semantic natural languages.
Implicational Networks – Uses Implication as the primary connection for connecting nodes. These
networks are also used to explain patterns of convictions, causality and even deductions.
Executable Network- Contains mechanisms that can cause some changes to the network itself
by incorporating some techniques, for example, such as attached procedures or marker passing
which can perform path messages, or associations and searches for patterns
Learning Networks – These are the networks that build and extend their representations by
acquiring knowledge through examples. Contain mechanisms in such networks brings changes
within the network itself through representation by securing information. A classic example
could be like, the changing of new information from the old system by including and
excluding nodes and arcs, or by changing numerical qualities called weights, and connected with
the arcs and nodes.
9
Hybrid Networks – Networks that combine two or more of previous techniques, either in a
single network or in a separate, but closely interacting network Hybrid network has been clearly
created to implement ideas regarding human cognitive mechanisms, while some are created
generally for computer performance.
A frame may have any number of slots needed for describing object. e.g.,
- faculty frame may have name, age, address, qualification etc as slot names.
10
- Each slot may contain one or more facets (called fillers) which may take
many forms such as :
⇒value (value of the slot),
⇒default (default value of the slot),
⇒range (indicates the range of integer or enumerated values, a slot can
have),
⇒demons (procedural attachments such as if_needed, if_deleted,
if_added etc.) and
⇒other (may contain rules, other frames, semantic net or any type of
other information).
Frame Network – Example
11
Description of Frames
Each frame represent either a class or an instance.
Class frame represents a general concept whereas instance frame
represents a specific occurrence of the class instance.
Class frame generally have default values which can be redefined
at lower levels.
If class frame has actual value facet then decedent frames can not
modify that value.
Value remains unchanged for subclasses and instances.
Inheritance in Frames
Suppose we want to know nationality or phone of an instance-
frame13.
These information are not given in this frame.
Search will start from frame13 in upward direction till we get our
answer or have reached root frame.
The frame can be easily represented in prolog by choosing
predicate name as frame with two arguments.
First argument is the name of the frame and second argument is a
list of slot - facet pair.
Features of Frame Representations
Frames can support values more naturally than semantic nets (e.g.
the value 25)
Frames can be easily implemented using object-oriented
programming techniques.
Demons allow for arbitrary functions to be embedded in a
representation.
But a price is paid in terms of efficiency, generality, and
modularity !
Inheritance can be easily controlled.
advanced knowledge representation techniques
Logical Representation:
12
Logical representation is a language with some concrete rules which deals with
propositions and has no ambiguity in representation. Logical representation means
drawing a conclusion based on various conditions. This representation lays down some
important communication rules. It consists of precisely defined syntax and semantics
which supports the sound inference. Each sentence can be translated into logics using
syntax and semantics
Syntax:
o Syntaxes are the rules which decide how we can construct legal sentences in the
logic.
o It determines which symbol we can use in knowledge representation.
Semantics:
o Semantics are the rules by which we can interpret the sentence in the logic.
2. Logical representation technique may not be very natural, and inference may not
be so efficient.
Production Rules
Production rules system consist of (condition, action) pairs which mean, "If condition
then action". It has mainly three parts:
o Working Memory
o The recognize-act-cycle
13
In production rules agent checks for the condition and if the condition exists then
production rule fires and corresponding action is carried out. The condition part of the
rule determines which rule may be applied to a problem. And the action part carries out
the associated problem-solving steps. This complete process is called a recognize-act
cycle.
The working memory contains the description of the current state of problems-solving
and rule can write knowledge to the working memory. This knowledge match and may
fire other rules.
If there is a new situation (state) generates, then multiple production rules will be fired
together, this is called conflict set. In this situation, the agent needs to select a rule
from these sets, and it is called a conflict resolution.
Example:
o IF (at bus stop AND bus arrives) THEN action (get into the bus)
o IF (on the bus AND paid AND empty seat) THEN action (sit down).
o IF (bus arrives at destination) THEN action (get down from the bus).
2. The production rules are highly modular, so we can easily remove, add or modify
an individual rule.
2. During the execution of the program, many rules may be active hence rule-
based production systems are inefficient.
14
students at Yale University such as Robert Wilensky, Wendy Lehnert, and Janet
Kolodner.
Schank developed the model to represent knowledge for natural language input
into computers. Partly influenced by the work of Sydney Lamb, his goal was to
make the meaning independent of the words used in the input, i.e. two sentences
identical in meaning, would have a single representation. The system was also
intended to draw logical inferences.[2]
The model uses the following basic representational tokens:[3]
script structure
Script theory is a psychological theory which posits that human behaviour largely
falls into patterns called "scripts" because they function analogously to the way a
written script does, by providing a program for action. Silvan Tomkins created
script theory as a further development of his affect theory, which regards human
beings' emotional responses to stimuli as falling into categories called "affects": he
noticed that the purely biological response of affect may be followed by awareness
and by what we cognitively do in terms of acting on that affect so that more was
needed to produce a complete explanation of what he called "human being theory".
In script theory, the basic unit of analysis is called a "scene", defined as a sequence
of events linked by the affects triggered during the experience of those events.
Tomkins recognized that our affective experiences fall into patterns that we may
group together according to criteria such as the types of persons and places
involved and the degree of intensity of the effect experienced, the patterns of
which constitute scripts that inform our behavior in an effort to maximize positive
affect and to minimize negative affect.
15
cyc theory
Cyc (pronounced /ˈsaɪk/ SYKE) is a long-term artificial intelligence project that aims to assemble
a comprehensive ontology and knowledge base that spans the basic concepts and rules about how
the world works. Hoping to capture common sense knowledge, Cyc focuses on implicit
knowledge that other AI platforms may take for granted. This is contrasted with facts one might
find somewhere on the internet or retrieve via a search engine or Wikipedia. Cyc
enables semantic reasoners to perform human-like reasoning and be less "brittle" when
confronted with novel situations.
case grammars
Case grammar is a system of linguistic analysis, focusing on the link between the valence, or
number of subjects, objects, etc., of a verb and the grammatical context it requires. The system
was created by the American linguist Charles J. Fillmore in the context of Transformational
Grammar (1968). This theory analyzes the surface syntactic structure of sentences by studying
the combination of deep cases (i.e. semantic roles, such as Agent, Object, Benefactor, Location
or Instrument etc.) which are required by a specific verb. For instance, the verb "give" in English
requires an Agent (A) and Object (O), and a Beneficiary (B); e.g. "Jones (A) gave money (O) to
the school (B).
According to Fillmore, each verb selects a certain number of deep cases which form its case
frame. Thus, a case frame describes important aspects of semantic valency of verbs, adjectives
and nouns. Case frames are subject to certain constraints, such as that a deep case can occur only
once per sentence. Some of the cases are obligatory and others are optional. Obligatory cases
may not be deleted, at the risk of producing ungrammatical sentences. For example, Mary gave
the apples is ungrammatical in this sense.
A fundamental hypothesis of case grammar is that grammatical functions, such
as subject or object, are determined by the deep, semantic valence of the verb, which finds its
syntactic correlate in such grammatical categories as Subject and Object, and in grammatical
cases such as Nominative and Accusative. Fillmore (1968) puts forwards the following hierarchy
for a universal subject selection rule:
Agent < Instrumental < Objective
That means that if the case frame of a verb contains an agent, this one is realized as the subject of
an active sentence; otherwise, the deep case following the agent in the hierarchy (i.e.
Instrumental) is promoted to subject.
semantic web
The Semantic Web leads to smarter, more effortless customer experiences by
giving content the ability to understand and present itself in the most useful forms
matched to a customer’s need. Semantic standards unlock a crucial evolution of the
web towards intelligence that allows the content we post online to be presented in a
way that can be understood, connected, and remixed by machines.
Semantic Web content structures form an essential basis for a reliable graph, or
16
map of knowledge, necessary for true artificial intelligence (AI) beyond basic
Natural Language Processing (NLP) and Natural Language Understanding (NLU).
AI will always remain niche applications built against a limited corpus of content
until structure and semantic standards exist across content sets. Adopting Semantic
Web approaches to content gets publishers closer to globally-machinable sets of
content.
17