0% found this document useful (0 votes)
34 views72 pages

Knowledge Representation

The document discusses knowledge representation in knowledge-based systems (KBS), outlining its importance for storing and manipulating knowledge through various schemes such as semantic networks and frames. It highlights the types of knowledge to be represented, properties of knowledge representation systems, and the advantages and disadvantages of different representation methods. Additionally, it addresses the role of logic in knowledge representation and reasoning processes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views72 pages

Knowledge Representation

The document discusses knowledge representation in knowledge-based systems (KBS), outlining its importance for storing and manipulating knowledge through various schemes such as semantic networks and frames. It highlights the types of knowledge to be represented, properties of knowledge representation systems, and the advantages and disadvantages of different representation methods. Additionally, it addresses the role of logic in knowledge representation and reasoning processes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 72

KNOWLEDGE BASED SYSTEM

KNOWLEDGE REPRESENTATION

Peter Obiria
KNOWLEDGE REPRESENTATION

▪A framework for storing and manipulating


knowledge
▪A set of syntactic and semantic conventions
that make it possible to describe things
▪There is always a relationship between the form
in which knowledge is represented and the way
in which the knowledge is used. You can use
domain specific or general-purpose
representation
MOTIVATION

▪KBS are useless without the ability to


represent knowledge
▪different knowledge representation schemes
may be appropriate
▪depending on tasks and circumstances
▪knowledge representation schemes and
reasoning methods must be coordinated
WHAT TO REPRESENT

▪Types of knowledge to be represented in AI


systems includes:
• Objects -Facts about objects in our world
domain. e.g. cars have wheels,
cows are herbivores.
• Events - Actions that occur in our world. e.g.
The power-sharing deal was
sealed on 28th February 2008

WHAT TO REPRESENT

▪Performance -A behavior like playing volleyball


involves knowledge about
how to do things like serve, boost, spike and
block.
• Meta-knowledge- knowledge about what we
know.
• Thus in solving problems in AI we must
represent knowledge
• There are two entities to deal with, i.e. facts
and representation of these.
• Facts -truths about the real world and what we
USES OF KNOWLEDGE

▪Learning
▪Retrieval
▪Reasoning
PROPERTIES OF KNOWLEDGE
REPRESENTATION SYSTEMS

▪Representational Adequacy:- the ability to


represent the required knowledge;
• Inferential Adequacy:- the ability to manipulate
the knowledge represented to produce new
knowledge
corresponding to that inferred from the original;
• Inferential Efficiency:- the ability to direct the
inferential mechanisms into the most productive
directions by storing appropriate guides;
• Acquisitional Efficiency:- the ability to acquire
new knowledge using automatic methods
KNOWLEDGE REPRESENTATION
SCHEMES

▪Natural language
▪Logic
▪Predicate and Propositional Logic
▪Conceptual or Terminological Logics
▪Production Rules
KNOWLEDGE REPRESENTATION
SCHEMES
▪Semantic Networks
▪Frames
▪Conceptual Dependency Grammar
▪Conceptual Graphs
▪Ontology
LOGIC REPRESENTATION

▪A representation that has clear syntax and


semantics
▪Its syntax defines all possible sequences of
symbols that constitute sentences of the
language (grammar to form sentences)
▪Its semantics determines the facts in the world
to which the sentences refer
(meaning of sentences) Each sentence makes a
claim about the world.
▪Its proof theory (inference rules and proof
TYPES OF LOGICS

▪Propositional logic
▪Predicate logic (FOPC) HOPC
▪Fuzzy Logic
▪Temporal logic
▪Description Logics
SEMANTIC NETWORKS

▪A semantic network is a structure for


representing knowledge as a pattern of
interconnected nodes and arcs.
▪Nodes in the net represent concepts of
entities, attributes, events, values. Arcs in the
network
represent relationships that hold between the
concepts.
SEMANTIC NETWORKS

▪A semantic network is a graph theoretic data


structure whose nodes represent word senses and
whose arcs express semantic relationships between
these
word senses.
▪Concepts can be represented as hierarchies of
inter- connected concept nodes
(e.g. animal, bird, canary)
▪Any concept has a number of associated attributes
at a given level (e.g. animal
SEMANTIC NETWORKS
SEMANTIC NETWORKS

▪A semantic network is a simple representation


scheme that uses a graph of labeled nodes and
labeled, directed arcs to encode knowledge.
▪Usually used to represent static, taxonomic,
concept dictionaries
▪Semantic networks are typically used with a special
set of accessing procedures that perform “reasoning”
▪e.g., inheritance of values and relationships

15
SEMANTIC NETWORKS

▪Semantic networks were very popular in the ‘60s


and ‘70s but are less frequently used today.
▪Often much less expressive than other KR
formalisms
▪The graphical depiction associated with a
semantic network is a significant reason for their
popularity.
NODES AND ARCS

▪Arcs define binary relationships


that hold between objects denoted
by the nodes.
mother age
Sue john 5
wi
age f
hus e fathe
ba nd r mother(john,sue)
3 Max age(john,5)
4 age wife(sue,max)
age(max,34)
...
17
SEMANTIC NETWORKS

▪The ISA (is-a) or AKO (a-kind-of)


Anima
relation is often used to link l
instances to classes, classes to isa
super classes Bird
hasPart

▪Some links (e.g. hasPart) are isa Wing


inherited along ISA paths.
Robin
▪The semantics of a semantic isa isa
net can be relatively informal or
very formal
▪often defined at the Rusty Red 18
REIFICATION

▪Non-binary relationships can be


represented by “turning the
relationship into an object”
▪This is an example of what logicians giv give
e r
call “reification”
▪reify v : consider an abstract objec joh
concept to be real ma recipientt bo n
ry ok
▪We might want to represent the 32
generic give event as a relation
involving three things: a giver, a 19
INDIVIDUALS AND CLASSES
Genus

▪Many semantic Anima


networks distinguish l
subclass instanc
▪nodes representing e
hasPart
individuals and Bird
those representing subclass Wing
classes Robin
▪the “subclass” instanc instanc
relation from the e e
“instance-of”
relation Rusty Red 20
LINK TYPES

21
INFERENCE BY INHERITANCE

▪One of the main kinds of reasoning done in a


semantic net is the inheritance of values along the
subclass and instance links.
▪Semantic networks differ in how they handle the
case of inheriting multiple different values.
▪All possible values are inherited, or
▪Only the “lowest” value or values are inherited

22
CONFLICTING INHERITED VALUES

23
MULTIPLE INHERITANCE

▪A node can have any number of superclasses that


contain it, enabling a node to inherit properties from
multiple “parent” nodes and their ancestors in the
network.
▪These rules are often used to determine inheritance
in such “tangled” networks where multiple
inheritance is allowed:
▪If X<A<B and both A and B have property P, then X
inherits A’s property.
▪If X<A and X<B but neither A<B nor B<Z, and A 24
FROM SEMANTIC NETS TO
FRAMES
▪Semantic networks morphed into Frame
Representation Languages in the ‘70s and
‘80s.
▪A frame is a lot like the notion of an object in
OOP, but has more meta-data.
▪A frame has a set of slots.
▪A slot represents a relation to another frame
(or value).
▪A slot has one or more facets. 26
FACETS

▪A slot in a frame holds more than a value.


▪Other facets might include:
▪current fillers (e.g., values)
▪default fillers
▪minimum and maximum number of fillers
▪type restriction on fillers (usually expressed as
another frame object)

27
FACETS

▪attached procedures (if-needed, if-added, if-


removed)
▪salience measure
▪attached constraints or axioms
▪In some systems, the slots themselves are
instances of frames.
29
ADVANTAGES OF SEMANTIC
NETWORKS
• Easy to visualize and understand.
• The knowledge engineer can arbitrarily
define the relationships.
• Related knowledge is easily categorised.
• Efficient in space requirements.
• Node objects represented only once.
• Standard definitions of semantic networks
have been developed.
DISADVANTAGES OF SEMANTIC
NETWORKS
• The limitations of conventional semantic
networks were studied extensively
by a number of workers in AI.
• Many believe that the basic notion is a
powerful one and has to be complemented by,
for example, logic to improve the notion’s
expressive power and
robustness.
DISADVANTAGES OF SEMANTIC
NETWORKS
▪Need to incorporate reasoning used to
describe events.
▪Limited in handling quantifiers e.g. “Every
dog has bitten a postman”
▪Binary relations are usually easy to
represent, but some times is difficult.e.g. try
to represent the sentence: “Nengo caused
trouble to the party".
FRAMES


These are knowledge representation
formalisms in which stereotyped information
on objects are represented.
Features:
• capture object attributes and their values;
▪• search done by matching;
Structure:
• Node and collection of attributes(slots)
FRAME
●represents related knowledge about a subject
● provides default values for most slots
●frames are organized hierarchically
● allows the use of inheritance
●knowledge is usually organized according to cause and effect
relationships
● slots can contain all kinds of items
● rules, facts, images, video, comments, debugging info, questions, hypotheses,
other frames
● slots can also have procedural attachments
● procedures that are invoked in specific situations involving a particular slot
● on creation, modification, removal of the slot value
SIMPLE FRAME
EXAMPLE
Slot Name Filler
name Astérix
height small
weight low
profession warrior
armor helmet
intelligence very high
marital status presumed single
OVERVIEW OF FRAME
STRUCTURE
🠶 two basic elements: slots and facets (fillers, values, etc.);
🠶 typically have parent and offspring slots
🠶 used to establish a property inheritance hierarchy
(e.g., specialization-of)
🠶 descriptive slots
🠶 contain declarative information or data (static knowledge)
🠶 procedural attachments
🠶 contain functions which can direct the reasoning process (dynamic
knowledge)
(e.g., "activate a certain rule if a value exceeds a given level")
🠶 data-driven, event-driven ( bottom-up reasoning)
🠶 expectation-drive or top-down reasoning
🠶 pointers to related frames/scripts - can be used to transfer control to a
[Rogers 199
SLOTS
🠶each slot contains one or more facets
🠶facets may take the following forms:
🠶 values
🠶 default
🠶 used if there is not other value present
🠶 range
🠶 what kind of information can appear in the slot
🠶 if-added
🠶 procedural attachment which specifies an action to be taken when a value
in the slot is added or modified (data-driven, event-driven or bottom-up
reasoning)
🠶 if-needed
🠶 procedural attachment which triggers a procedure which goes out to get
information which the slot doesn't have (expectation-driven; top-down
reasoning)
🠶 other
🠶 may contain frames, rules, semantic networks, or other types of knowledge
[Rogers 199
USAGE OF FRAMES

🠶filling slots in frames


🠶can inherit the value directly
🠶can get a default value
🠶these two are relatively inexpensive
🠶can derive information through the attached
procedures (or methods) that also take
advantage of current context (slot-specific
heuristics)
🠶filling in slots also confirms that frame or script
is appropriate for this particular situation
[Rogers 199
RESTAURANT FRAME
EXAMPLE
▪generic template for restaurants
▪different types
▪default values
▪script for a typical sequence of
activities at a restaurant

[Rogers 199
GENERIC Generic RESTAURANT Frame

RESTAURAN
Specialization-of: Business-Establishment
Types:

T FRAME
range: (Cafeteria, Fast-Food, Seat-Yourself, Wait-To-Be-Seated)
default: Seat-Yourself
if-needed: IF plastic-orange-counter THEN Fast-Food,
IF stack-of-trays THEN Cafeteria,
IF wait-for-waitress-sign or reservations-made THEN Wait-To-Be-Seated,
OTHERWISE Seat-Yourself.
Location:
range: an ADDRESS
if-needed: (Look at the MENU)
Name:
if-needed: (Look at the MENU)
Food-Style:
range: (Burgers, Chinese, American, Seafood, French)
default: American
if-added: (Update Alternatives of Restaurant)
Times-of-Operation:
range: a Time-of-Day
default: open evenings except Mondays
Payment-Form:
range: (Cash, CreditCard, Check, Washing-Dishes-Script)
Event-Sequence:
default: Eat-at-Restaurant Script
Alternatives:
range: all restaurants with same Foodstyle [Rogers 199
RESTAURANT
EAT-AT-RESTAURANT Script

SCRIPT Props: (Restaurant, Money, Food, Menu, Tables, Chairs)


Roles: (Hungry-Persons, Wait-Persons, Chef-Persons)
Point-of-View: Hungry-Persons
Time-of-Occurrence: (Times-of-Operation of Restaurant)
Place-of-Occurrence: (Location of Restaurant)
Event-Sequence:
first: Enter-Restaurant Script
then: if (Wait-To-Be-Seated-Sign or Reservations)
then Get-Maitre-d's-Attention Script
then: Please-Be-Seated Script
then: Order-Food-Script
then: Eat-Food-Script unless (Long-Wait) when Exit-Restaurant-Angry Script
then: if (Food-Quality was better than Palatable)
then Compliments-To-The-Chef Script
then: Pay-For-It-Script
finally: Leave-Restaurant
[Rogers 199 Script
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
FRAME PROBLEMS

🠶it is tempting to use frames as definitions of concepts


🠶not appropriate because there may be valid
instances of a concept that do not fit the stereotype
🠶exceptions can be used to overcome this
🠶can get very messy
🠶inheritance
🠶not all properties of a class stereotype should be
propagated to subclasses
🠶alteration of slots can have unintended
consequences in subclasses
LOGIC

▪here: emphasis on knowledge


representation purposes
▪logic and reasoning is discussed in
the next chapter
REPRESENTATION, REASONING
AND LOGIC
🠶two parts to knowledge representation
language:
🠶syntax
🠶describes the possible configurations that
can constitute sentences
🠶semantics
🠶determines the facts in the world to which
the sentences refer
🠶tells us what the agent believes
[Rogers 199
REASONING

🠶process of constructing new configurations


(sentences) from old ones
🠶proper reasoning ensures that the new
configurations represent facts that actually
follow from the facts that the old configurations
represent
🠶this relationship is called entailment and can be
expressed as
KB |= alpha
🠶knowledge base KB entails the sentence alpha
[Rogers 199
INFERENCE METHODS
🠶an inference procedure can do one of two things:
🠶 given a knowledge base KB, it can derive new sentences α that are
(supposedly) entailed by KB
KB |- α ==> KB |= α
🠶 given a knowledge base KB and another sentence alpha, it can report
whether or not alpha is entailed by KB
KB ∧ α ==> KB |= α
🠶an inference procedure that generates only entailed sentences
is called sound or truth-preserving
🠶the record of operation of a sound inference procedure is called
a proof
🠶an inference procedure is complete if it can find a proof for any
sentence that is entailed
[Rogers 199
KR LANGUAGES AND
PROGRAMMING LANGUAGES
🠶how is a knowledge representation language
different from a programming language (e.g.
Java, C++)?
🠶programming languages can be used to
express facts and states
🠶what about "there is a pit in [2,2] or [3,1] (but
we don't know for sure)" or "there is a wumpus
in some square"
🠶programming languages are not expressive
enough for situations with incomplete
information
[Rogers 199
KR LANGUAGES AND
NATURAL LANGUAGE
🠶how is a knowledge representation language different from
natural language
🠶 e.g. English, Spanish, German, …
🠶natural languages are expressive, but have evolved to meet the
needs of communication, rather than representation
🠶the meaning of a sentence depends on the sentence itself and
on the context in which the sentence was spoken
🠶 e.g. “Look!”
🠶sharing of knowledge is done without explicit representation of
the knowledge itself
🠶ambiguous (e.g. small dogs and cats)
[Rogers 199
GOOD KNOWLEDGE
REPRESENTATION LANGUAGES

🠶combines the best of natural and formal languages:


🠶 expressive
🠶 concise
🠶 unambiguous
🠶 independent of context
🠶 what you say today will still be interpretable tomorrow
🠶 efficient
🠶 the knowledge can be represented in a format that is suitable for
computers
🠶 practical inference procedures exist for the chosen format
🠶 effective
🠶 there is an inference procedure which can act on it to make new
sentences

[Rogers 199
EXAMPLE: REPRESENTATION
METHODS

[Guinness 1995]
ONTOLOGIES

🠶principles
🠶definition of terms
🠶lexicon, glossary
🠶relationships between terms
🠶taxonomy, thesaurus
🠶purpose
🠶establishing a common vocabulary for a
domain
🠶graphical representation
🠶UML, topic maps,
🠶examples
🠶IEEE SUO, SUMO, Cyc, WordNet
TERMINOLOGY
🠶ontology
🠶 provides semantics for concepts
🠶 words are used as descriptors for concepts
🠶lexicon
🠶 provides semantics for all words in a language by defining words
through descriptions of their meanings
🠶thesaurus
🠶 establishes relationships between words
🠶 synonyms, homonyms, antonyms, etc.
🠶 often combined with a taxonomy
🠶taxonomy
🠶 hierarchical arrangement of concepts
🠶 often used as a “backbone” for an ontology
WHAT IS THE SEMANTIC WEB?

▪ Based on the World Wide Web


▪ Characterized by resources, not text and images
▪Meant for software agents, not human viewers
▪Defined by structured documents that reference
each other, forming potentially very large
networks
▪Used to simulate knowledge in computer
systems
▪ Semantic Web documents can describe just about
anything humans can communicate about
ONTOLOGIES AND THE SEMANTIC
WEB

▪ Ontologies are large vocabularies


▪Defined within Semantic Web documents
(OWL)
▪Define languages for other documents
(RDF)
▪Resources can be instances of ontology
classes
▪ Upper Ontologies define basic, abstract
concepts
ONTOLOGY TERMS
🠶precision
🠶a term identifies exactly one concept
🠶expressiveness
🠶the representation language allows the formulation of very
flexible statements
🠶descriptors for concepts
🠶ideally, there should be a one-to-one mapping between a term
and the associated concept (and vice versa): high precision,
and high expressiveness
🠶this is not the case for natural languages
🠶“parasitic interpretation” of terms often implies meaning that
is not necessarily specified in the ontology
IEEE STANDARD UPPER
ONTOLOGY
🠶Project to develop a standard for ontology specification
and registration
🠶based on contributions of three SUO candidate projects
🠶IFF
🠶OpenCyc/CycL
🠶SUMO
🠶Standard Upper Ontology Working Group (SUO WG),
Cumulative Resolutions, 2003,
http://suo.ieee.org/SUO/resolutions.html
OPENCYC

▪derived from the development of Cyc


▪a very large-scale knowledge based
system
▪Cycorp, The Syntax of CycL, 2002,
http://www.cyc.com/cycdoc/ref/cycl-
syntax.html
SUMO

▪stands for “Suggested Upper Merged


Ontology”
▪Niles, Ian, and Adam Pease, Towards a
Standard Upper Ontology, 2001
▪Standard Upper Ontology Working Group
(SUO WG), Cumulative Resolutions, 2003,
http://suo.ieee.org/SUO/resolutions.html
WORDNET

🠶online lexical reference system


🠶design is inspired by current psycholinguistic
theories of human lexical memory
🠶English nouns, verbs, adjectives and adverbs
🠶organized into synonym sets, each representing
one underlying lexical concept
🠶related efforts for other languages
LOJBAN
🠶Artificial, logical, human language derived from a
language called Loglan
🠶one-to-one correspondence between concepts and words
🠶 high precision
🠶high expressiveness
🠶audio-visually isomorphic nature
🠶 only one way to write a spoken sentence
🠶 only one way to read a written sentence
🠶Logical Language Group, Official Baseline Statement,
2005
🠶 http://www.lojban.org/llg/baseline.html
WHAT IS LOJBAN?

▪ A constructed/artificial language
▪ Developed from Loglan
▪Dr. James Cooke Brown
▪Introduced between 1955-1960
▪ Maintained by The Logical Language
Group
▪Also known as la lojbangirz.
▪Branched Lojban off from Loglan in
1987 [Brandon Wirick,
MAIN FEATURES OF LOJBAN

▪ Usable by Humans and ▪ Easy to Learn


Computers ▪ Large Vocabulary
▪ Culturally Neutral ▪ No Exceptions
▪ Based on Logic ▪ Fosters Clear Thought
▪ Unambiguous but Flexible ▪ Variety of Uses
▪ Phonetic Spelling ▪ Demonstrated with Prose
and Poetry

[Brandon Wirick,
LOJBAN AT A GLANCE

Example sentence in English: “Wild


dogs bite.”
Translation into Lojban: “loi cicyge'u
cu batci”
cilce (cic) - x1 is wild/untamed
gerku (ger, ge'u) - x1 is a dog/canine of species/breed
x2
batci (bat) - x1 bites/pinches x2 on/at specific locus x3
with x4

cilce gerku → (cic) (ge'u)


[Brandon→ cicyge'u
Wirick,
HOW WOULD LOJBAN AND THE
SEMANTIC WEB WORK TOGETHER?

▪ Currently, most upper ontologies use English


▪Not really English, but arbitrary class names
▪Classes’ meanings cannot be directly inferred
from their names, nor vice-versa
▪ Translating English prose into Semantic Web
documents would be difficult
▪Class choices depend on context within prose
▪English prose is highly idiomatic
▪ Lojban does not have these problems
[Brandon Wirick,
ENGLISH V. LOJBAN

[Brandon Wirick,
OWL TO THE RESCUE
🠶XML-based. RDF on steroids.
🠶Designed for inferencing.
🠶Closer to the domain.
🠶Don’t need a PhD to understand it.
🠶Information sharing.
🠶 RDF-compatible because it is RDF.
🠶 Growing number of published OWL ontologies.
🠶 URIs make it easy to merge equivalent nodes.
🠶Different levels
🠶 OWL lite
🠶 OWL DL (description logics)
🠶 OWL full (predicate logic)
[Frank Vasquez, 2005]
DESCRIPTION LOGIC
🠶Classes
🠶Things, categories, concepts.
🠶Inheritance hierarchies via subclasses.
🠶Properties
🠶Relationships, predicates, statements.
🠶Can have subproperties.
🠶Individuals
🠶Instances of a class.
🠶Real subjects and objects of a
predicate.

[Frank Vasquez, 2005]


VISUALIZING THE
DATA MODEL
▪Venn Diagrams and Semantic
Networks.

[Frank Vasquez, 2005] Images from University of Manchester


RDF ONTOLOGIES
▪Dublin Core
▪FOAF
▪RDF vCard
▪RDF Calendar

▪SIMILE Location
▪SIMILE Job
▪SIMILE Apartment

[Frank Vasquez, 2005]


FIXING MODELING
CONFLICTS

1.mapAL =
Match(MA, ML) [Frank Vasquez, 2005]
IMPORTANT CONCEPTS AND
TERMS
🠶 attribute 🠶 knowledge base
🠶 common-sense knowledge 🠶 knowledge-based system
🠶 concept 🠶 knowledge representation
🠶 data 🠶 link
🠶 derivation 🠶 logic
🠶 entailment 🠶 meta-knowledge
🠶 epistemology 🠶 node
🠶 expert system (ES) 🠶 noise
🠶 expert system shell 🠶 object
🠶 facet 🠶 production rules
🠶 frame 🠶 reasoning
🠶 graph 🠶 relationship
🠶 If-Then rules 🠶 rule
🠶 inference 🠶 schema
🠶 script
🠶 inference mechanism
🠶 semantic net
🠶 information
🠶 slot
🠶 knowledge
SUMMARY KNOWLEDGE
REPRESENTATION
🠶knowledge representation is very important for
knowledge-based system
🠶popular knowledge representation schemes are
🠶rules, semantic nets, schemata (frames, scripts),
logic
🠶the selected knowledge representation scheme should
have appropriate inference methods to allow reasoning
🠶a balance must be found between
🠶effective representation, efficiency, understandability

You might also like