1 / 10

Topic 9 Symbol Manipulation Generating English Sentences

Topic 9 Symbol Manipulation Generating English Sentences. Section 2.3.2 This is an additional example to symbolic differentiation in book. October 2008. Example of Symbol Manipulation. One of the corner stones of Lisp/Scheme is its ability to easily manipulate symbols.

graceland
Download Presentation

Topic 9 Symbol Manipulation Generating English Sentences

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Topic 9 Symbol ManipulationGenerating English Sentences Section 2.3.2 This is an additional example to symbolic differentiation in book. October 2008 Programming Development Techniques

  2. Example of Symbol Manipulation • One of the corner stones of Lisp/Scheme is its ability to easily manipulate symbols. • Because of this it has been heavily used in Artificial Intelligence. • As an example, we will write a program to manipulate English Sentences. Programming Development Techniques

  3. What makes an English Sentence? Consider very simple sentences (Context Free Grammar): S  NP VP NP  N | Adjective NP N  dog | cat | professor | student | rat Adjective  red | slow | dead VP  V | V Adverb V  ran | ate | slept | drank Adverb  quickly | happily | well Programming Development Techniques

  4. How might we generate using a Context Free Grammar? • Start with S • Find a rule whose left hand side matches S • Replace S with the right hand side of the rule • Continue Programming Development Techniques

  5. S  NP VP NP  N | Adjective NP N  dog | cat | professor | student | rat Adjective  red | slow | funny VP  V | V Adverb V  ran | ate | slept | studied Adverb  quickly | happily | well S NP VP N VP Professor VP V Professor ate Example Generation Programming Development Techniques

  6. S  the NP VP NP  N | Adjective NP N  dog | cat | professor | student | rat Adjective  red | slow | funny VP  V | V Adverb V  ran | ate | slept | studied Adverb  quickly | happily | well S The NP VP The Adjective NP VP The slow NP VP The slow Adjective NP VP The slow red NP VP The slow red N VP The slow red student VP The slow red student V Adverb The slow red student slept Adverb The slow red student slept happily Slight Modification Programming Development Techniques

  7. Implementation • Phrases will be represented as lists of words • Example: (ate) and (ate quickly) are both verb phrases. • Example: (professor) and (slow red professor) are both noun phrases. Programming Development Techniques

  8. Sentence Procedure • Creates a list of words that are “in the language” of the context free grammar defined earlier. • How? • Append them all together • SHOW CODE Programming Development Techniques

  9. Implications • Means that (noun-phrase) and (verb-phrase) are procedures that return lists of words • We saw in sentence, that it pretty much followed the right hand side of the rule Problem: • We have two right hand sides for each of noun-phrase and verb phrase • We want to randomly pick between them Programming Development Techniques

  10. Scheme allows random selection • (random 3) • Will select randomly between 0 1 2…. Programming Development Techniques

More Related