Semantic Nets Lexical Nodes denote objects Links denote
Semantic Nets
Lexical • Nodes – denote objects • Links – denote relations • Link Labels – denote particular relations
Structural • Nodes connected by Links • Links are directional
Procedural • Basic: – Constructor for arcs and links • Create a node • Create a link between nodes – Readers • • Get all links from a node Get all links arriving Find tail node of a path Find head node of a path – Destructors
Procedural (cont. ) • Reasoning Procedures – Problem solving procedures either • In the net • External using basic assessors
Describe and Match • Describe an object and match to find a solution • Geometric Analogy: – Describe objects and their relationships – Look for changes – Form a new figure
SNe. PS • A general Semantic Net with a command interface • SNe. PS extensions: – SNIP – the inference package – SNERE – a rational engine – SNa. LPS – Natural Language System
SNa. LPS • Lexicon support • GATN parser
SNe. PSUL The User Interface Language • This is a great example of the power of LISP!! • Some basic functions: • (define {relations}*) • Build and Assert – (assert { relation nodeset}*) • Describe
Example • (describe (assert member (snoopy rover) class (dog animal))) • (M 1! (CLASS ANIMAL DOG) (MEMBER ROVER SNOOPY)) M 1 class ANIMAL class DOG member ROVER member SNOOPY
Inference • (describe (deduce member snoopy class dog)) • (M 2! (CLASS DOG) (MEMBER SNOOPY))
Path Based Inference • Graph Traversal • Deduction Rules as path definitions – Paths means a Relation exists
GATN Grammars • Set of Arcs – State – Arcs • Cat arcs – – Matches a lexical input – Performs a set of actions and then a terminal action
GATN Grammars (cont. ) • Call arcs – Calls a state if a test success – Has pre-actions for before call – Can substitute a form for the current word – Terminal action on return
GATN Grammars (cont. ) • Jump arcs – If test succeed continue at state • Push and Pop – similar to call
; ; ; Author: Stuart C. Shapiro ; ; ; Written: February 90 ; ; ; Description: The following is a simple grammar that allows parsing ; ; ; of sentences such as 'John caught a ball. ', or ; ; ; 'I tell a story. '. For successful parses a parse-tree ; ; ; will be returned. (s (jump s-maj t (setq parser: *parse-trees* t))) (s-maj (push s-min t (setr s (buildq (s-maj *))) (to s/s-min))) (s/s-min (cat final-punc (addr s (buildq ((final-punc *)))) (to ends))) (ends (pop s t)) (s-min (push np t (setr subj *) (to s/np))) (s/np (cat v (setr vp (buildq (v *))) (to s/v))) (s/v (push np t (setr vp (buildq (vp + *) vp)) (to ends-min))) (ends-min (pop (buildq (s + +) subj vp) t))
(np (cat pro t (setr np (buildq ((pro *)))) (to endnp)) (cat npr t (setr np (buildq ((npr *)))) (to endnp)) (cat det t (setr np (buildq ((det *)))) (to np/det)) (jump np/det t)) (np/det (cat adj t (addr np (buildq ((adj *)))) (to np/det)) (cat n t (addr np (buildq ((n *)))) (to endnp))) (endnp (pop (buildq (@ (np) +) np) t))
Lexicon • Morphological Structure • Features • Uses ctgy as lexical category
("a" ((ctgy. det))) ("animal" ((ctgy. n))) ("are" ((ctgy. v)(root. "be")(num. (sing plur))(tense. pres)) ((ctgy. aux)(root. "be")(num. (sing plur))(tense. pres))) ("ball" ((ctgy. n))) ("be" ((ctgy. v)(root. "be")(presp. "being")) ((ctgy. aux) (root. "be")(presp. "being"))) ("big" ((ctgy. adj))) ("boy" ((ctgy. n) (gen. m)(num. sing))) ("circus" ((ctgy. multi-start)(multi-rest. ("elephant")))) ("circus elephant" ((ctgy. n))) ("is" ((ctgy. v)(root. "be")(num. sing)(tense. pres)) ((ctgy. aux)(root. "be")(num. sing)(tense. pres))) ("block" ((ctgy. n)) ((ctgy. v))) ("can" ((ctgy. aux)(modal. t)(num. (sing plur))) ((ctgy. n)))
- Slides: 19