Module 3 chapter1 and chapter2
Module 3 chapter1 and chapter2
knowledge representation
Introduction :
Types of knowledge
1
1. Declarative Knowledge:
2. Procedural Knowledge
3. Meta-knowledge:
4. Heuristic knowledge:
AI knowledge cycle:
o Perception
o Learning
o Knowledge Representation and Reasoning
o Planning
o Execution
3
The above diagram is showing how an AI system can interact
with the real world and what components help it to show
intelligence. AI system has Perception component by which it
retrieves information from its environment. It can be visual,
audio or another form of sensory input. The learning
component is responsible for learning from data captured by
Perception comportment. In the complete cycle, the main
components are knowledge representation and Reasoning.
These two components are involved in showing the intelligence
in machine-like humans. These two components are
independent with each other but also coupled together. The
planning and execution depend on analysis of Knowledge
representation and reasoning.
4
Example: The following is the simple relational
knowledge representation.
Player1 65 23
Player2 58 18
Player3 75 24
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.
o In this approach, we apply inheritance property.
o Elements inherit values from other members of a class.
o This approach contains inheritable knowledge which
shows a relation between instance and class, and it is
called instance relation.
o Every individual frame can represent the collection of
attributes and its value.
o In this approach, objects and values are represented in
Boxed nodes.
o We use Arrows which point from objects to their values.
Example:
5
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.
o It guaranteed correctness.
o Example: Let's suppose there are two statements:
a. Marcus is a man
b. All men are mortal
Then it can represent as;
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.
o In this knowledge, we can use various coding languages
such as LISP language and Prolog language.
o We can easily represent heuristic or domain-specific
knowledge using this approach.
o But it is not necessary that we can represent all cases in
this approach.
6
Semantic Network Representation
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
In the above diagram, we have represented the different type
of knowledge in the form of nodes and arcs. Each object is
connected with another object by some relation.
8
dogs below the age of 6 months do not give birth”.
In such cases, we say that the default value has been overridden in the
subclass.
Bob Tommy
is aBuilder
dog
is a
owns Tommy
Bella
cheese chases
eats
9
When we say, “Tommy is a dog” we really mean, “Tommy is an instance
of the class dog” or “Tommy is a member of the class dogs”.
Inheritance in Frames:
Example: 1
information:
Example 2:
Mammals
breathe Dogs
are mammals
Cats are
mammals
Here we have created superclass mammals, of which dogs and cats are
subclasses. Hence, we do not need to explicitly say that cats and dogs
breathe because we can inherit this information. Similarly we do not need
to express explicitly that Tommy and Bella breathe as they are instances of
the class dogs and cats and therefore they inherit from those classes
(superclasses).
Example 3:
Let‟s take a fact:
10
Now, this is not true as humans do not have four legs.
Or let‟s say Tommy has an unfortunate accident and now has only three
legs. This information might be expressed as:
We have used an asterisk (*) to indicate that the value for the “number of
legs” slot for the mammal class is a default value and can be overridden.
Slots as Frames:
It is also possible to express a range of values that a slot can take. Ex,
the no. of legs slot might be allowed a number between 1 & 4.
Or we can express this restriction by allowing slots to be frames. The
no. of legs slot can be represented as a frame such as.
11
Double arrow indicates two may link between actor and the action
ATRANS is one of the primitive acts used by the theory . it indicates transfer of possession
Conceptual dependency provides a structure in which knowledge can be represented and also a set
of building blocks from which representations can be built. A typical set of primitive actions are
Primitive Actions:
ATRANS - Transfer of an abstract relationship(Eg: give)
A second set of building block is the set of allowable dependencies among the conceptualization
describe in a sentence.
Conceptual Category:
Six primitive conceptual categories provide building blocks which are the set of
allowable dependencies in the concepts in a sentence:
12
Conceptual relations at a higher level, indicate dependencies between conceptualizations,
annotated with conceptual tenses such as past, future, and conditional. Other types of conceptual
relation are the time and location of a conceptualization.
P- past
f- future
t- transition
ts- state transition
tf- Finished transition
k- continuing
c- Conditional
Rules of Conceptual Dependency:
Rule-7: It describes the relationship between an ACT and the source and
the recipient of the ACT.
13
Rule-8: It describes the relationship between an ACT and the instrument
with which it is performed. This instrument must always be a full
conceptualization, not just a single physical object.
Generation of CD Representation:
The following table shows CD representation of English Sentences having simple but deep
intended meanings.
14
15
Conceptual parsing:
Conceptual parsing is required for generating CD representation from source sentences in
natural language. The main steps involved in CD parsing are as follows:
Syntactic processor extracts main verb and noun along with syntactic category of the verb
from the sentence.
Conceptual processor then makes use of verb-ACT dictionary. Once the correct
entry from dictionary is chosen.
CD processor analyses the rest of the sentence looking for arguments for empty
slots of the verb. CD processor examines possible interpretation in a well-defined order.
Let us consider following cases to handle ‘with PP’ phrase and formulate strategies
to disambiguate the meanings.
CASE 1: The sentences having ‘with PP’ phrase with non-animate PP in one sentence and
animate PP in another sentence as given in the following sentences.
1. John broke the door with hammer – Type1
2. John broke the door with Mike – Type2
. Rule 1: If PP in ‘with PP’ with phrase is non-animate and CD Act requires
instrument then the sentence is of Type1, where PP (hammer)
. Rule 2: IF PP in ‘with PP’ phrase is animate and CD Act requires instrument
then the sentence is of Type2, where PP(Mike) is resolved as a co-actor.
Case 2: In the sentences having ‘with PP’ phrase, if PP’s in both the sentences are non –
animate, then they have to be resolved using semantic lexicon. Consider the following
examples
1. John went to gardens with flowers – Type 3
2. John went to gardens with bag – Type 4
In Type3, non-animate noun ‘flowers’ is a part of a garden. Whereas in Type4, non-animate
‘bag’ is some object not related to garden. Such association of word senses could be found
16
in WordNet and then disambiguation is possible. Here noun ‘bag’ is treated as possession by
john.
Case 3: In the sentences having ‘with PP’ phrase. If PPs in the sentences are animate, then
they have to be resolved using semantic lexicon and context.
Consider the following example:
1. John went to the garden with Mike – Type5
2. John went to the garden with butterflies – Type6
3. John went to the garden with dog – Type7
In these sentences, Mike, butterflies and dog are animate PPs and can be resolved as
follows:
Mike is easily resolved to co-actor of John as both are humans and have similar
characteristics.
WordNet can be used to check if butterfly and garden has some common sense.
Dog is still ambiguous as it may be treated as possession of actor or may be a part of
garden as animals many wonder in garden. Such sentences can be further resolved by
considering the context of sentences.
We can use semantic lexicon dictionary to resolve some of the ambiguities. WordNet is a
semantic lexicon for the English language. It groups English words into sets of synonyms
called synsets. The purpose is WordNet is to produce a combination of dictionary and
thesaurus.
Script structure:
A script is a structured representation describing a stereotyped sequence of events in a
particular context.
Scripts are used in natural language understanding systems to organize a knowledge
base in terms of the situations that the system should understand. Scripts use a frame-
like structure to represent the commonly occurring experience like going to the movies
eating in a restaurant, shopping in a supermarket, or visiting an ophthalmologist.
Thus, a script is a structure that prescribes a set of circumstances that could be
expected to follow on from one another.
Scripts are beneficial because:
r in known runs or patterns.
17
Prerequisites exist upon events taking place.
Components of a script
The components of a script include:
Entry condition: These are basic condition which must be fulfilled before events
in
18
Roles : P= Customer
E= Employee
C= Cashier
Entry conditions: P has no or less money.
The bank is open.
Results : P has more money.
Scene 1: Entering
P PTRANS P into the Bank
P ATTEND eyes to E
P MOVE P to E
Scene 2: Filling form
P MTRANS signal to E
E ATRANS form to P
P PROPEL form for writing
P ATRANS form to P
E ATRANS form to P
Scene 3: Withdrawing money
P ATTEND eyes to counter
P PTRANS P to queue at the counter
P PTRANS token to C
C ATRANS money to P
Scene 4: Exiting the bank
P PTRANS P to out of bank
CYC THEORY:
19
The CYC thery designed for describing the world knowledge(commonsense
knowledge) to be useful in AI applications and more specifically in natural language
understanding similar to CD theory.
CYC conceived by Lenat and Guha for capturing commonsense knowledge form the
project to capture a large knowledge from 100 randomly selected articles in teh
Encyclopedia Britannica . CYC name came from this project.
The CYC structure contains representations of events, objects, attitudes, space ,time ,
motion etc.
So CYC is particularly concerned with the issues of scale. But the question is that
why we build such large knowledge bases KBs are as follows:
Brittleness:
Specialized knowledge bases are little. It is hard to encode new situations and there is
degradation in the performance.
Form and Content:
Knowledge representation so far seen may not be sufficient for AI applications where main
focus is comprehension. Commences strategies could point out where difficulties in content
may affect the form and temporarily focus on content of KBs rather than on their form.
Shared Knowledge:
Small knowledge Base system should allow greater communication amoung themselves.
It is a huge task to build such a large KB. Initially the approach taken by CYC was to encoded
10 million of facts that make commonsense knowledge and then make itself a learning
system.
CYCL contains a constraint language that allows the expression of arbitrary first-order logical
expressions.
CASE GRAMMARS:
Fillmore Grammar is also called as case grammar. Case grammar provides
a different approach to the problem of how syntactic and semantic
interpolation can be combined. Grammar rules are written to describe
syntactic rather than semantic regularities. But the structures, and rules
that are produced correspond to semantic relations rather than to strictly
syntactic ones.
20
The ultimate goal of case grammar theory was to
extract deep meanings of the sentences and express in the form of cases
mentioned above.
For example, in the sentences, the door was broken by john
with hammer, using hammer john broke the door, john broke th door with
the hammer, the hammer(instruement), the john(actor) and the
door(object) play the same semantic roles in each of these sentences
An example of syntactically same but semantically different sentences is
as follows:
Eg: Mother baked for one hour and Cake baked for one hour will have
same syntactic parse structure (NP VP PP) but case grammer analysis of
these sentence will show the difference.
Let us generate case frame for a semtence using case structure. The case frame for
john gave an apple to Mike in the kitchen or Mike was given an apple by john in the kitchen
is coded as sollows in the table
SEMANTIC WEB:
21
Semantic Web is an extension to the World Wide Web. The purpose of the semantic
web is to provide structure to the web and data in general. It emphasizes on
representing a web of data instead of web of documents. It allows computers to
intelligently search, combine and process the web content based on the meaning
that the content has. Three main models of the semantic web are:
1.Building models
2. Computing with Knowledge
3. Exchanging Informationp
Building Models:
Model is a simplified version or description of certain aspects of the real-time
entities. Model gathers information which is useful for the understanding of the
particular domain.
Computing Knowledge:
Conclusions can be obtained from the knowledge present.
Example: If two sentences are given as ‘John is the son of Harry’ and another
sentence given is- ‘Hary’s father is Joey’, then the knowledge that can be computed
from it is – ‘John is the grandson of Joey’
Similarly, another example useful in the understanding of computing knowledge is-
‘All A is B’ and ‘All B is C’, then the conclusion that can be drawn from it is – ‘All A are
C’ respectively.
Exchanging Information:
It is an important aspect. Various communication protocols have been implemented
for the exchange of information like the TCP/IP, HTML, WWW. Web Services have
also been used for the exchange of the data.
The technologies associated with the semantic web are:
RDF (Resource Description Framework)
OWL (Web Ontology Language)
DL (Description Language)
The query language used is:
SPARQL ( SPARQL Protocol and RDF query language).
SHACL (Shape Constraint Language). SHACL is used for validating the RDF graphs
against a set of conditions.
RDF:
It is the formal language for describing structured information. The primary goal of
RDF is to exchange data on the web while preserving the original meaning of the
data. It is a data model that is used to describe resources.
For Example Physical Things, Abstract Concepts, Numbers and Strings.
RDF allows the processing of information. RDF representation can be in the form of
triples and graphs. RDF graph is a directed graph which is used to serve as a
description language for data on the world wide web and other electronic networks.
Resources are described using triples.
22
Triples capture the relationship between the subject and the object. Triples have a
subject, predicate and an object. Triples are enclosed within angular brackets.
Example: Delhi is capital of India
The triple generated from this sentence is:
<Delhi> <capital of> <India>.
, where Delhi is the subject, capital of is the predicate and India is the object.
The triples can also be represented in the form of URIs (Uniform Resource Identifier).
Example of URI triple:
<http://www.abc.org/subject/Delhi>
<http://www.abc.org/predicate/capitalOf>
<http://www.abc.org/object/India>.
24