Docstoc

Notes-2-CDS-KR-Frames

Document Sample
Notes-2-CDS-KR-Frames Powered By Docstoc
					  Knowledge Representation

Representing Common Sense Knowledge


    MSc Decision Support Notes 2



                                      1
  How to represent advice? Memory? Plans?
              Common Sense?
• What’s this                       Or this




 • How many legs does the man have? The tortoise?
    –   How do you know? Is it in the picture?




                                                    2
               How to answer a question?
• Help - my laser printer doesn’t work?
   –   Is it plugged in? Is the power on at the wall?
   –   Is it connected to the computer?
   –   Does it have paper?
   –   Does it print a test sheet?
   –   Have you turned everything off, turned on the printers, then
       rebooted the computer?




                                                                      3
             How to understand a story
• John went into the restaurant. He sat down. When the
  waiter came he ordered a pizza. He waited for forty
  minutes.
  Finally, he got up and left. The waiter rushed after him
  very angry. John was also very angry.

   – Why was John angry?
     Why was the waiter angry?

   – How do you know?




                                                             4
Two parts to most knowledge representations
• Knowledge of the things in the world and how the relate
    – The “Ontology” or “Static knowledge”
        • Semantic Nets, Frames, Description Logics, Conceptual Graphs,…
             – BEWARE “The ‘O’ word”
               “Ontology” means different things to different people
    – Declarative
        • Logic like


• Knowledge of what to do and how
    – The “Operational knowledge”
        • Rules, Problem Solving Methods, Methods, Operations…
    – Procedural
        • Program like or Condition-Action rules
    – Usually “Heuristic”

                                                                           5
        NB: Real “Expertise” is different
• Tacit, automatic, semi-conscious
• Experts may reconstruct an explanation but can rarely
  explain what they do
   – See Johnson papers on “Links”




                                                          6
       Classic Knowledge Based Systems
• Knowledge base
   – Typically in “Frames”


• The problem solving methods or “Heuristics”
   – Typically in “Rules”




                                                7
               by the way… vocabulary…
              “Algorithms” & “Heuristics”
• Algorithms – methods guaranteed to do something
    – Guaranteed to get an answer
    – Example: Long division, manual extraction of a square root, ‘exhaustive
      chess algorithm’
    – Never need more than one for any one problem
    – May take a very long (age of universen) time
        • We will return to topic when we discuss ontologies, OWL, and description
          logics
• Heuristics – rules of thumb for doing things
    – Often work, but may not
    – A good heuristic either gets the right answer or fails
    – Usually apply several to each problem to give a high probability that one
      will work
    – Usually chosen to be relatively quick

                                                                                     8
                   The knowledge base
• How to represent the things in the world and their
  relationships
   – Or more accurately:
      our conceptualisation of the things in the world & their
     relationships

   – The starting metaphor was to explain our memory

   – How might we represent the knowledge we need to understand the
     restaurant story?




                                                                  9
          Memory and Association
                             Money



          Customer
                                     Restaurant




                                      Waiter
 Hunger


                         Food
Boredom


                     Anger
                                                  10
             Semantic Net - Label the arcs
                                             Money

                               has                         Pays to


                    Customer
                                                                Restaurant
                               Serves food
          has                                                        Works
                                             Takes order              for

                                                                 Waiter
             has
                         has
 Hunger

                causes
                                      Food
                                                   has
Boredom
          causes

                               Anger
                                                                             11
                    Thing
                                      Add the classes
                                                                                          Organisa-
                                                                                            tion
     Person
                                                     Money
                                                                    Pays to
                                       has


                           Customer
Emotion                                                                  Restaurant
                                       Serves food
                                                                              Works for
              has
                                                      Takes order


                                                                              Waiter
                    has
                                has
     Hunger

                       causes
                                               Food
                                                            has
    Boredom
              causes


                                       Anger
                                                                                                      12
A Real Example: Use cases from UK Drug Messages




                                                  13
From Evans & Patel,
              14
Cog Sci in Biomedicine pg 72
             It’s getting messy!
       What do all those lines mean?
  Can we find a better way to write it down?
• Frames are one systematic way to write down semantic nets
    – Formalised by the language KL-ONE
        • Re-formalised as “Description Logics”
             – Being restandardised as OIL: (Ontology Inference Layer) - new proposed
               interchange language DAML+OIL or “OWL”
               www.w3.org/2001/sw/WebOnt/
               http://oiled.man.ac.uk/
               www.ontoknowledge.org/oil (click here)

• Other more formal ways are:
    – Conceptual graphs (click here)
       • A complete alternative notation for logic
             – John Sowa
               http://www.bestweb.net/~sowa/direct/jfsbio.htm




                                                                                        15
                               Frames
• May be regarded as
   –   A knowledge representation formalism
   –   A way of writing down semantic networks
   –   A set of data structures
   –   A housekeeping trick


• No real standards
   – Grew up informally
   – Much confusion of vocabulary and notation
        • Hence the development of detailed standards with different names




                                                                             16
                              Basic ideas
• Types/ classes
   – The categories of things that are:
       • Analogous to sets
         Best expressed as plurals but usually written as singular
            – Mammal, Dog, Bottle

• Instances / objects
   – The things themselves
       • Analogous to members of sets
         best expressed as singular, or with ‘the’ or ‘this’ or ‘these’, etc.
            – Fido, This bottle of milk




                                                                                17
                           Basic ideas

• A hierarchy of classes
   – LivingThings
      Animals
       Mammals
         Dogs
          Golden Retrievers
           Sansue Golden Retrievers
              Sansue Golden Retrievers from the Phoenix line
                ...
• Instances
       • Mia is-instance-of Sansu Golden Retrievers
       • Mammals is-kind-of of Animals




                                                               18
                            Basic ideas
• Types/ classes
       • Subclasses linked to classes by “is-kind-of” / “specialises” / “is
         subsumed by” “ako” (“is kind of”)

       • Classes linked to subclasses by “has-kind” / “subsumes” /
         “is generalisation of”
       • Dog is-kind-of Mammal is-kind-of Vertebrate is-kind-of Animal
       • Animal subsumes Vertebrate subsumes Mammal subsumes Dog


• Individuals/ Instances / objects
       • Instances linked to types by “is-instance-of”
            – BEWARE “is-a” may mean “is-instance-of” or “is-kind-of” depending
              on the system!
       • Fido is-instance-of Dog; John is-instance-of Man;
       • This bottle is-instance-of Bottle


                                                                              19
                  Graphic Notation
              Arrows (should) always point up
Animal
                                  •Conventions
                                       •Arrows always point up
         Mammal                        •Open arrows for is-kind-of
                                       •Closed arrows for is-instance-of
                                  •In this course
                  Dog
                                       •Round boxes for Types/Classes
                                       •Ovals for instances/objects

                           Fido



                                                                      20
                    Adding Slots
• LivingThings
   mode-of-reproduction: ?
     Animals
        source-of-food: ?
        covering: ?
        means-of-feeding-young: ?
          Mammals:
            means-of-feeding-young: milk
            covering: fur
            normal-body-termperature: ?


                                           21
                          Inheritance

• What is true of the superclass
   – is (generally) true of the subclass
       • In many frame systems, the ‘default’ values can be over-ridden
            – In description logics and OIL, faults do not exist as such




• Vocabulary
   – “Defeasible”
       • can be over-ridden
            – defaults
   – “Indefeasible”
       • not defeasible
            – cannot be over-ridden

                                                                           22
      Inheritance: All Slots are inherited
• LivingThing
   mode-of-reproduction: ?
     Animal
        (mode of reproduction: ?)
        source-of-food: ?
        covering: ?
        means-of-feeding-young: ?
          Mammal:
              (mode of reproduction: ?)
              (source-of-food: ?)
              (means-of-feeding-young: ?)
              (covering: ?)
               normal-body-termperature: ?
                     Dog
                            ...              23
    Inheritance: Default values are inherited
•
          Mammal:
             (mode of reproduction: live-birth)
             (source-of-food: ?)
             (means-of-feeding-young: milk)
             (covering: fur)
             normal-body-termperature: ?
                   Dog
                               (mode of reproduction: live-birth)
                               (source-of-food: ?)
                               (means-of-feeding-young: milk)
                               (covering: fur)
                               (normal-body-termperature: ?)


                                                                    24
Inheritance: Default values can be overridden
•
        Mammal:
           (mode of reproduction: live-birth)
           (source-of-food: ?)
           (means-of-feeding-young: milk)
           (covering: fur)
           normal-body-termperature:?
                 Platypus
                             (mode of reproduction: lays-eggs)
                             (source-of-food: ?)
                             (means-of-feeding-young: milk)
                             (covering: fur)
                             (normal-body-termperature: ?)


                                                                 25
       Single and Multiple Inheritance


                      Person


      Quaker                           Republican



                      Nixon


Nixon is an instance of both Quaker and Republican
                                                     26
    Multiple Inheritance with Defaults
         The ‘Nixon Diamond’

                     Person


      Quaker                            Republican
                                             :pacifist false
:pacifist true

                      Nixon

                 Is Nixon a pacifist?

                                                         27
         Multiple inheritance and defaults
• Each seem a minor change
• Each alone works
• Together they spell disaster
   – Computational consequences are often unintuitive
       • In classification they are rarely intuitive




                                                        28
                 Advantages of Frames
• An orderly easy-to-understand structure
• Inheritance helps to keep knowledge modular
• Efficient inference
   – If a single hierarchy




                                                29
                 Problems with frames
• Negation cannot be represented
   – “Jim does not have pneumonia”
• Disjunction cannot be represented
• Semantics ambiguous
   – Woods: What’s in a link
   – Brachman: What IS-A is and IS-A isn’t




                                             30
  Frames and Object Oriented Programming
• Frame systems were one of the ancestors of OO
  programming
   – As used, slots are very similar to instance variables
   – Default values can be implemented as class variables
   – Many frame systems allow methods in slots
       • Analogous to methods in OO programming




                                                             31
                        Exercises
• Start up PROTÉGÉ
• Work through the tutorial
• Load the Newspapers example
• Create a new kind of “Article” - “Editorial” - and give it a
  new slot “Stance”
• Create a new kind of “Article” - “Guest editorial” - and
  give it a new slots “Own organisation” and “political
  orientation”
• Find the Biological Process (malaria) model on the web
  from http://protege.stanford.edu and explore it

                                                             32

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:0
posted:5/18/2012
language:
pages:32
fanzhongqing fanzhongqing http://
About