semantic networks
DESCRIPTION
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 - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Semantic Networks](https://reader030.vdocument.in/reader030/viewer/2022032708/56812daf550346895d92d8fc/html5/thumbnails/1.jpg)
04/19/23 1
Semantic Networks
CIS 479/579
Bruce R. Maxim
UM-Dearborn
![Page 2: Semantic Networks](https://reader030.vdocument.in/reader030/viewer/2022032708/56812daf550346895d92d8fc/html5/thumbnails/2.jpg)
04/19/23 2
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
![Page 3: Semantic Networks](https://reader030.vdocument.in/reader030/viewer/2022032708/56812daf550346895d92d8fc/html5/thumbnails/3.jpg)
04/19/23 3
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
![Page 4: Semantic Networks](https://reader030.vdocument.in/reader030/viewer/2022032708/56812daf550346895d92d8fc/html5/thumbnails/4.jpg)
04/19/23 4
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
![Page 5: Semantic Networks](https://reader030.vdocument.in/reader030/viewer/2022032708/56812daf550346895d92d8fc/html5/thumbnails/5.jpg)
04/19/23 5
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
![Page 6: Semantic Networks](https://reader030.vdocument.in/reader030/viewer/2022032708/56812daf550346895d92d8fc/html5/thumbnails/6.jpg)
04/19/23 6
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)
![Page 7: Semantic Networks](https://reader030.vdocument.in/reader030/viewer/2022032708/56812daf550346895d92d8fc/html5/thumbnails/7.jpg)
04/19/23 7
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?
![Page 8: Semantic Networks](https://reader030.vdocument.in/reader030/viewer/2022032708/56812daf550346895d92d8fc/html5/thumbnails/8.jpg)
04/19/23 8
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
![Page 9: Semantic Networks](https://reader030.vdocument.in/reader030/viewer/2022032708/56812daf550346895d92d8fc/html5/thumbnails/9.jpg)
04/19/23 9
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
![Page 10: Semantic Networks](https://reader030.vdocument.in/reader030/viewer/2022032708/56812daf550346895d92d8fc/html5/thumbnails/10.jpg)
04/19/23 10
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)
![Page 11: Semantic Networks](https://reader030.vdocument.in/reader030/viewer/2022032708/56812daf550346895d92d8fc/html5/thumbnails/11.jpg)
04/19/23 11
Associative Memory
• To maintain a list of facts efficiently would require definition of operations like
Add-to-set
Add-to-superset
Add-to-subset
![Page 12: Semantic Networks](https://reader030.vdocument.in/reader030/viewer/2022032708/56812daf550346895d92d8fc/html5/thumbnails/12.jpg)
04/19/23 12
Animal Hierarchy
![Page 13: Semantic Networks](https://reader030.vdocument.in/reader030/viewer/2022032708/56812daf550346895d92d8fc/html5/thumbnails/13.jpg)
04/19/23 13
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))))
![Page 14: Semantic Networks](https://reader030.vdocument.in/reader030/viewer/2022032708/56812daf550346895d92d8fc/html5/thumbnails/14.jpg)
04/19/23 14
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)
![Page 15: Semantic Networks](https://reader030.vdocument.in/reader030/viewer/2022032708/56812daf550346895d92d8fc/html5/thumbnails/15.jpg)
04/19/23 15
Semantic Network
birdfeathers wings
eaglefalcon
has
isaisa
has
![Page 16: Semantic Networks](https://reader030.vdocument.in/reader030/viewer/2022032708/56812daf550346895d92d8fc/html5/thumbnails/16.jpg)
04/19/23 16
Semantic Nets in C++
1. bird 2. falcon 3. eagle 4. wings 5.feathers
1.bird has has
2.falcon isa
3.eagle isa
4.wings
5.feathers
![Page 17: Semantic Networks](https://reader030.vdocument.in/reader030/viewer/2022032708/56812daf550346895d92d8fc/html5/thumbnails/17.jpg)
04/19/23 17
Inheritance
![Page 18: Semantic Networks](https://reader030.vdocument.in/reader030/viewer/2022032708/56812daf550346895d92d8fc/html5/thumbnails/18.jpg)
04/19/23 18
Value InheritanceForm 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.
![Page 19: Semantic Networks](https://reader030.vdocument.in/reader030/viewer/2022032708/56812daf550346895d92d8fc/html5/thumbnails/19.jpg)
04/19/23 19
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
![Page 20: Semantic Networks](https://reader030.vdocument.in/reader030/viewer/2022032708/56812daf550346895d92d8fc/html5/thumbnails/20.jpg)
04/19/23 20
Comparisons
• Sometimes difficult to represent unambiguously (e.g. is Dumbo inferior to Jumbo or does he weigh less)
Dumbo
1.5 tons 2 tons
Jumbo
less thanweight weight
![Page 21: Semantic Networks](https://reader030.vdocument.in/reader030/viewer/2022032708/56812daf550346895d92d8fc/html5/thumbnails/21.jpg)
04/19/23 21
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
![Page 22: Semantic Networks](https://reader030.vdocument.in/reader030/viewer/2022032708/56812daf550346895d92d8fc/html5/thumbnails/22.jpg)
04/19/23 22
If-needed InheritanceForm 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.
![Page 23: Semantic Networks](https://reader030.vdocument.in/reader030/viewer/2022032708/56812daf550346895d92d8fc/html5/thumbnails/23.jpg)
04/19/23 23
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
![Page 24: Semantic Networks](https://reader030.vdocument.in/reader030/viewer/2022032708/56812daf550346895d92d8fc/html5/thumbnails/24.jpg)
04/19/23 24
Default InheritanceForm 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.
![Page 25: Semantic Networks](https://reader030.vdocument.in/reader030/viewer/2022032708/56812daf550346895d92d8fc/html5/thumbnails/25.jpg)
04/19/23 25
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
![Page 26: Semantic Networks](https://reader030.vdocument.in/reader030/viewer/2022032708/56812daf550346895d92d8fc/html5/thumbnails/26.jpg)
04/19/23 26
Z Inheritance
• General inheritance algorithm is used
• At each of the three facets are examined in the order: value, if-needed, and default
![Page 27: Semantic Networks](https://reader030.vdocument.in/reader030/viewer/2022032708/56812daf550346895d92d8fc/html5/thumbnails/27.jpg)
04/19/23 27
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)
![Page 28: Semantic Networks](https://reader030.vdocument.in/reader030/viewer/2022032708/56812daf550346895d92d8fc/html5/thumbnails/28.jpg)
04/19/23 28
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?