Beruflich Dokumente
Kultur Dokumente
sentencef structuredrepnsofmeaning
"how old is my help3 doc file?" howoldismyhelp3.docfile? Lisp:(query(filedetail'date"C:/help3.doc")) "thelargecatchasedtherat" Logic:(E Logic: (E1s1 large(s1) L feline(s1)) )L L (E1s2 rodent(s2))L chased(s1,s2 ) "theyoungboyateabadapple" CDGraph CD Graph ...seenextpage... see next page
CDgraph "theyoungboyateabadapple"
whatisinvolved
symboliccomputation symbolic computation ie:symbolsmanipulatedbysymbolprocessors search&inference knowledgerepresentationtechniques
whyisitdifficult
prejudice,politics,etc ambiguity... y syntactic semantic pragmatic
examplesentences
theoldmantheboats mycardrinkspetrol IsawtheEiffelTowerflyingtoParis p y heopenedthedoorwiththekey heopenedthedoorwiththesqueakinghinge y theboykickedtheballunderthetree theboykickedthewallunderthetree putthebottlesintheboxontheshelfbythedoor
(brief)historyoflanguageprocessing
1950s 1956 1960s 1970s 1980s 1990s 2000+ Russianf Englishtranslation Chomsky Patternmatching g p Parsing&someKnRep Kn&inference bigdreamssmallresults big dreams small results quietlypromising
matching: g Sir
matching: g Student
matching: g Elisa
amodern approach
input sentence
morphological processing lexicon syntax analysis (parsing) grammar semantic rules semantic analysis
contextual information
pragmatic analysis
target g representation
step1 morphologicalprocessing
objective:stripwordsintoroots&modifiers issues inflection derivation compounding
morphologicalprocessing notes
all(?)spokenlngsexhibitmorphology easiertohandleinwrittenlngsifnoticonic somemorphologydescribesinfmbeyondsyntax g p y ( , , ) eg: proximity (Tamil,Setswana,etc) case speaker/listenerpeerrelationship speaker / listener peer relationship
Proximity Time Things (inanimate) Near N i-ppa (thi ti i (this time: now) ) i-ndtha (thi thi i dth (this thing: thi ) this) Far a-ppa (that time: then) a-ndtha (that thing: that) Question e-ppa (what time: when) e-ndtha (what thing: which) Fig. 2.3. Proximity Information as Prefix Tags (Tamil)
Proximity Cow Student Near Speaker kgomo e (this cow) mo-ithuti yo (this student) Near Listener kgomo e-o (that cow) mo-ithuti yo-o (that student) g ( ) y ( ) Far kgomo e-le (that cow) mo-ithuti yo-le (that student) Fig. 2.4. Proximity by Demostrative Pronoun Inflection (Setswana)
step2 syntaxanalysis
objectives: 1 checkforcorrectness 2 producephrasestructure uses parser grammar lexicon
syntaxrules
partsofspeech rulesofcombination rules of combination consider id thecatchasesthemouse alllargeblackdogschasecats
example1 usingLkit
(build-lexicon '((a determiner) (cat noun) (dog noun) (the determiner) (chased verb))) (build-grammar '((s1 (sentence -> noun-phrase verb-phrase)) 1 (np (noun-phrase -> determiner noun)) (vp (verb-phrase -> verb noun-phrase)) ))
example1 output
(parse 'sentence '(the dog chased a cat)) complete-edge 0 5 s1 sentence (the dog ...) nil s1 sentence -> (noun-phrase verb-phrase) > (noun phrase verb phrase) Syntax (sentence (noun-phrase (determiner the) (noun dog)) (verb-phrase (verb chased) (noun-phrase (determiner a) (noun cat)))) Semantics (sentence)
sowhat? wewantmeaning i
Remember:"theyoungboyateabadapple"
howcansemanticsbeencodedassymbols? the boy / an apple? boy/an young/old,happy/sad,good/bad? howcansemanticsbegenerated? h i b d? whatcanbeinferredfromsemantics?
Reminder:"theyoungboyateabadapple"
symbolicrepresentationofsemantics
(actor (root boy) (id boy#732) (tags animate human male) (qual (age (val 5) (approx 3))) (quant specific)) (action (primitve INGEST)) (object (root apple) (id nil) (tags physob veg fruit food) (qual (phy-state -4)) (quant non-specific))
semanticsinlexicon
asimpleexample
(build-lexicon '((a det (cat noun (chased verb (dog noun (the det ))
semanticsingrammarrules
(s1 (sentence -> noun-phrase verb-phrase) (actor . noun-phrase) ( (action . verb-phrase.action) p ) (object . verb-phrase.object) ) (np (noun phrase -> det noun) (noun-phrase > (det . noun) ) (vp (verb-phrase -> verb noun-phrase) (action . verb) (object . noun-phrase) j p )
semantics results
(parse 'sentence '(the dog chased a cat)) complete-edge 0 5 s1 sentence (the dog...) nil s1 sentence -> (noun-phrase verb-phrase) ( p p ) Syntax (sentence (noun-phrase (det the) (noun dog)) (verb-phrase (verb phrase (verb chased) (noun-phrase (det a) (noun cat)))) Semantics (sentence (actor (specific canine)) (action hunts) (object (any feline))) j y
semanticsinlexicon checks1
(a (all (cat (cats (chase (chases (dog (dogs (the det det noun noun verb verb noun noun det (sems (sems (sems (sems (sems (sems (sems (sems (sems . . . . . . . . . any)) every)) feline) (num feline) (num hunts) (num hunts) (num canine) (num canine) (num specific))
. . . . . .
semanticsingrammar checks1
(s1 (sentence -> noun-phrase verb-phrase) (actor . noun-phrase.sems) ( (action . verb-phrase.action) p ) (object . verb-phrase.object) ; check number of noun-phrase & verb-phrase (if (noun phrase number (noun-phrase.number = verb-phrase.number) numeric-agreement-ok numeric-agreement-bad ) )
semantics results
(parse 'sentence '(the dog chases a cat)) complete-edge 0 5 s1 sentence (the dog...) nil s1 sentence -> (noun-phrase verb-phrase) ( p p ) Syntax (sentence (noun-phrase (det the) (noun dog)) (verb-phrase (verb phrase (verb chases) (noun-phrase (det a) (noun cat)))) Semantics (sentence (actor specific canine) (action . hunts) (object any feline) j y numeric-agreement-ok)
semantics results
(parse 'sentence '(the dogs chases a cat)) complete-edge 0 5 s1 sentence (the dog...) nil s1 sentence -> (noun-phrase verb-phrase) ( p p ) Syntax (sentence (noun-phrase (det the) (noun dog)) (verb-phrase (verb phrase (verb chases) (noun-phrase (det a) (noun cat)))) Semantics (sentence (actor specific canine) (action . hunts) (object any feline) j y numeric-agreement-bad)
semanticsingrammar checks2
(s1 (sentence -> noun-phrase verb-phrase) (fail if noun-phrase.number /= verb-phrase.number) p ) (actor . noun-phrase.sems) (action . verb-phrase.action) (object . verb phrase object) verb-phrase.object) )
semantics results
(parse 'sentence '(the dog chases a cat)) Semantics ( (sentence ( (actor specific canine) p ) (action . hunts) (object any feline))
semanticsingrammar checks3
(s1 (sentence -> noun-phrase verb-phrase) (glitch numeric-agreement if not noun-phrase.number p = verb-phrase.number) (actor . noun-phrase.sems) (action . verb phrase action) verb-phrase.action) (object . verb-phrase.object) )
semantics results
(parse 'sentence '(the dogs chases a cat)) complete-edge 0 5 s1 sentence (the dogs...) nil Glitches: (numeric-agreement) ( g ) s1 sentence -> (noun-phrase verb-phrase) Syntax (sentence (noun phrase (det the) (noun dogs)) (noun-phrase (verb-phrase (verb chases) (noun-phrase (det a) (noun cat)))) Semantics (sentence (actor specific canine) (action . hunts) (object any feline))
example2 lexicon
(a (cat (chase (dog (the (black (large (small det noun verb noun det adj adj adj any ) feline ) hunts ) canine ) specific) (color black)) (size 7/10)) (size 3/10))
example2 grammar
(build-grammar '((np ( (( p (noun-phrase -> ?det *adj noun) p j ) (if det (quantification . det) (quantification undefined)) (qualifiers . *.adj) (object . noun) )) ))
example2 results
(parse 'noun-phrase '(small black dog)) complete-edge 0 3 np noun-phrase (small...) nil np p noun-phrase -> (?det *adj noun) p ( j ) Syntax (noun-phrase (adj small) (adj black) (noun dog)) Semantics (noun-phrase (quantification undefined) (qualifiers ((size . 3/10)) ((color . black))) (object canine))
example2 results
small dogs chase the small cats and large dogs chase the large cats (sentence conjunction ((actor (quant undefined) (qual (size . 3/10)) (object . canine)) (action . hunts) (object (quant . specific) ( ( bj t ( t ifi ) (qual ( i l (size . 3/10)) (object . feline))) ((actor (quant undefined) (qual (size . 7/10)) (object . canine)) (action . hunts) (object (quant . specific) (qual (size . 7/10)) (object . feline))))
semanticprocessing(oneapproach)
semanticrulesingrammarf 1ststagecase frame verbformf primitiveactioncaseframe disambiguate&filladditionalcaseframeslots checkreferenceswithworldand/ordialog dostatementlevelinference integratewithdialog q g doeventsequencedialog
step1:producerawcaseframe
verbcases
thecatchasedtheratinthekitchen thecatchasedtheratintothekitchen
commoncases
source destination location starttime endtime duration instrument beneficiary
theambiguityproblem
eg:theboykickedtheballunderthetree grammarrules
Sf SPP S f NP VP NP f ?det *adj noun NPf NPPP NP f NP PP
exampleframe#1
actor (quant specific) (tags animate male human) (qual (age (range 3 13))) (root boy) action (root kick) object (root ball) (tags manip) (posn-relative (locator beneath) (object (root tree) ...etc... ) etc
exampleframe#2
actor (quant specific) (tags animate male human) (qual (age (range 3 13))) (root boy) action (root kick) object (root ball) (tags manip) dest (posn-relative (locator beneath) (object (root tree) ...etc... ) etc
exampleverbform#1
primitive prohibited slots legal strike object (tags manip) instrument (part-of $actor foot) start-time, end-time, duration instrument, beneficiary, location source, dest
illegal
exampleverbform#2
primitive required slots legal push object (tags manip) instrument (part-of $actor foot) source, dest, start-time, end-time, instr, beneficiary, locatn, duration
semanticprocessing(oneapproach)
semanticrulesingrammarf 1ststagecase frame verbformf primitiveactioncaseframe disambiguate&filladditionalcaseframeslots checkreferenceswithworldand/ordialog dostatementlevelinference integratewithdialog q g doeventsequencedialog
integrationwithdialog
dialogshave... players(actors) props(objects) ( ) locations(fromcaseframes) themes(derived) eventsequences(fromthemes) event sequences (from themes) plans(fromthemesand/orderived)
eventsequence
setof... players(actors) props(objects) seriesof... semanticallyencodedactivities(matched) semantically encoded activities (matched) escapes,exceptions&alternatives