44
Semantic Networks

L20 Semantic Net

Embed Size (px)

Citation preview

Page 1: L20 Semantic Net

Semantic Networks

Page 2: L20 Semantic Net

2

Semantic Networks

• Semantic networks are knowledge representation schemes involving nodes and links (arcs or arrows) between nodes.

• The nodes represent objects or concepts and the links represent relations between nodes.

• The links are directed and labeled; thus, a semantic network is a directed graph.

Page 3: L20 Semantic Net

3

Semantic Networks

• In practice, the nodes are usually represented by circles or boxes and the links are drawn as arrows between the circles as shown.

• a collection of undifferentiated objects and arrows

Page 4: L20 Semantic Net

4

Semantic Networks

• The structure of the network defines its meaning.

• The meanings are merely which node has a pointer to which other node.

• The network defines a set of binary relations on a set of nodes.

Page 5: L20 Semantic Net

5

Semantic Networks• To move semantic nets from this abstract realm to something more concrete, let us consider an example from the

structure of marketing.

• To begin simply, let us introduce two nodes and a link.

• Quad Cities is an example of a market. • The diagram, represents the fact that there is a binary relation between a market, Quad Cities, and the concept of a

market

Page 6: L20 Semantic Net

6

Semantic Networks

• Another node with the label "Los Angeles" and a "is-a" link from this node to the "Market" node could be added, again representing that "Los Angeles" is a type of "Market".

Page 7: L20 Semantic Net

7

Semantic Networks• Markets generally contain retailing entities.

• To add an example of a retailer, add a node labeled "Chain56" and two links - one from the retailer "Chain56" to "Quad Cities" labeled "is-a-retailer-in" and one from the node "Chain56" to the node "Retailer" labeled "is-a".

• This illustrates that Chain 56 is a retailer in the Quad Cities market.

Page 8: L20 Semantic Net

8

Semantic Networks

• It is now important to note some of possible semantic confusion.

• Notice that the nodes in this small network are not all of the same "type".

• The node labeled "Market" represents the generic or class or abstract concept of a market.

• It can be thought of as possessing properties common to all markets.

• The node "Quad Cities" represents a particular instance of a market.

Page 9: L20 Semantic Net

9

Semantic Networks

• The same is true of the relation between the node labeled "Retailer" and the node labeled "Chain56“.

• In order to distinguish between these two types of nodes, the class nodes become boxes and the instance nodes become ellipses.

Page 10: L20 Semantic Net

10

• Another class node, labeled "Item", that represents the abstraction of items in a category, can now be added. Along with that, an instance of an item, labeled "87481", is added.

• There is a strong relationship between the class nodes and the column entities in relational database.

• The information now being represented is that Chain56 is a retailer in the Quad Cities market and that Chain56 carries the item 87481.

Page 11: L20 Semantic Net

11

Semantic Networks

• The "is-a" links in the above Figure are "structural" links in that they convey "type" information about the node.

• For instance, the node labeled "87481" is an instantiation of the class node labeled "Item".

Page 12: L20 Semantic Net

"Brand" class node with an instance

node "Ivory".

The link "is-brand" conveys the

information that the item 87481 is the

Ivory brand.

Page 13: L20 Semantic Net

13

Semantic Networks

• Our network in above figure now has a representation for

information about the item node “87481”.

• For instance, it is a form of Ivory which is manufactured by

Procter & Gamble; it is the 22 ounce size, white in color

and competes in the Mildness market segment of the liquid

light-duty detergent category.

• This is one item in one chain in one market.

Page 14: L20 Semantic Net

14

– The physical attributes of a person can be represented as

– These values can also be represented in logic as: isa(person,

mammal), instance(Mike-Hall, person) team(Mike-Hall, Cardiff)

Semantic Networks

Page 15: L20 Semantic Net

15

Semantic Networks• How we can have more than 2 place predicates in semantic nets? E.g. score(Cardiff, Llanelli, 23-6).• So, for that • Create new nodes to represent new objects contained in the knowledge, game and fixture in the current example. • Relate information to nodes and fill up slots

A Semantic Network for n-Place Predicate

Page 16: L20 Semantic Net

16

• As a more complex example consider the sentence: John gave Mary the book. • Here we have several aspects of an event.

A Semantic Network for a Sentence

Semantic Networks

Page 17: L20 Semantic Net

17

FRAMES

• Frames can also be regarded as an extension to Semantic nets.

• Semantic nets initially used to represent labelled connections between objects.

• As tasks became more complex the representation needs to be more structured.

• The more structured the system it becomes more beneficial to use frames.

Page 18: L20 Semantic Net

18

FRAMES

• A frame is a collection of attributes or slots and associated values that describe some real world entity.

• Frame systems are a powerful way of encoding information to support reasoning.

• Set theory provides a good basis for understanding frame systems.

Page 19: L20 Semantic Net

19

FRAMES

• Each frame represents: – a class (set), or – an instance (an element of a class).

• A data structure to represent a mental model of a stereotypical situation such as – driving a car, – attending a meeting or – eating in a restaurant. etc.

Page 20: L20 Semantic Net

20

FRAMES

• Knowledge about an object or event is stored together in memory as a unit.

• When a new situation is encountered, an appropriate frame is selected from memory for use in reasoning about the situation.

• Frames are general record-like structures which consist of a collection of slots and slot values, that may be any size and type.

Page 21: L20 Semantic Net

21

FRAMES

• Slots typically have names and values or subfields called facets.

• Facets may also have names and any number of values.

Page 22: L20 Semantic Net

22

FRAMES• A general frame structure

(<frame name>

(<slot1 (<facet1><value1>….<valuek1>)

(<facet2><value1>….<valuek2>)

(<slot2 (<facet1><value1>….<valuek1>)

.. )

Page 23: L20 Semantic Net

23

FRAMES• A simple instantiated person frame

(bob

(PROFESSION (VALUE professor))

(AGE (VALUE 42))

(WIFE (VALUE sandy))

(CHILDERN (VALUE sue joe))

(ADDRESS (STREET (VALUE 100 elm))

(CITY (VALUE dallas))

(STATE (VALUE tx))

(ZIP (VALUE 75000)))

Page 24: L20 Semantic Net

24

FRAMES

• From the general frame structure, it will be seen that a frame may have any number of slots.

• A slot may have any number of facets, each with any number of values.

• This will give a general framework to build Knowledge structure.

Page 25: L20 Semantic Net

25

FRAMES

• The slots in a frame specify general or specific characteristics of the entity for which the frame represents, sometimes it may also a instructions.

• Typically, slot contains information such as – attributes value pairs, – default values, – conditions for filling a lot, – pointers to the related frames, and – procedures that are activated when needed.

Page 26: L20 Semantic Net

26

FRAMESA ford frame with various slot types.

(ford (AKO(VALUE car))

(COLOR (VALUE silver))

(MODEL (VALUE 4-door))

(GAS-MILEAGE (DEFAULT fget))

(RANGE (VALUE if-needed))

(WEIGHT (VALUE 26000))

….

Page 27: L20 Semantic Net

27

FRAMES

• Slots with attached procedures such as fget and if-needed are called procedural attachments or demons.

• They are get done automatically when a value is needed.

Page 28: L20 Semantic Net

28

FRAME – BASED REPRESENTATION LANGUAGES

• Frame representations have become popular enough that special high level frame based representation languages have been developed.

• LISP is the most widely used host language, they typically have functions to – create,

– access,

– modify,

– update and

– display frames.

Page 29: L20 Semantic Net

29

FRAME – BASED REPRESENTATION LANGUAGES

For example: to define frame..

(fdefine f-name <parents><slots>)

where

fdefine – is frame definition function

f-name - is the name assigned to the new frame

<parents> - is the list of all parent frames to which the new frame is linked and

<slots> - is a list of slot names and initial values.

Page 30: L20 Semantic Net

30

FRAME – BASED REPRESENTATION LANGUAGES

• For example, using the function fdefine to create a train frame we might provide the following details:

(fdefine general-train land-transport

(type (VALUE passenger))

(class (VALUE first-class second-class sleeper))

(food ( restaurant (VALUE hot meals))

….

Page 31: L20 Semantic Net

31

FRAME – BASED REPRESENTATION LANGUAGES

• Several frame languages have now been developed to aid in building frame based systems.

• They include the Frame Representation Language(FRL), Knowledge Representation Language(KRL), which served as a base language for a scheduling system called NUDGE etc.

Page 32: L20 Semantic Net

Frames = Semantic Networks + Meta-structured nodes + Procedural Attachment

FRAME SLOT FACET FILLER

[PC [isa [value COMPUTER]][manufacturer [type-r COMPANY]][retail-price [puller (* &markup &wholesale)]

[range-min 500][range-max 10000][unit USD]]

[markup [value 1.5]][owner [type-r LEGAL-ANIMATE]]]

[DELL-150/L[isa [value PC]][manufacturer [value DELL]][processor [value pentium-4L]][wholesale [value 1400]]]

Page 33: L20 Semantic Net

33

SCRIPTS

• Scripts are another structured representation scheme introduced by Roger(1977)

• They are used to represent sequences of commonly occurring events.

• They were used to capture the meaning of stories or to understand natural language text.

• Like a script for a play.

Page 34: L20 Semantic Net

34

SCRIPTS

• A script is a predefined frame-like structure which contains – expectations, – inferences, and – other knowledge that is relevant to a stereotypical

situation.

Page 35: L20 Semantic Net

35

SCRIPTS

• Scripts are frame-like structures used to represent commonly occurring experiences such as – going to the movies, – shopping in a supermarket, – eating in a restaurant, or – visiting a dentist.

• Like a script for a play, the script structure is described in terms of actors, roles, props, and scenes.

Page 36: L20 Semantic Net

36

SCRIPTS

SCRIPT-NAME Food marketTRACK SupermarketROLES

ENTRY CONDITIONS

PROPS

Shopper

Deli attendant

Seafoor attendant

Checkout clerk

Sacking clerk

Other shoppers

Shopper needs groceries

Food market open

Shopping cart

Display aisles

Market items

Checkout stands

Cashier

Money

An example of a supermarket script is shown below:

Page 37: L20 Semantic Net

37

Reasoning with scripts

• Scripts contain knowledge that people use for common every day activities.

• They can be used to provide an expected scenario for a given situation.

• Reasoning in a script begins with the creation of a partially filled script named to meet the current situation.

• Next, a know script which matches the current situation is recalled from memory.

Page 38: L20 Semantic Net

38

• The index values such as script name, preconditions, or other key words will help to search for the appropriate script.

• Scripts have now been used in a number of language understanding systems.

Reasoning with scripts

Page 39: L20 Semantic Net

• Design a Semantic Net of a Baseball Player having following properties– Fielder is a person, belongs Brooklyn Dodgers team

of Pee-wee-Reese unit, Adult male with batting average is 0.262, Right handed with height 178, default height 195 and default batting average is 0.252.

Page 40: L20 Semantic Net
Page 41: L20 Semantic Net

• Design a Frame Description of a Hotel Room

Page 42: L20 Semantic Net
Page 43: L20 Semantic Net

• Design a Frame Description of a Birthday Party.

Page 44: L20 Semantic Net