Fall 2008Programming Development Techniques 1 Topic 9 Symbol Manipulation Generating English Sentences Section 2.3.2 This is an additional example to symbolic.

Slides:



Advertisements
Similar presentations
Prolog programming....Dr.Yasser Nada. Chapter 8 Parsing in Prolog Taif University Fall 2010 Dr. Yasser Ahmed nada prolog programming....Dr.Yasser Nada.
Advertisements

Verbals and Verb Phrases
Basic Sentence Construction
Identifying Prepositional Phrases
1 CS 385 Fall 2006 Chapter 14 Understanding Natural Language Problems.
Grammars.
Chapter Chapter Summary Languages and Grammars Finite-State Machines with Output Finite-State Machines with No Output Language Recognition Turing.
Nouns Verbs Adjectives adverbs Prepositional phrase.
1 Introduction to Computational Linguistics Eleni Miltsakaki AUTH Fall 2005-Lecture 2.
Syntax LING October 11, 2006 Joshua Tauberer.
CS 3240 – Chuck Allison.  A model of computation  A very simple, manual computer (we draw pictures!)  Our machines: automata  1) Finite automata (“finite-state.
Constituency Tests Phrase Structure Rules
THE PARTS OF SYNTAX Don’t worry, it’s just a phrase ELL113 Week 4.
Context Free Grammars Reading: Chap 12-13, Jurafsky & Martin This slide set was adapted from J. Martin, U. Colorado Instructor: Paul Tarau, based on Rada.
Computing Science, University of Aberdeen1 CS4025: Grammars l Grammars for English l Features l Definite Clause Grammars See J&M Chapter 9 in 1 st ed,
ELA3C1 The student demonstrates understanding and control of the rules of the English language, realizing that usage involves the appropriate application.
Grammars.
ICS611 Introduction to Compilers Set 1. What is a Compiler? A compiler is software (a program) that translates a high-level programming language to machine.
LING 388: Language and Computers Sandiway Fong Lecture 17.
ITEC 380 Organization of programming languages Lecture 2 – Grammar / Language capabilities.
Introduction Syntax: form of a sentence (is it valid) Semantics: meaning of a sentence Valid: the frog writes neatly Invalid: swims quickly mathematics.
DGP Week Two.
MODIFERS  GRADE 5  BY  CHERYL M. HAMILTON. MODIFIERS  Adjectives, adverbs, and prepositional phrases are modifiers, words or groups of words that.
Understanding and Falling in Love with Prepositional Phrases.
GRAMMARS David Kauchak CS159 – Fall 2014 some slides adapted from Ray Mooney.
CS : Language Technology for the Web/Natural Language Processing Pushpak Bhattacharyya CSE Dept., IIT Bombay Constituent Parsing and Algorithms (with.
CSNB143 – Discrete Structure Topic 11 – Language.
Context Free Grammars Reading: Chap 9, Jurafsky & Martin This slide set was adapted from J. Martin, U. Colorado Instructor: Rada Mihalcea.
LING 388: Language and Computers Sandiway Fong Lecture 13.
Warm Up What is a noun? A noun is a word that names a person, animal, place, thing, or idea. There are more nouns in the English language than any other.
Linguistic Essentials
The Parts of Speech The 8 Parts of Speech… Nouns Adjectives Pronouns Verbs Adverbs Conjunctions Prepositions Interjections.
Grammars Grammars can get quite complex, but are essential. Syntax: the form of the text that is valid Semantics: the meaning of the form – Sometimes semantics.
Artificial Intelligence: Natural Language
The man bites the dog man bites the dog bites the dog the dog dog Parse Tree NP A N the man bites the dog V N NP S VP A 1. Sentence  noun-phrase verb-phrase.
Parts Of Speech Noun, Verb, Adjective, Adverb, Pronoun, Prepositions, Interjection, Conjunction.
LANGUAGE ARTS LA WORKS UNIT 3 REVIEW STUDY GUIDE.
UHCL Writing Center Basic Sentence Construction. UHCL Writing Center Word Forms Sentences can contain Nouns, Verbs, Adverbs, Adjectives, and Prepositions.
1 "There is no education like adversity." Disraeli, Endymion.
Computing Science, University of Aberdeen1 CS4025: Grammars l Grammars for English l Features l Definite Clause Grammars See J&M Chapter 9 in 1 st ed,
Curry A Tasty dish? Haskell Curry!. Curried Functions Currying is a functional programming technique that takes a function of N arguments and produces.
Multi Sensory Grammar Color Coding Sentences. Nouns Nouns-They tell us things. They are the names of people, places, things, or ideas. They are colored.
1 Introduction to Computational Linguistics Eleni Miltsakaki AUTH Spring 2006-Lecture 2.
Adjectives vs. Adverbs Created by Kathryn Reilly.
GRAMMARS & PARSING. Parser Construction Most of the work involved in constructing a parser is carried out automatically by a program, referred to as a.
NATURAL LANGUAGE PROCESSING
The structure and Function of Phrases and Sentences
Parts of Speech By: Miaya Nischelle Sample. NOUN A noun is a person place or thing.
Kids Learning is Fun Writing an Interesting Sentence.
Formal grammars A formal grammar is a system for defining the syntax of a language by specifying sequences of symbols or sentences that are considered.
Adjectives and Adverbs I thoroughly enjoy creating these fabulous PowerPoint slides!!
The structure of verb phrases Kuiper and Allan Chapter
1 Simple Lisp Programs References:
Year 2 Grammar. Year 2 Grammar The brown dog ran quickly.
Beginning Syntax Linda Thomas
Parts of Speech How Words Function.
Fundamentals of Programming I A Sentence Generator
Level (Common European Framework, A1 / A2).
Basic Parsing with Context Free Grammars Chapter 13
English Grammar Parts of Speech.
FORMAL LANGUAGES AND AUTOMATA THEORY
The wonderful world of…
Nouns Nouns not noun noun noun not not
Grammar Review.
FIRST SEMESTER GRAMMAR
Parts of Speech How Words Function.
Linguistic Essentials
Curry A Tasty dish? Haskell Curry!.
Monday October 3 **Get your RWN
So or such?.
Presentation transcript:

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

Fall 2008Programming 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.

Fall 2008Programming 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

Fall 2008Programming 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

Fall 2008Programming Development Techniques 5 Example Generation 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

Fall 2008Programming Development Techniques 6 Slight Modification 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

Fall 2008Programming 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.

Fall 2008Programming 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

Fall 2008Programming 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

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