Download as pdf or txt
Download as pdf or txt
You are on page 1of 25

COMP210: Articial Intelligence

Lecture 14. Knowledge representation (3)


Boris Konev

http://www.csc.liv.ac.uk/konev/COPM210/

Boris Konev

COMP210: Articial Intelligence. Lecture 14. Knowledge representation (3) p. 1/2

Overview
The last lecture looked in detail at using rules for knowledge representation. While rules have been widely used, there are several other important approaches to knowledge representation. Three of these are Structured objects semantic nets. frames; logic; This lecture covers the rst two of these.

Boris Konev

COMP210: Articial Intelligence. Lecture 14. Knowledge representation (3) p. 2/2

Structured Objects
Structured objects are: Knowledge representation formalisms whose components are essentially similar to the nodes and arcs found in graphs. In contrast to production rules and formal logic. An attempt to incorporate certain desirable features of human memory organisation into knowledge representations.

Boris Konev

COMP210: Articial Intelligence. Lecture 14. Knowledge representation (3) p. 3/2

Semantic Networks
Developed by Quillian in 1968, as a model for human memory semantic memory. Models the associations between ideas that people maintain. Semantic net is a labelled graph. nodes in graph represent objects, concepts, or situations; arcs in graph represent relationships between objects.

Boris Konev

COMP210: Articial Intelligence. Lecture 14. Knowledge representation (3) p. 4/2

Semantic Networks
Nodes objects, concepts, events,. . . Arcs relationships between nodes
Animals subset subset legs

Birds moving method

legs

Mammals

subset

flies

subset

Penguins member

moving method

walks

Cats member

friend Opus friend


Boris Konev

Bill

COMP210: Articial Intelligence. Lecture 14. Knowledge representation (3) p. 5/2

Key types of arc


x y x is a kind of y ()
subset

Example: penguin bird


x y x is a y
member

subset

Example: opus penguin


x y x is R-related to y
R

member

Example: bill opus N OTATION


Boris Konev

f riend

AND TERMINOLOGY MAY DIFFER IN VARIOUS TEXTBOOKS

COMP210: Articial Intelligence. Lecture 14. Knowledge representation (3) p. 6/2

Inheritance
Inheritance is one of the main kind of reasoning done in semantic nets The subset relation is often used to link a class and its superclass. Some links (e.g. legs) are inherited along subset paths The semantics of a semantic net can be relatively informal or very formal Often dened at the implementation level
Boris Konev

Mammals

legs

subset

Cats member Bill

COMP210: Articial Intelligence. Lecture 14. Knowledge representation (3) p. 7/2

Example
Animals subset subset legs

Birds moving method

legs

Mammals

subset

flies

subset

Penguins member

moving method

walks

Cats member

friend Opus friend Bill

Bill (as all Cats) has 4 legs Opus is a bird Opus cannot y ...
Boris Konev

COMP210: Articial Intelligence. Lecture 14. Knowledge representation (3) p. 8/2

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. It can cause conicting inheritance. Nixon Diamond

Boris Konev

COMP210: Articial Intelligence. Lecture 14. Knowledge representation (3) p. 9/2

Problems with Semantic Nets I


Binary relations are easy to represent. Others are harder. Example: Opus brings tequila to the party.
Party where Brings who Opus

what Tequila

Boris Konev

COMP210: Articial Intelligence. Lecture 14. Knowledge representation (3) p. 10/2

Problems with of Semantic Nets II


Other problematic statements. . . negation Opus does not ride a bicycle; disjunction Opus eats oranges or apples; Quantied statements are very hard for semantic nets. Examples: every dog has bitten a postman every dog has bitten every postman Partitioned semantic nets can represent these.

Boris Konev

COMP210: Articial Intelligence. Lecture 14. Knowledge representation (3) p. 11/2

Advantages of Semantic Nets


Easy to visualise Relationships can be arbitrarily dened by the knowledge engineer Formal denitions of semantic networks have been developed. Related knowledge is easily clustered. Efcient in space requirements Objects represented only once

Boris Konev

COMP210: Articial Intelligence. Lecture 14. Knowledge representation (3) p. 12/2

Disadvantages of Semantic Nets


Inheritance (particularly from multiple sources and when exceptions in inheritance are wanted) can cause problems. Facts placed inappropriately cause problems. No standards about node and arc values

Boris Konev

COMP210: Articial Intelligence. Lecture 14. Knowledge representation (3) p. 13/2

Attempted Improvements
Building search heuristics into the network. More sophisticated logical structure, involving partitioning. These improvements meant that the formalisms original simplicity was lost.

Boris Konev

COMP210: Articial Intelligence. Lecture 14. Knowledge representation (3) p. 14/2

Frames
Frames semantic net with properties and methods Devised by Marvin Minsky, 1974. Incorporates certain valuable human thinking characteristics: Expectations, assumptions, stereotypes. Exceptions. Fuzzy boundaries between classes. The essence of this form of knowledge representation is typicality, with exceptions, rather than denition. Hierarchical structure Similar to class hierarchies

Boris Konev

COMP210: Articial Intelligence. Lecture 14. Knowledge representation (3) p. 15/2

How Frames are Organised I


A frame can represent a specic entry, or a general concept Each frame has A name Slots (attributes) which have values a specic value a default value an inherited value a pointer to another frame a procedure that gives the value

Boris Konev

COMP210: Articial Intelligence. Lecture 14. Knowledge representation (3) p. 16/2

Example frame system


Animals Alive: T Flies: F isa Birds Legs: 2 Flies: T isa Penguins Cats isa Legs: 4 isa Bats Legs: 2 Flies: F instance Opus Name: Opus Friend: instance Bill Name: Bill DoB: 02/02/1997 Age: procedure to calculate age from todays date and DoB Friend: Flies: T instance Pat Name: Pat isa

Mammals

Boris Konev

COMP210: Articial Intelligence. Lecture 14. Knowledge representation (3) p. 17/2

Reasoning
How to reason with frame systems? Easy to answer questions such as is x a y ? Simply follow the instance and/or isa links. Example: Is Opus a bird? Also useful for default reasoning. Simply inherit all default values that are not explicitly provided. Example: How many legs does Opus have?

Boris Konev

COMP210: Articial Intelligence. Lecture 14. Knowledge representation (3) p. 18/2

How Frames are Organised II


In the higher levels of the frame hierarchy, typical knowledge about the class is stored. In the lower levels, the value in a slot may be a specic value, to overwrite the value which would otherwise be inherited from a higher frame. An instance of an object is joined to its class by an instance relationship. A class is joined to its superclass by an isa relationship.

Boris Konev

COMP210: Articial Intelligence. Lecture 14. Knowledge representation (3) p. 19/2

Scripts
Scripts are a variant of frames, for representing stereotypical sequences of events. A script is thus a frame with a set of prescribed slots, for example: Some initial conditions; Some nal conditions; Some state description; Some actions; and Some actors The structure of the script is heavily domain dependent.

Boris Konev

COMP210: Articial Intelligence. Lecture 14. Knowledge representation (3) p. 20/2

Example
SCRIPT Name: RESTAURANT Roles: Customer, Waiter, Cook, Cashier Entry condition: Customer is hungry Props: Food, table, money, menu, tip Events: 1/ Customer enters restaurant 2/ Customer goes to table 3/ Waiter brings menu 4/ Customer orders food 5/ Waiter brings food 6/ Customer eats food ... 10/ Customer leaves restaurant Main concept: 6 Results: Customer not hungry, Customer has less money, Restaurant has more money

Boris Konev

COMP210: Articial Intelligence. Lecture 14. Knowledge representation (3) p. 21/2

Why Scripts
Scripts developed by Roger Schank for understanding stories. Scripts provide context information without which sentences cannot be understood: sentences are not unconstrained sequences of words; stories are not unconstrained sequences of sentences. people leave large amounts of assumed detail out Schank developed SAM (Script Applier Mechanism) that could ll in gaps in stories. Also able to explain elements of stories, e.g., people get upset or angry when story deviates from script.
Boris Konev

COMP210: Articial Intelligence. Lecture 14. Knowledge representation (3) p. 22/2

Frame Advantages
Fairly intuitive for many applications Similar to human knowledge organisation Suitable for causal knowledge Easy to include default information and detect missing values Easier to understand than logic or rules Very exible

Boris Konev

COMP210: Articial Intelligence. Lecture 14. Knowledge representation (3) p. 23/2

Frame Disadvantages
No standards (slot-ller values) More of a general methodology than a specic representation: Frame for a class-room will be different for a professor and for a maintenance worker No associated reasoning/inference mechanisms

Boris Konev

COMP210: Articial Intelligence. Lecture 14. Knowledge representation (3) p. 24/2

Problems with Frames & Semantic Nets


Both frames and semantic nets are essentially arbitrary. Both are useful for representing certain sorts of knowledge. But both are essentially ad hoc lack precise meaning, or semantics. Inference procedures poorly dened & justied. The syntax of KR scheme is irrelevant. Logic generalises these schemes. . .

Boris Konev

COMP210: Articial Intelligence. Lecture 14. Knowledge representation (3) p. 25/2

You might also like