L10_KR_p2

download L10_KR_p2

of 37

Transcript of L10_KR_p2

  • 8/3/2019 L10_KR_p2

    1/37

    241-320 Design Architecture and Engineeringfor Intelligent System

    Suntorn Witosurapot

    Contact Address:Phone: 074 287369 or

    Email: [email protected]

    November 2010

  • 8/3/2019 L10_KR_p2

    2/37

    Lecture 11:

    Knowledge Representationand Reasoning Part 2

    (Semantic Networks, Frames)

  • 8/3/2019 L10_KR_p2

    3/37

    241-320 Design Architecture &Engineering for Intelligent System

    Knowledge Representation andReasoning - part 2

    3

    Preview:

    KR can be classified into 3 categories :

    1. Logic-based representation () Propositional Logic2. Object-based representation ()

    Semantic Networks, Frames

    3. Rule-based representation ()

    So far, we have learned how to use propositional logicas a knowledge representation language

    We can write sentences in this language (syntax) withsome logical structure

    We can define the interpretations of these sentencesusing truth tables (semantics)

    This lecture

  • 8/3/2019 L10_KR_p2

    4/37

    241-320 Design Architecture &Engineering for Intelligent System

    Knowledge Representation andReasoning - part 2 4

    Preview:

    In this lecture, we will learned about 2 methods ofobject-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 networksdo, 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 knowledgerepresentation method.

  • 8/3/2019 L10_KR_p2

    5/37

    241-320 Design Architecture &Engineering for Intelligent System

    Knowledge Representation andReasoning - part 2 5

    Outiline

    Semantic Networks

    Comparison with Database System

    Properties of Semantic Nets

    Semantic network operation

    Disadvantages

    Frame-based Approach

    Examples Advantages & Disadvantages

  • 8/3/2019 L10_KR_p2

    6/37

    241-320 Design Architecture &Engineering for Intelligent System

    Knowledge Representation andReasoning - part 2 6

    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)

  • 8/3/2019 L10_KR_p2

    7/37

    241-320 Design Architecture &Engineering for Intelligent System

    Knowledge Representation andReasoning - part 2 7

    Example 1: KR in Semantic Nets

  • 8/3/2019 L10_KR_p2

    8/37

    241-320 Design Architecture &Engineering for Intelligent System

    Knowledge Representation andReasoning - part 2 8

    Example 2: KR in Semantic Nets

    Correct:

    Height ofThree-Finger

    Brown is195cm

    Incorrect:

    Height ofThree-

    FingerBrown is178cm

  • 8/3/2019 L10_KR_p2

    9/37

    241-320 Design Architecture &Engineering for Intelligent System

    Knowledge Representation andReasoning - part 2 9

    Comparison with Database System

    Correct: marital status(J J ADAMS) is married

    Incorrect: marital status(J J ADAMS) is divorced

    An InstanceA record structure: or the same as directed graph:

  • 8/3/2019 L10_KR_p2

    10/37

    241-320 Design Architecture &Engineering for Intelligent System

    Knowledge Representation andReasoning - part 2 10

    Comparison with Database System(cont.)

    Properties of traditional database systems:

    Only aspects of entities&their simplerelationships can be represented.

    Reasoning is very simple: reasoning = lookup

  • 8/3/2019 L10_KR_p2

    11/37

    241-320 Design Architecture &Engineering for Intelligent System

    Knowledge Representation andReasoning - part 2 11

    Examples of Stronger relationships inSemantic Nets

    Network representation ofproperties of snow & ice

  • 8/3/2019 L10_KR_p2

    12/37

    241-320 Design Architecture &Engineering for Intelligent System

    Knowledge Representation andReasoning - part 2 12

    Examples of Stronger relationships inSemantic Nets (cont.)

    , the third year student of primary school feedsthe 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)

  • 8/3/2019 L10_KR_p2

    13/37

    241-320 Design Architecture &Engineering for Intelligent System

    Knowledge Representation andReasoning - part 2 13

    Examples of Stronger relationships inSemantic Nets (cont.)

    Q: Can you describe the relationships below?

    State: I own a tan leather chair.

  • 8/3/2019 L10_KR_p2

    14/37

    241-320 Design Architecture &Engineering for Intelligent System

    Knowledge Representation andReasoning - part 2 14

    Properties of Semantic Nets

    Allows to structure the knowledge to reflect the structureof that part of the universe which is being represented.

    Strong representation facilities, and consume lessmemory 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 andmust be much refined when implementation,especiallyclear syntax, but clear semantics has to be worked out.

  • 8/3/2019 L10_KR_p2

    15/37

    241-320 Design Architecture &Engineering for Intelligent System

    Knowledge Representation andReasoning - part 2 15

    Example of Reasoning in Semantic Nets

    (pattern matching) 2

    :Whats the color of , the pegion owned by ?

    , color(,X)

  • 8/3/2019 L10_KR_p2

    16/37

    241-320 Design Architecture &Engineering for Intelligent System

    Knowledge Representation andReasoning - part 2 16

    Semantic network operation

    Assume the following network is coded in a computer.

  • 8/3/2019 L10_KR_p2

    17/37

    241-320 Design Architecture &Engineering for Intelligent System

    Knowledge Representation andReasoning - part 2 17

    CASE 1: A simple question to node

    e.g. How does a bird travel?

    The node will start to find from the information attachedto it and just return the answer, if found

  • 8/3/2019 L10_KR_p2

    18/37

    241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 2 18

    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 localarc, then it searches for an answer via its inheritance

    links (IS-A relation).

  • 8/3/2019 L10_KR_p2

    19/37

    241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 2 19

    Detour: IS-A Hierachy

    is-a corresponds mathematically to the subset relation,

    instance corresponds math. to the membership relation,

  • 8/3/2019 L10_KR_p2

    20/37

    241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 2 20

    Question:

    To find the value of a property of e1, first look at e1

    If the property is not attached to that node, "climb"the isalink to the node's parent and search there.

    Repeat, using isa/akolinks, until the property is foundor the inheritance hierarchy is exhausted.

    How many legsdoes the e1have?

    Hint: using inheritance

  • 8/3/2019 L10_KR_p2

    21/37

    241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 2 21

    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 toanalysis to visually represent parts of the problemdomain. The `knowledge' can be transformed intorules or frames for implementation

  • 8/3/2019 L10_KR_p2

    22/37

    241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 2 22

    Outiline

    Semantic Networks Introduction in Brief

    Comparison with Database System

    Properties of Semantic Nets

    Semantic network operation

    Disadvantages

    Frame-based Approach Examples

    Advantages & Disadvantages

  • 8/3/2019 L10_KR_p2

    23/37

    241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 2 23

    Introduction to Frame-based Approach

    A frameis a data structure containing typicalknowledge about a concept or object and canencompass both semantic & procedural knowledge.

    A frame represents knowledge about real world

    things (or entities) by containing both descriptions ofattributes and procedural details

  • 8/3/2019 L10_KR_p2

    24/37

    241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 2 24

    Frames

    A frame consists of a collection of slots which can befilled by values or pointers to other frames.

    A simple scenario:

    We can know the meaning of Birthday party, sincewe have already known the meaning of Party

    Childs birthday partyMeaning of should be

    approximated bya partyassembled tocelebrate a birthday

    peopleassembled tocelebrate a birthday

    partyMeaning ofLink to

    not approx. by

  • 8/3/2019 L10_KR_p2

    25/37

    241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 2 25

    Frames (cont.)

    Children all know the meaning of Childs birthdayparty and plus more default assignments:

  • 8/3/2019 L10_KR_p2

    26/37

    241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 2 26

    Why Frames?

    Frame is a data-structure for representing a stereotypedsituation, 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

    A definition:

    Frame is a remembered framework for representing

    knowledgethat can be adapted to fit reality bychanging details as necessary.

  • 8/3/2019 L10_KR_p2

    27/37

    241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 2 27

    Frames What and Why?

    The other definition:

    A Frame is a collection of questions to be asked abouta 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)?

  • 8/3/2019 L10_KR_p2

    28/37

    241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 2 28

    Ex: Representation of a View of a Cube

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

  • 8/3/2019 L10_KR_p2

    29/37

    241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 2 29

    Different Views of a Cube

  • 8/3/2019 L10_KR_p2

    30/37

    241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 2 30

    Example (cont.)

    Part of a tabular representation of the frame for one view

  • 8/3/2019 L10_KR_p2

    31/37

    241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 2 31

    Part of the Frame Descriptionof a Hotel Room

  • 8/3/2019 L10_KR_p2

    32/37

    241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 2 32

    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 meansalso restricting the expressive power in some parts, andextending in others.

    The Procedural Attachment allows functions to bewritten in a programming language to be stored instead

    of the value of some slot.

  • 8/3/2019 L10_KR_p2

    33/37

    241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 2 33

    Procedural Attachment (cont.)

    Instead of writing explicit values, the values of theslots area, circumference are calculated by need.Consider update of length from 5cm to 6cm!

  • 8/3/2019 L10_KR_p2

    34/37

    241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 2 34

    Frames: Advantages & Disadvantages

    Disadvantages complex reasoning (inferencing) is difficult

    explanation is difficultAdvantages

    knowledge domain can be naturally structured [asimilar 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 andto add further slots to the frames

  • 8/3/2019 L10_KR_p2

    35/37

    241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 2 35

    Conclusion

    Semantic Nets:

    Structured Representation.

    Inheritance are ways of achieving some

    commonsense reasoning by default Frames:

    organize knowledge around concepts considered tobe of interest (like cube & hotel room in the example code).

    Also allow procedural attachment attached to slotsfor yielding flexibility in uses

  • 8/3/2019 L10_KR_p2

    36/37

    241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 2 36

    Final Notes

    There is no single most adequate knowledgerepresentation formalism for everything.

    Main points for selecting a representation formalism:

    what should be represented, how should theknowledge be processed.

  • 8/3/2019 L10_KR_p2

    37/37

    241 320 Design Architecture & Knowledge Representation and 37

    Reading

    5 (Knowledge Representation)

    5.5.3 5.5.4