Natural Language Processing

Slides:



Advertisements
Similar presentations
The Structure of Sentences Asian 401
Advertisements

Chapter 4 Syntax.
Language and Cognition Colombo, June 2011 Day 2 Introduction to Linguistic Theory, Part 4.
1 Introduction to Linguistics II Ling 2-121C, group b Lecture 4 Eleni Miltsakaki AUTH Spring 2006.
Syntax: The Sentence Patterns of Language
Chapter Chapter Summary Languages and Grammars Finite-State Machines with Output Finite-State Machines with No Output Language Recognition Turing.
SYNTAX Introduction to Linguistics. BASIC IDEAS What is a sentence? A string of random words? If it is a sentence, does it have to be meaningful?
The study of how words combine to form grammatical sentences.
Syntax: The Sentence Patterns of Language Deny A. Kwary Airlangga University.
Matakuliah: G0922/Introduction to Linguistics Tahun: 2008 Session 11 Syntax 2.
Syntax LING October 11, 2006 Joshua Tauberer.
1 CONTEXT-FREE GRAMMARS. NLE 2 Syntactic analysis (Parsing) S NPVP ATNNSVBD NP AT NNthechildrenate thecake.
Syntax: The analysis of sentence structure
LI 2013 NATHALIE F. MARTIN S YNTAX. Table of Content I. Grammatical vs. Ungrammatical Grammatical vs. Ungrammatical II. The Sentence The Sentence III.
Context-Free Grammar CSCI-GA.2590 – Lecture 3 Ralph Grishman NYU.
Dr. Ansa Hameed Syntax (4).
Historical Linguistics (2) Noam Chomsky
Models of Generative Grammar Smriti Singh. Generative Grammar  A Generative Grammar is a set of formal rules that can generate an infinite set of sentences.
Syntax The analysis of sentence structure
Syntax: The analysis of sentence structure
Syntax.
Syntax Nuha AlWadaani.
Phonetics, Phonology, Morphology and Syntax
THE PARTS OF SYNTAX Don’t worry, it’s just a phrase ELL113 Week 4.
Three Generative grammars
LI 2013 NATHALIE F. MARTIN S YNTAX. Grammatical vs Ungrammatical.
Introduction to Linguistics
Introduction Syntax: form of a sentence (is it valid) Semantics: meaning of a sentence Valid: the frog writes neatly Invalid: swims quickly mathematics.
1.Syntax: the rules of sentence formation; the component of the mental grammar that represent speakers’ knowledge of the structure of phrase and sentence.
Syntax.
Chapter 4: Syntax “I really do not know that anything has ever been more exciting than diagramming sentences.” -Gertrude Stein.
Natural Language Processing Lecture 6 : Revision.
SYNTAX Lecture -1 SMRITI SINGH.
Syntax: 10/18/2015IT 3271 Semantics: Describe the structures of programs Describe the meaning of programs Programming Languages (formal languages) -- How.
Today Phrase structure rules, trees Constituents Recursion Conjunction
PARSING David Kauchak CS159 – Spring 2011 some slides adapted from Ray Mooney.
1 Prof.Roseline WEEK-4 LECTURE -4 SYNTAX. 2 Prof.Roseline Syntax Concentrate on the structure and ordering of components within a sentence Greater focus.
For Wednesday Read chapter 23 Homework: –Chapter 22, exercises 1,4, 7, and 14.
Introduction to Linguistics Ms. Suha Jawabreh Lecture 19.
Syntax Sentence Structures. Generative Grammar This is the idea that grammar has a finite number of rules, BUT is capable of producing an infinite number.
Culture , Language and Communication
Review of basic concepts.  The knowledge of sentences and their structure.  Syntactic rules include: ◦ The grammaticality of sentences ◦ Word order.
Rules, Movement, Ambiguity
CSA2050 Introduction to Computational Linguistics Parsing I.
Making it stick together…
Syntax II “I really do not know that anything has ever been more exciting than diagramming sentences.” --Gertrude Stein.
1 Introduction to Computational Linguistics Eleni Miltsakaki AUTH Spring 2006-Lecture 2.
SYNTAX.
◦ Process of describing the structure of phrases and sentences Chapter 8 - Phrases and sentences: grammar1.
1 Introduction to Computational Linguistics Eleni Miltsakaki AUTH Fall 2005-Lecture 3.
SYNTAX.
1 Some English Constructions Transformational Framework October 2, 2012 Lecture 7.
1 Chapter 4 Syntax Part III. 2 The infinity of language pp The number of sentences in a language is infinite. 2. The length of sentences is.
TYPES OF PHRASES REPRESENTING THE INTERNAL STRUCTURE OF PHRASES 12/5/2016.
Syntax.
Welcome to the flashcards tool for ‘The Study of Language, 5 th edition’, Chapter 8 This is designed as a simple supplementary resource for this textbook,
Week 3. Clauses and Trees English Syntax. Trees and constituency A sentence has a hierarchical structure Constituents can have constituents of their own.
College of Science and Humanity Studies, Al-Kharj.
Lecturer : Ms. Abrar Mujaddidi S YNTAX. I NTRODUCTION  In the previous chapter, we moved from the general categories and concepts of traditional grammar,
SYNTAX.
Chapter 4 Syntax a branch of linguistics that studies how words are combined to form sentences and the rules that govern the formation of sentences.
King Faisal University جامعة الملك فيصل Deanship of E-Learning and Distance Education عمادة التعلم الإلكتروني والتعليم عن بعد [ ] 1 King Faisal University.
King Faisal University جامعة الملك فيصل Deanship of E-Learning and Distance Education عمادة التعلم الإلكتروني والتعليم عن بعد [ ] 1 King Faisal University.
ENGLISH DEPARTMENT FACULTY OF LETTERS
SYNTAX.
4.3 The Generative Approach
Chapter Eight Syntax.
BBI 3212 ENGLISH SYNTAX AND MORPHOLOGY
Chapter Eight Syntax.
Introduction to Linguistics
Presentation transcript:

Natural Language Processing Lecture 5 : Syntax :The analysis of sentence structure Prepared by Alaa Al Mohammadi

Definition of Syntax Syntax is the study of the rules governing the way words are combined to form sentences in a language. *garden the *Children are *Work in This class: what syntactic structure is and what the rules that determine syntactic structure are like.

Syntax Properties of syntactic knowledge: Humans can understand & produce an infinite number of sentences they never heard before “Some purple gnats are starting to tango on microwave” Our grammar can understand and produce long sentences “Bill said that he thought that the esteemed leader of the house had it in mind to tell the unfortunate vice president that the calls that he made from the office in the White House that he thought was private…..” Determine the grammatical relations in a sentence Mary hired Bill. Vs. Bill hired Mary

Definition of Grammar A formal grammar consists of: a finite set of production rules (left-hand side  right-hand side) where each side consists of a sequence of the following symbols: a finite set of non terminal symbols (indicating that some production rule can yet be applied) a finite set of terminal symbols  (indicating that no production rule can be applied) a start symbol (a distinguished non terminal symbol) A formal grammar defines (or generates) a formal language, which is a (usually infinite) set of finite-length sequences of symbols (i.e. strings) that may be constructed by applying production rules Prepared by Alaa Al Mohammadi

Definition of Grammar A rule may be applied to a sequence of symbols by replacing an occurrence of the symbols on the left-hand side of the rule with those that appear on the right-hand side. A sequence of rule applications is called a derivation. Such a grammar defines the formal language: all words consisting solely of terminal symbols which can be reached by a derivation from the start symbol. Non terminals are often represented by uppercase letters, terminals by lowercase letters, and the start symbol by S . Prepared by Alaa Al Mohammadi

Definition of Grammar  For example, the grammar with terminals {a,b} , non terminals  {S,A,B}, production rules   and start symbol S , defines the language of all words of the form   (i.e.  n copies of a  followed by  copies of b ) Prepared by Alaa Al Mohammadi

Definition of Grammar Prepared by Alaa Al Mohammadi

Generative Grammar Noam Chomsky 1950s Generative = a very explicit system of rules specifying what combinations of basic elements result in well-formed sentences. Defines the syntactic structure of a language.

Generative Grammar “all and only”= all grammatical sentences and only grammatical sentences Finite rules infinite number of well-formed sentences Productivity of language Phrase structure rules Transformational rules

Grammar Hierarchy Type-3 grammars (regular grammars) generate the regular languages. Such a grammar restricts its rules to a single non terminal on the left-hand side and a right-hand side consisting of a single terminal, possibly followed by a single non terminal (right regular) Type-2 grammars (context-free grammars) generate the context-free languages. These are defined by rules of the form   with  A a non terminal and   a string of terminals and non terminals. Type-1 grammars (context-sensitive grammars) generate the context-sensitive languages. These grammars have rules of the form  with  A a non terminal and      strings of terminals and non terminals. The strings   and   may be empty, but   must be nonempty. Prepared by Alaa Al Mohammadi

Grammar Hierarchy Type-0 grammars (unrestricted grammars) include all formal grammars. Prepared by Alaa Al Mohammadi

Grammar Hierarchy Prepared by Alaa Al Mohammadi

Phrase structure rules Some words seem to belong together: {The crazy man} {is jumping off the bridge} Groups of words that belong together are called constituents The component that determines the properties of the constituent is the head, and the constituent can be referred to as a phrase: e.g. noun phrase

Phrase Structure Rules If we look at phrases, some patterns emerge: Det N the instructor = NP Det N a friend = NP some homework = NP two classes = NP

Phrase Structure Rules some more patterns: V Det N call the instructor= VP V Det N meet a friend = VP V Det N do some homework = VP V Det N skip two classes = VP

PSR and yet more patterns: Prep Det N with the instructor= PP from a friend = PP with some homework = PP Prep Det N after two classes = PP

PSR Rules for determining the structure of phrases Generate a lot of sentences from a small number of rules. The structure of a phrase will consist of one or more constituents in a certain order. What does a NP consist of? “noun phrases have a Det and a N” NP Det N

Lexical Rules We need lexical rules to specify which words can be used when we rewrite constituents such as N. PN {Mary, George} N {girl, boy, dog} Art Pro

PSR V Det N V Det N V Det N run a marathon eat the food read the book V Prep Det N V Prep Det N go to the store talk with a teacher V Det N Prep Det N take your sister to the library “Verb phrases have a V, (sometimes) an NP, and (sometimes) a PP” VP -> V (NP) (PP)

The main phrase structure rules 1. S  NP VP 2. NP  {Det N, Pro, PN} 3. VP  V (NP) (PP) (Adv) 4. PP  P NP 5. AP  A (PP)

Phrase Structure Rules & tree diagrams NP  (Det) N PP  P NP the boy in the yard NP The boy (NP) Det N Det N PP The boy P NP Det N The boy in the yard

Phrase Structure Rules VP  V (NP) (PP) S  NP VP took the money from the bank VP took the money (VP) V NP V NP PP Det N Det N P NP took the money Det N took the money from the bank

Example (1) The old tree swayed in the wind S NP VP Det Adj N V PP P

Example (2) The children put the toy in the box S NP VP Det N V NP PP

Example 3

Back to Generative Grammar How superficially different sentences are closely related? How superficially similar sentences are different?

Deep and surface structure The deep structure is an abstract level of structural organization in which all the elements determining structural interpretation are represented. Sentences that have alternative interpretations Sentences that have different surface forms but have the same underlying meaning. Surface structure= how the sentence is actually represented

Deep and surface structure How superficially different sentences are closely related? Charlie broke the window. The window was broken by Charlie Charlie who broke the window. Was the window broken by Charlie? Difference in their surface structure = difference in syntactic forms BUT they have the same ‘deep’ or underlying structure

Structural ambiguity How superficially similar sentences are different? (multiple meanings) E.g. Annie whacked the man with an umbrella Same surface structure but different deep structure The boy saw the man with a telescope The question is: What is the scope of "with the telescope"? Does it modify only "the man" or does it modify "saw the man"?

Structural Ambiguity (1) The boy saw the man with the telescope NP VP Det N V NP PP Det N P NP Det N The boy saw the man with the telescope Meaning: Using the telescope, the boy saw the man

Structural Ambiguity (2) The boy saw the man with the telescope NP VP Det NP N V Det N PP P NP Det N The boy saw the man with the telescope Meaning: The boy saw the man. The man had a telescope.

Recursion Rules can be applied more than once in generating sentences E.g. repeat prepositional phrase more than once The gun was on the table near the window in the bedroom in the pink house Put sentences inside sentences This is the cat that ate the rat that ate the cheese that was sold by the man that lived in the city that was on the river… No end to recursion- produce longer complex sentences

Back to recursion [Mary helped George]. (A sentence) [Cathy knew] that [Mary helped George]. (a sentence within a sentence) [John believed] that [Cathy knew] that [Mary helped George]. The word that introduces the complement phrase

Complement Phrases Cathy knew that Mary helped George That = complementizer (C) introducing complement phrase (CP) The CP comes after the VP S NP VP VP V CP CP C S

Complement Phrases

Transformational Rules Phrase structure rules represent ‘deep’ structure- always generate structures with fixed word order. Mary saw George recently Recently Mary saw George Transformational rules= take a specific part and attach it in another place You will help Cathy Will you help Cathy?

Transformational Rules

Exercises Rewrite the following sentences with Phrase Structure Rules.  Hint: Locate your principal NP and VP before beginning. a)  Miriam swims. b)  The dog is barking. c)  Peter told the truth. d)  The wicked witch spilled the potion. e)  The runner with the best time won the prize.

Exercises Draw a labeled tree diagram for the following English phrases. (Hint: what part of speech is the leader for the phrase?) a.  ancient pyramids b.  in the early evening c.  Drove a car

Exercises Draw phrase structure trees for the following sentences: The puppy found the child The ice melted The hot sun melted the ice. The house on the hill collapsed in the wind. The boat sailed up the river. A girl laughed at the monkey.

Exercises Draw two phrase structure trees representing the two meanings of the sentence: The magician touched the child with the wand.