associative nets and frame systems
play

ASSOCIATIVE NETS AND FRAME SYSTEMS Network Representations If L is - PowerPoint PPT Presentation

ASSOCIATIVE NETS AND FRAME SYSTEMS Network Representations If L is a set of labeled links and N is a set of nodes, then a network is any subset of NLN, where the order of the triples is material. Lecture 4 Associative Nets & Frames


  1. ASSOCIATIVE NETS AND FRAME SYSTEMS Network Representations If L is a set of labeled links and N is a set of nodes, then a network is any subset of N×L×N, where the order of the triples is material. Lecture 4 Associative Nets & Frames 1

  2. Associationist Theories of Meaning Associationist theories define the meaning of an object in terms of a network of associations with other objects in a mind or a knowledge base. e.g. through experience we associate the concept of snow with other concepts such as cold, white, snowman, slippery and ice. Lecture 4 Associative Nets & Frames 2

  3. Network Representation of properties of snow and ice snowman made of hardness snow soft clear color texture slippery ice temperature cold hard temperature color white Lecture 4 Associative Nets & Frames 3

  4. Implementing Network Representation in CLIPS CLIPS> (deftemplate net ;network representation (slot name (type SYMBOL) ) (slot color (type SYMBOL) ) (slot temperature (type SYMBOL) ) (slot texture (type SYMBOL) ) (slot hardness (type SYMBOL) ) ) CLIPS> (deffacts things ;defining two things (net (name snow) (color white) (temperature cold) (texture slippery) (hardness soft)) (net (name ice) (color clear) (texture slippery) (temperature cold) (hardness hard))) Lecture 4 Associative Nets & Frames 4

  5. Implementing Network Representation in CLIPS (contd.) ;Associating snow with something else which is also cold CLIPS> (defrule association (net (name snow) (temperature cold)) (net (name ?Y&~snow) (temperature cold)) => (printout t "snow reminds me of " ?Y crlf)) Lecture 4 Associative Nets & Frames 5

  6. Implementing Network Representation in CLIPS (contd.) CLIPS> (watch facts) CLIPS> (watch rules) CLIPS> (reset) ==> f-0 (initial-fact) ==> f-1 (net (name snow) (color white) (temperature cold) (texture slipper) (hardness soft) ==> f-2 (net (name ice) (color clear) (temperature cold) (texture slippery) (hardness hard) CLIPS> (run) FIRE 1 association: f-1, f-2 snow reminds me of ice Lecture 4 Associative Nets & Frames 6

  7. Semantic Network by Collins & Quillian Fly Breathe can Wings can ANIMAL has has Skin is a can has is a Feathers BIRD FISH Move is a is a CANARY OSTRICH can is cannot is Sing Yellow Sing Tall Lecture 4 Associative Nets & Frames 7

  8. Human Information Storage and Response Time Response Time (sec) 1.5 A canary has skin 1.4 A canary can fly 1.3 A canary is an animal A canary can sing 1.2 A canary is a bird 1.1 1.0 A canary is a canary 0.9 “Complexity” of sentence Lecture 4 Associative Nets & Frames 8

  9. Implementing Semantic Nets in CLIPS CLIPS> (deftemplate species (slot node (type SYMBOL) ) (slot is-a (type SYMBOL) ) (multislot is (type SYMBOL) ) (multislot has (type SYMBOL) ) (multislot can (type SYMBOL) ) (multislot cannot (type SYMBOL) ) ) CLIPS> (deffacts biology (species (node canary) (is-a bird) (is yellow) (can fly) ) (species (node ostrich) (is tall) (cannot fly) (is-a bird) ) (species (node bird) (is-a animal) (can fly) (has wings feather) ) (species (node fish) (is-a animal) ) (species (node animal) (can breathe move) (has bones skin) ) ) Lecture 4 Associative Nets & Frames 9

  10. Implementing Semantic Nets in CLIPS (contd.) CLIPS> (defrule link1 (declare (salience 10)) (species (node ?X)(is-a ?Y&~nil)) => (printout t "A " ?X " is a " ?Y crlf)) CLIPS> (defrule link2 (declare (salience 5)) (species (node ?X) (is-a ?Y)) (species (node ?Y) (is-a ?Z&~nil)) => (printout t "A " ?X " is a " ?Z crlf)) Lecture 4 Associative Nets & Frames 10

  11. Implementing Semantic Nets in CLIPS (contd.) CLIPS> (defrule link3 (species (node ?X) (is-a ?Y)) (species (node ?Y) (is-a ?Z)) (species (node ?Z) (has $?W)) => (printout t "A " ?X " has " (implode$ ?W) crlf)) Lecture 4 Associative Nets & Frames 11

  12. Implementing Semantic Nets in CLIPS (contd.) CLIPS> (reset) CLIPS> (run) A fish is a animal A bird is a animal A ostrich is a bird A canary is a bird A canary is a animal A ostrich is a animal A ostrich has bones skin A canary has bones skin Lecture 4 Associative Nets & Frames 12

  13. Semantic Nets for Natural Language The word “give” has the following associated roles: a donor, a recipient and an object given. recipient donor person give person object thing Lecture 4 Associative Nets & Frames 13

  14. An Instance of a Semantic Net Knowledge derived from “John gave Mary a book”. recipient donor mary give-1 john object book Lecture 4 Associative Nets & Frames 14

  15. Natural Language Grammar Rules S � NP VP ; S=Sentence, NP=Noun Phrase, VP=Verb Phrase NP � Proper_Noun | Article Noun | Noun VP � VP PP ; PP=Prepositional Phrase VP � Verb NP PP � Prep NP Proper_Noun � Sarah Noun � chair | glue Article � the Prep � with Lecture 4 Associative Nets & Frames 15

  16. Natural Language Parsing Syntactic Analysis: S NP VP Proper_Noun VP PP Verb NP Prep NP Article Noun Sarah fixed the chair with glue Lecture 4 Associative Nets & Frames 16

  17. Case Frame for English Verbs Semantic Analysis: Knowledge representation for “Sarah fixed the chair with glue” time past agent object sarah fix chair instrument glue Lecture 4 Associative Nets & Frames 17

  18. CLIPS Template for Case Frame CLIPS> (deftemplate case (slot verb (type SYMBOL) ) (slot agent (type SYMBOL)) (slot object (type SYMBOL) ) (slot time (type SYMBOL) ) (slot instrument (type SYMBOL) ) ) Lecture 4 Associative Nets & Frames 18

  19. Structured Representations • Organizing knowledge into a structure called frame. • A frame may be viewed as a data structure used to represent well-understood stereotyped situations • Example: birds as prototypical objects with a general property that most birds can fly though there are exceptions. Lecture 4 Associative Nets & Frames 19

  20. Frame Systems A frame system attempts to integrate – Declarative notions about objects and events and their properties, and – Procedural notions about how to retrieve information and achieve goals. Lecture 4 Associative Nets & Frames 20

  21. A Frame Fillers Name: Name-1 Slots Attribute-1: value-1 Attribute-2: procedure-1 Attribute-3: procedure-2 . . . . . Attribute-n: value-m (procedures are sometimes known as demons) Lecture 4 Associative Nets & Frames 21

  22. Hierarchy of Frames • Frames are typically arranged in a hierarchy in which “lower” frames can inherit values from “higher” frames in the hierarchy. • Properties and procedures for “higher” frames are more or less fixed whereas “lower” frames may be filled with more contingent information. Lecture 4 Associative Nets & Frames 22

  23. Links in a Frame System • Instances − Classes • Classes - Superclasses Machine Superclass Computer Class SunA SunFire Instances Lecture 4 Associative Nets & Frames 23

  24. Inheritance System of Birds bird superclass: vertebrate reproduction: lay_eggs covering: feathers can fly: T fightless bird songbird scavenger superclass: bird superclass: bird superclass: bird can fly: nil diet: (bugs seeds) diet: (garbage carrion) penguin canary sparrow superclass: flightless_bird superclass: songbird superclass: songbird habitat: south pole habitat: tropical habitat: north america diet: fish opus tweety instance of: penguin instance of: canary Lecture 4 Associative Nets & Frames 24

  25. Hierarchical Representation for Geometric Figures of Land Polygon Each node in the hierarchy consists of a structure with the following format: Quadrilateral NAME: Trapezium Number of Sides: Length of Sides: Parallelogram Size of Angles: Area: Rectangle Price of Land: Square Lecture 4 Associative Nets & Frames 25

  26. Defaults and Demons Some of the slots in “Polygon” may have the following fillers: Number of Sides: 4 (default) Area: compute_area ( IF-NEEDED demon) Price=compute_price(Area) ( IF-ADDED demon) Price: receives value from above when Area is added or updated. Lecture 4 Associative Nets & Frames 26

  27. Implementing Frames in CLIPS CLIPS> (defclass polygon (is-a USER) ) CLIPS> (defclass quadrilateral (is-a polygon) ) CLIPS> (defclass trapezium (is-a quadrilateral) ) CLIPS> (defclass parallelogram (is-a trapezium) ) CLIPS> (defclass rectangle (is-a trapezium) ) CLIPS> (defclass square (is-a rectangle) ) Lecture 4 Associative Nets & Frames 27

  28. Abstract and Concrete Classes CLIPS> (defclass polygon (is-a USER) (role abstract) (slot no_of_sides (default 4) ) ) CLIPS> (defclass quadrilateral (is-a polygon) (role concrete) ) Concrete classes can generate instances while abstract classes will not. Lecture 4 Associative Nets & Frames 28

  29. Defining a demon CLIPS> (defmessage-handler polygon sides ( ) ?self: no-of-sides) CLIPS> (definstances geometry (square-one of square) ) CLIPS> (send [square-one] sides) 4 Lecture 4 Associative Nets & Frames 29

Recommend


More recommend