Natural Language Processing what it does what is involved why is it difficult brief history

download Natural Language Processing what it does what is involved why is it difficult brief history

of 50

  • date post

    16-Dec-2015
  • Category

    Documents

  • view

    213
  • download

    0

Embed Size (px)

Transcript of Natural Language Processing what it does what is involved why is it difficult brief history

  • Slide 1
  • Natural Language Processing what it does what is involved why is it difficult brief history
  • Slide 2
  • sentence structured rep n s of meaning "how old is my help3.doc file?" Lisp: (query (file-detail 'date "C:/help3.doc")) "the large cat chased the rat" Logic: ( 1 s 1 large(s 1 ) feline(s 1 )) ( 1 s 2 rodent(s 2 )) chased(s 1, s 2 ) "the young boy ate a bad apple" CD Graph...see next page...
  • Slide 3
  • CD graph "the young boy ate a bad apple"
  • Slide 4
  • what is involved symbolic computation ie: symbols manipulated by symbol processors search & inference knowledge representation techniques
  • Slide 5
  • prejudice, politics, etc ambiguity... syntactic semantic pragmatic why is it difficult
  • Slide 6
  • example sentences the old man the boats my car drinks petrol I saw the Eiffel Tower flying to Paris he opened the door with the key he opened the door with the squeaking hinge the boy kicked the ball under the tree the boy kicked the wall under the tree put the bottles in the box on the shelf by the door
  • Slide 7
  • 1950sRussian English translation 1956Chomsky 1960sPattern matching 1970sParsing & some KnRep 1980sKn & inference 1990sbig dreams small results 2000+quietly promising (brief) history of language processing
  • Slide 8
  • matching: Sir
  • Slide 9
  • matching: Student
  • Slide 10
  • matching: Elisa
  • Slide 11
  • a modern approach input sentence syntax analysis (parsing) semantic analysis pragmatic analysis target representation grammar lexicon semantic rules contextual information morphological processing
  • Slide 12
  • step 1- morphological processing objective: strip words into roots & modifiers issues inflection(cat pl cat-s) derivation(happy adj happiness noun) compounding(toothpaste)
  • Slide 13
  • morphological processing - notes all(?) spoken lngs exhibit morphology easier to handle in written lngs if not iconic some morphology describes infm beyond syntax eg:proximity(Tamil, Setswana, etc) case speaker / listener peer relationship
  • Slide 14
  • morphology examples
  • Slide 15
  • step 2- syntax analysis objectives:1check for correctness 2produce phrase structure uses parsera rule-based search engine grammarcontext-free production rules lexicondictionary of words & their categories
  • Slide 16
  • syntax rules parts of speech rules of combination consider the cat chases the mouse all large black dogs chase cats
  • Slide 17
  • example 1 - using Lkit (build-lexicon '((a determiner) (cat noun) (dog noun) (the determiner) (chased verb))) (build-grammar '((s1 (sentence -> noun-phrase verb-phrase)) (np (noun-phrase -> determiner noun)) (vp (verb-phrase -> verb noun-phrase)) ))
  • Slide 18
  • example 1 - output (parse 'sentence '(the dog chased a cat)) complete-edge 0 5 s1 sentence (the dog...) nil s1 sentence -> (noun-phrase verb-phrase) Syntax (sentence (noun-phrase (determiner the) (noun dog)) (verb-phrase (verb chased) (noun-phrase (determiner a) (noun cat)))) Semantics (sentence)
  • Slide 19
  • so what ? we want meaning
  • Slide 20
  • Remember: "the young boy ate a bad apple" how can semantics be encoded as symbols? the boy / an apple? young/old, happy/sad, good/bad? how can semantics be generated? what can be inferred from semantics?
  • Slide 21
  • Reminder: "the young boy ate a bad apple"
  • Slide 22
  • symbolic representation of semantics (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))
  • Slide 23
  • semantics in lexicon a simple example (build-lexicon '((a det any ) (cat noun feline ) (chased verb hunts ) (dog noun canine ) (the det specific) ))
  • Slide 24
  • semantics in grammar rules (s1 (sentence -> noun-phrase verb-phrase) (actor. noun-phrase) (action. verb-phrase.action) (object. verb-phrase.object) ) (np (noun-phrase -> det noun) (det. noun) ) (vp (verb-phrase -> verb noun-phrase) (action. verb) (object. noun-phrase) )
  • Slide 25
  • semantics - results (parse 'sentence '(the dog chased a cat)) complete-edge 0 5 s1 sentence (the dog...) nil s1 sentence -> (noun-phrase verb-phrase) Syntax (sentence (noun-phrase (det the) (noun dog)) (verb-phrase (verb chased) (noun-phrase (det a) (noun cat)))) Semantics (sentence (actor (specific canine)) (action hunts) (object (any feline)))
  • Slide 26
  • semantics in lexicon - checks 1 (a det (sems. any)) (all det (sems. every)) (cat noun (sems. feline) (num. sing)) (cats noun (sems. feline) (num. plur)) (chase verb (sems. hunts) (num. plur)) (chases verb (sems. hunts) (num. sing)) (dog noun (sems. canine) (num. sing)) (dogs noun (sems. canine) (num. plur)) (the det (sems. specific))
  • Slide 27
  • semantics in grammar - checks 1 (s1 (sentence -> noun-phrase verb-phrase) (actor. noun-phrase.sems) (action. verb-phrase.action) (object. verb-phrase.object) ; check number of noun-phrase & verb-phrase (if (noun-phrase.number = verb- phrase.number) numeric-agreement-ok numeric-agreement-bad )
  • Slide 28
  • semantics - results (parse 'sentence '(the dog chases a cat)) complete-edge 0 5 s1 sentence (the dog...) nil s1 sentence -> (noun-phrase verb-phrase) Syntax (sentence (noun-phrase (det the) (noun dog)) (verb-phrase (verb chases) (noun-phrase (det a) (noun cat)))) Semantics (sentence (actor specific canine) (action. hunts) (object any feline) numeric-agreement-ok)
  • Slide 29
  • semantics - results (parse 'sentence '(the dogs chases a cat)) complete-edge 0 5 s1 sentence (the dog...) nil s1 sentence -> (noun-phrase verb-phrase) Syntax (sentence (noun-phrase (det the) (noun dog)) (verb-phrase (verb chases) (noun-phrase (det a) (noun cat)))) Semantics (sentence (actor specific canine) (action. hunts) (object any feline) numeric-agreement-bad)
  • Slide 30
  • semantics in grammar - checks 2 (s1 (sentence -> noun-phrase verb-phrase) (fail if noun-phrase.number /= verb-phrase.number) (actor. noun-phrase.sems) (action. verb-phrase.action) (object. verb-phrase.object) )
  • Slide 31
  • semantics - results (parse 'sentence '(the dog chases a cat)) Semantics (sentence (actor specific canine) (action. hunts) (object any feline)) (parse 'sentence '(the dogs chases a cat)).... failed....
  • Slide 32
  • semantics in grammar - checks 3 (s1 (sentence -> noun-phrase verb-phrase) (glitch numeric-agreement if not noun-phrase.number = verb-phrase.number) (actor. noun-phrase.sems) (action. verb-phrase.action) (object. verb-phrase.object) )
  • Slide 33
  • semantics - results (parse 'sentence '(the dogs chases a cat)) complete-edge 0 5 s1 sentence (the dogs...) nil Glitches: (numeric-agreement) s1 sentence -> (noun-phrase verb-phrase) Syntax (sentence (noun-phrase (det the) (noun dogs)) (verb-phrase (verb chases) (noun-phrase (det a) (noun cat)))) Semantics (sentence (actor specific canine) (action. hunts) (object any feline))
  • Slide 34
  • example 2 - lexicon (a det any ) (cat noun feline ) (chase verb hunts ) (dog noun canine ) (the det specific) (black adj (color black)) (large adj (size 7/10)) (small adj (size 3/10))
  • Slide 35
  • example 2 - grammar (build-grammar '((np (noun-phrase -> ?det *adj noun) (if det (quantification. det) (quantification undefined)) (qualifiers. *.adj) (object. noun) ))
  • Slide 36
  • example 2 - results (parse 'noun-phrase '(small black dog)) complete-edge 0 3 np noun-phrase (small...) nil np noun-phrase -> (?det *adj noun) Syntax (noun-phrase (adj small) (adj black) (noun dog)) Semantics (noun-phrase (quantification undefined) (qualifiers ((size. 3/10)) ((color. black))) (object canine))
  • Slide 37
  • example 2 - 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) (qual (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))))
  • Slide 38
  • semantic processing (one approach) semantic rules in grammar 1st stage case frame verb form primitive action case frame disambiguate & fill additional case frame slots check references with world and/or dialog do statement level inference integrate with dialog do event sequence dialog
  • Slide 39
  • step-1: produce raw case frame verb cases the cat chased the rat in the kitchen the cat chased the rat into the kitchen common cases sourcestart-timeinstrument destinationend-timebeneficiary locationduration
  • Slide 40
  • the ambiguity problem eg: the boy kicked the ball under the tree grammar rules S S PP S NP VP NP ?det *adj noun NP NP PP
  • Slide 41
  • example frame #1 actor (qu