280 likes | 460 Views
Semantic Networks. CIS 479/579 Bruce R. Maxim UM-Dearborn. Decomposition. Most complex sets of objects can be decomposed into smaller subsets These decompositions often contain two types of relations “isa” and “ispart” dog isa pet isa animal isa living thing
E N D
Semantic Networks CIS 479/579 Bruce R. Maxim UM-Dearborn
Decomposition • Most complex sets of objects can be decomposed into smaller subsets • These decompositions often contain two types of relations “isa” and “ispart” dog isa pet isa animal isa living thing finger ispart hand ispart body
Inverse Relations • Sometimes it is also useful to define inverse relationships “ako” (a kind of) as inverse of “isa” “haspart” as inverse of “ispart” dog ako pet ako animal ako living thing finger haspart hand haspart body
Inheritance • These relations form a partial ordering of the network • This allows us to use transitivity relations to aid in search • Storage of information is more efficient since inheritance can be used to “copy” information from a class to its subclasses
Abstraction • Choosing a level of abstraction can be tricky since you need to use between a small number of low-level primitives or a large number of broader labels • Advantage of low-level primitives • allows inferences rules to be written very succinctly • not concerned with the many ways that knowledge may have appeared orginally
Abstraction • Disadvantages of low-level primitives • takes a lot of work to convert each high level fact to its primitive form • simple high-level facts require lots of storage when broken down into primitives • not always clear which low-level primitives are important (e.g. how do you reperesnt cousin using primitives like mom, dad, son, daughter)
Finding the Right Knowledge Structures • How do you perform an initial selection of the most appropriate structure? • How do you fill in appropriate details from current situation? • How do you find a better structure if the first one chosen turns out to be bad? • What do you do if none of the available structures is appropriate? • When do you create and remember a new structure?
Semantic Networks • A declarative representation in which complex entities are described as collections of attributes and associated values • Sometimes called a “slot and filler” type structure • To assist in there implementation AI languages provide for some type of associative memory in which object can be stored as OAV triples
OAV Triples in Lisp • An object could be represented using a symbol and its attributes and values could be stored as properties (putprop ‘dog ‘animal ‘isa) • Most likely the “isa” property would contain a list of classes that “dog” belongs to
Associative Memory • Takes lots of storage • It is fast and very flexible • These links are one way only • Inverse links need to be defined individually (putprop ‘animal ‘dog ‘ako)
Associative Memory • To maintain a list of facts efficiently would require definition of operations like Add-to-set Add-to-superset Add-to-subset
Searching Hierarchy ; is “x” realted to “y” with “n” or fewer links (defun isatest (x y n) (cond ((eq x y) T) ((zerop n) nil) ((member y (get x ‘isa)) T) (T (any mapcar #’lambda (xx) (isatest xx y) (1– n)) (get x ‘isa)))) (defun any (lst) (cond ((null lst) nil) ((car lst) T) (T (any (cdr lst))))
Semantic Nets • How do semantic networks differ from ordinary directed graphs? • In semantic networks there must be some underlying meaning associated with the representation (especially the edge or link labels)
Semantic Network has has feathers wings bird isa isa eagle falcon
Value Inheritance Form a queue consisting of node F and all class nodes found in F’s “isa” slot Until queue is empty or value found if queue front has value in slot S then value found else remove first queue element and add nodes related by “isa” slot If value found then report value found in slot S else announce failure.
Inheritance • Some people prefer to create a special link (e.g. “instance”) to distinguish between instances and classes • How do you deal with exceptions (e.g. Jumbo has 1 tusk)? • One strategy is to record the exception on the instance node and only record instances that apply to class members on the class nodes
Comparisons • Sometimes difficult to represent unambiguously (e.g. is Dumbo inferior to Jumbo or does he weigh less) Dumbo Jumbo weight weight less than 1.5 tons 2 tons
If-needed Inheritance • Rather than checking for a value in a slot, there may be times when a procedure would be called if needed • For example, you would rarely store all three values (mass, volume, and density) on a node since one value could be computed from the other two
If-needed Inheritance Form a queue consisting of node F and all class nodes found in F’s “isa” slot Until queue is empty or if-needed procedure found if procedure exist and value produced then value found else remove first queue element and add nodes related by “isa” slot If procedure found then report value found for F’s slot S else announce failure.
Default Inheritance • Sometimes it is reasonable to reduce the search time by include default facets for slots • This may need to happen when knowledge needed to compute a value is missing or uncertain
Default Inheritance Form a queue consisting of node F and all class nodes found in F’s “isa” slot Until queue is empty or value found if queue front has default value for S then value found else remove first queue element and add nodes related by “isa” slot If value found then report default value found for slot S else announce failure.
N Inheritance • Use value inheritance procedure to search entire network • Use if-needed inheritance procedure to search entire network • Use default inheritance procedure to search entire network
Z Inheritance • General inheritance algorithm is used • At each of the three facets are examined in the order: value, if-needed, and default
Semantic Net Considerations • Which slot facets (value, if-neede, default) are to be used? • Which inheritance strategies (if any) are to be used? • Is the use of perspectives needed? (i.e. block from toy perspective versus block from construction perspective)
Problems with Semantic Nets • When do you have enough semantic primitives? • How do you know the selected primitives are correct? • What is the smallest number of link types needed to span all human knowledge? • How do you represent quantified knowledge?