Sie sind auf Seite 1von 37

241-320 Design Architecture and Engineering for Intelligent System Suntorn Witosurapot

Contact Address: Phone: 074 287369 or Email: wsuntorn@coe.psu.ac.th

November 2010

Lecture 11: Knowledge Representation and Reasoning Part 2 (Semantic Networks, Frames)

Preview:
So far, we have learned how to use propositional logic as a knowledge representation language We can write sentences in this language (syntax) with some logical structure We can define the interpretations of these sentences using truth tables (semantics)
KR can be classified into 3 categories : 1. Logic-based representation ()
Propositional Logic

2. Object-based representation ()
Semantic Networks, Frames 3. Rule-based representation ()
241-320 Design Architecture & Engineering for Intelligent System

This lecture

Knowledge Representation and Reasoning - part 2

Preview:
In this lecture, we will learned about 2 methods of object-based KR (semantic networks & frames) Semantic nets are a simple way of representing the relationships between entitities and concepts. Frames can do the things that semantics networks do, but take a more object-oriented type approach.
They allow procedures (called demons) to be attached to their slots increasing greatly the power of this knowledge representation method.

241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 2

Outiline
Semantic Networks
Comparison with Database System Properties of Semantic Nets Semantic network operation Disadvantages

Frame-based Approach
Examples Advantages & Disadvantages

241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 2

Semantic networks at a glance


(network) Meaning of an object is defined in terms of a network of associations with other objects in a mind or a knowledge base Semantic nets, (Arc)
241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 2

Example 1: KR in Semantic Nets

241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 2

Example 2: KR in Semantic Nets


Correct: Height of ThreeFinger Brown is 195cm Incorrect: Height of ThreeFinger Brown is 178cm

241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 2

Comparison with Database System


An Instance A record structure: or the same as directed graph:

Correct: marital status(J J ADAMS) is married Incorrect: marital status(J J ADAMS) is divorced
241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 2

Comparison with Database System (cont.)

Properties of traditional database systems: Only aspects of entities & their simple relationships can be represented. Reasoning is very simple: reasoning = lookup
241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 2

10

Examples of Stronger relationships in Semantic Nets


Network representation of properties of snow & ice

241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 2

11

Examples of Stronger relationships in Semantic Nets (cont.)


, the third year student of primary school feeds the pigeon whose name is .
Relations: is_a(somchai, third year student) is_a(third year student, primary school) go(primary, school) owns(, ) is_a(santiphab, pigeon) color(pigeon, grey) is_a(pigeon, bird) has_part(bird, feather)
241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 2

12

Examples of Stronger relationships in Semantic Nets (cont.)


Q: Can you describe the relationships below?

State: I own a tan leather chair.


241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 2

13

Properties of Semantic Nets


Allows to structure the knowledge to reflect the structure of that part of the universe which is being represented. Strong representation facilities, and consume less memory through the use of property inheritance () Ex: if is_a(x,y) and is_a(y,z) then is_a(x,z). if has_part(x,y) and has_part(y,z) then has_part(x,z). Note: the notion explained up to now quite general and must be much refined when implementation, especially clear syntax, but clear semantics has to be worked out.
241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 2

14

Example of Reasoning in Semantic Nets


(pattern matching) 2 : Whats the color of , the pegion owned by ? , color(,X)

241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 2

15

Semantic network operation


Assume the following network is coded in a computer.

241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 2

16

CASE 1: A simple question to node


e.g. How does a bird travel?
The node will start to find from the information attached to it and just return the answer, if found

241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 2

17

CASE 2: A more complex question to node


e.g. How does the tweety travel?
If the node is unable to locate the answer via a local arc, then it searches for an answer via its inheritance links (IS-A relation).

241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 2

18

Detour: IS-A Hierachy


is-a corresponds mathematically to the subset relation, instance corresponds math. to the membership relation,

241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 2

19

Question:
How many legs does the e1 have?

Hint: using inheritance


To find the value of a property of e1, first look at e1 If the property is not attached to that node, "climb" the isa link to the node's parent and search there. Repeat, using isa/ako links, until the property is found or the inheritance hierarchy is exhausted.
241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 2

20

Disadvantage of Semantic Network


Incomplete (no explicit operational/procedural knowledge) Lack of standards, ambiguity in node/link descriptions Not temporal (i.e. doesn't represent time or sequence) Finally Semantic networks are mainly used as an aid to analysis to visually represent parts of the problem domain. The `knowledge' can be transformed into rules or frames for implementation
Knowledge Representation and Reasoning - part 2

241-320 Design Architecture & Engineering for Intelligent System

21

Outiline
Semantic Networks
Introduction in Brief Comparison with Database System Properties of Semantic Nets Semantic network operation Disadvantages

Frame-based Approach
Examples Advantages & Disadvantages
241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 2

22

Introduction to Frame-based Approach


A frame is a data structure containing typical knowledge about a concept or object and can encompass both semantic & procedural knowledge. A frame represents knowledge about real world things (or entities) by containing both descriptions of attributes and procedural details
241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 2

23

Frames
A frame consists of a collection of slots which can be filled by values or pointers to other frames. A simple scenario: We can know the meaning of Birthday party, since we have already known the meaning of Party Meaning of Childs birthday party
Link to

people assembled to should be approximated by celebrate a birthday


not approx. by

Meaning of party
241-320 Design Architecture & Engineering for Intelligent System

a party assembled to celebrate a birthday

Knowledge Representation and Reasoning - part 2

24

Frames (cont.)
Children all know the meaning of Childs birthday party and plus more default assignments:

241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 2

25

Why Frames?
A definition: Frame is a remembered framework for representing knowledge that can be adapted to fit reality by changing details as necessary. Frame is a data-structure for representing a stereotyped situation, like [...] going to a childs birthday party. Attached to each frame are several kinds of information
Some of this info. is about how to use the frame Some is about what one can expect to happen next Some is about what to do if these expectations are not confirmed
241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 2

26

Frames What and Why?


The other definition: A Frame is a collection of questions to be asked about a hypothetical situation: it specifies issues to be raised and methods to be used in dealing with them. To understand a situation, questions can be asked like: What caused it (agent)? What was the purpose (intention)? What are the consequences (effects)? Whom does it affect (recipient)? How is it done (instruments)?
241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 2

27

Ex: Representation of a View of a Cube


Consider conceptional object like a view of a cube as a composed object with relations.

241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 2

28

Different Views of a Cube

241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 2

29

Example (cont.)

Part of a tabular representation of the frame for one view


241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 2

30

Part of the Frame Description of a Hotel Room

241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 2

31

Procedural Attachment
This is a way to balance between: the expressiveness of a KR formalism and the efficiency to manipulate the represented knowledge Idea of frames: Structure the knowledge, this means also restricting the expressive power in some parts, and extending in others. The Procedural Attachment allows functions to be written in a programming language to be stored instead of the value of some slot.
241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 2

32

Procedural Attachment (cont.)

Instead of writing explicit values, the values of the slots area, circumference are calculated by need. Consider update of length from 5cm to 6cm!
241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 2

33

Frames: Advantages & Disadvantages


Disadvantages complex reasoning (inferencing) is difficult explanation is difficult Advantages knowledge domain can be naturally structured [a similar motivation as for the O-O approach]. handles both semantic/procedural knowledge. easy to include the idea of default values, detect missing values, include specialised procedures and to add further slots to the frames
241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 2

34

Conclusion
Semantic Nets: Structured Representation. Inheritance are ways of achieving some commonsense reasoning by default Frames: organize knowledge around concepts considered to be of interest (like cube & hotel room in the example code). Also allow procedural attachment attached to slots for yielding flexibility in uses

241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 2

35

Final Notes
There is no single most adequate knowledge representation formalism for everything. Main points for selecting a representation formalism: what should be represented, how should the knowledge be processed.

241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 2

36

Reading 5
(Knowledge Representation)
5.5.3 5.5.4

241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 2

37

Das könnte Ihnen auch gefallen