Fall 2005 Lecture Notes #2 EECS 595 / LING 541 / SI 661&761 Natural Language Processing.

Slides:



Advertisements
Similar presentations
Language and Grammar Unit
Advertisements

School of something FACULTY OF OTHER School of Computing FACULTY OF ENGINEERING PoS-Tagging theory and terminology COMP3310 Natural Language Processing.
Outline Why part of speech tagging? Word classes
Statistical NLP: Lecture 3
BİL711 Natural Language Processing
Natural Language Processing Lecture 8—9/24/2013 Jim Martin.
The Eight Parts of Speech
LING NLP 1 Introduction to Computational Linguistics Martha Palmer April 19, 2006.
1 Words and the Lexicon September 10th 2009 Lecture #3.
 Christel Kemke 2007/08 COMP 4060 Natural Language Processing Word Classes and English Grammar.
POS based on Jurafsky and Martin Ch. 8 Miriam Butt October 2003.
NLP and Speech 2004 English Grammar
POS Tagging HMM Taggers (continued). Today Walk through the guts of an HMM Tagger Address problems with HMM Taggers, specifically unknown words.
1 Introduction to Computational Linguistics Eleni Miltsakaki AUTH Fall 2005-Lecture 2.
Part of speech (POS) tagging
1 CSC 594 Topics in AI – Applied Natural Language Processing Fall 2009/ Outline of English Syntax.
Announcements Main CSE file server went down last night –Hand in your homework using ‘submit_cse467’ as soon as you can – no penalty if handed in today.
Stochastic POS tagging Stochastic taggers choose tags that result in the highest probability: P(word | tag) * P(tag | previous n tags) Stochastic taggers.
Phrases and Sentences: Grammar
Embedded Clauses in TAG
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.
1 CS598 DNR FALL 2005 Machine Learning in Natural Language Introduction: Part 3 Linguistics Essentials (The role of Linguistics in NLP)
Chapter 4 Basics of English Grammar Business Communication Copyright 2010 South-Western Cengage Learning.
1 Ch-3: Linguistics Essentials Prepared by Qaiser Abbas ( )
Daily Grammar Practice
Dr. Monira Al-Mohizea MORPHOLOGY & SYNTAX WEEK 11.
Click to edit Master title style Instructor: Nick Cercone CSEB - CSE Introduction to Computational Linguistics Tuesdays,
Instructor: Jully Yin Meeting Room: Room 209. Ms. Jully Yin has been instructing at National Taipei University since Education: Ms. Jully Yin has.
Natural Language Processing Lecture 6 : Revision.
Fall 2005 Lecture Notes #8 EECS 595 / LING 541 / SI 661 Natural Language Processing.
CS : Language Technology for the Web/Natural Language Processing Pushpak Bhattacharyya CSE Dept., IIT Bombay Constituent Parsing and Algorithms (with.
English Review for Final These are the chapters to review. In Textbook: Chapter 1 Nouns Chapter 2 Pronouns Chapter 3 Adjectives Chapter 4 Verbs Chapter.
LING 388: Language and Computers Sandiway Fong Lecture 18.
Chapter 5 Syntax English Linguistics: An Introduction.
NLP. Introduction to NLP Is language more than just a “bag of words”? Grammatical rules apply to categories and groups of words, not individual words.
NLP. Introduction to NLP Example: –Input: Written English (X) –Encoder: garbles the input (X->Y) –Output: Spoken English (Y) More examples: –Grammatical.
Context Free Grammars Reading: Chap 9, Jurafsky & Martin This slide set was adapted from J. Martin, U. Colorado Instructor: Rada Mihalcea.
10/30/2015CPSC503 Winter CPSC 503 Computational Linguistics Lecture 7 Giuseppe Carenini.
Morphology Gerber Luca. Put the words into groups:  Write  Takes  Ate  Taking  Written  Eats  Writing  Took  Wrote  Eaten  Taken  Eat  Writes.
Word classes and part of speech tagging Chapter 5.
Linguistic Essentials
Parsing with Context-Free Grammars for ASR Julia Hirschberg CS 4706 Slides with contributions from Owen Rambow, Kathy McKeown, Dan Jurafsky and James Martin.
DEFINING FEATURES OF LANGUAGE Language uses arbitrary symbols Language is generative Language permits displacement.
Word classes and part of speech tagging 09/28/2004 Reading: Chap 8, Jurafsky & Martin Instructor: Rada Mihalcea Note: Some of the material in this slide.
Rules, Movement, Ambiguity
Natural Language Processing
CSA3202 Human Language Technology HMMs for POS Tagging.
Words Introduction to English Language Phrases Professor Sabine Mendes Moura.
Objective : Students will gain understanding of how sentence structure and subtle overtones of words can help them understand and define them.
Daily Grammar & Vocabulary Practice
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.
Teaching English Grammar
NLP. Introduction to NLP Rule-based Stochastic –HMM (generative) –Maximum Entropy MM (discriminative) Transformation-based.
Language and Cognition Colombo, June 2011 Day 2 Introduction to Linguistic Theory, Part 3.
Basic Syntactic Structures of English CSCI-GA.2590 – Lecture 2B Ralph Grishman NYU.
Daily Grammar & Vocabulary Practice
Inflection. Inflection refers to word formation that does not change category and does not create new lexemes, but rather changes the form of lexemes.
Chapter 5 English Syntax: The Grammar of Words. What is syntax? the study of the structures of sentences combining words to create ‘all & only’ ‘well-formed’
Lecture 1 Sentences Verbs.
Natural Language Processing Vasile Rus
Instructor: Nick Cercone CSEB -
Introduction to Linguistics IX Syntax.
Statistical NLP: Lecture 3
Chapter 4 Basics of English Grammar
Lecture 6: Part of Speech Tagging (II): October 14, 2004 Neal Snider
Linguistic Essentials
Chapter 4 Basics of English Grammar
Natural Language Processing
Presentation transcript:

Fall 2005 Lecture Notes #2 EECS 595 / LING 541 / SI 661&761 Natural Language Processing

Course logistics Instructor: Prof. Dragomir Radev Ph.D., Computer Science, Columbia University Formerly at IBM TJ Watson Research Center Times: Thursdays 2:40-5:25 PM, in 411, West Hall Office hours: TBA, 3080 West Hall Connector Course home page:

Linguistic Fundamentals

Syntactic categories Substitution test: Nathalie likes {} cats. black Persian tabby small Open (lexical) and closed (functional) categories: No-fly-zone yadda yadda yadda the in

Morphology Parts of speech: eight (or so) general types Inflection (number, person, tense…) Derivation (adjective-adverb, noun-verb) Compounding (separate words or single word) Part-of-speech tagging Morphological analysis (prefix, root, suffix, ending) The dog chased the yellow bird.

Part of speech tags NN /* singular noun */ IN /* preposition */ AT /* article */ NP /* proper noun */ JJ /* adjective */, /* comma */ NNS /* plural noun */ CC /* conjunction */ RB /* adverb */ VB /* un-inflected verb */ VBN /* verb +en (taken, looked (passive,perfect)) */ VBD /* verb +ed (took, looked (past tense)) */ CS /* subordinating conjunction */ From Church (1991) - 79 tags

Jabberwocky (Lewis Carroll) `Twas brillig, and the slithy toves Did gyre and gimble in the wabe: All mimsy were the borogoves, And the mome raths outgrabe. "Beware the Jabberwock, my son! The jaws that bite, the claws that catch! Beware the Jubjub bird, and shun The frumious Bandersnatch!"

Nouns Nouns: dog, tree, computer, idea Nouns vary in number (singular, plural), gender (masculine, feminine, neuter), case (nominative, genitive, accusative, dative) Latin: filius (m), filia (f), filium (object) German: Mädchen Clitics (‘s)

Pronouns Pronouns: she, ourselves, mine Pronouns vary in person, gender, number, case (in English: nominative, accusative, possessive, 2nd possessive, reflexive) Mary saw her in the mirror. Mary saw herself in the mirror. Anaphors: herself, each other

Determiners and adjectives Articles: the, a Demonstratives: this, that Adjectives: describe properties Attributive and predicative adjectives Agreement: in gender, number Comparative and superlative (derivative and periphrastic) Positive form

Verbs Actions, activities, and states (throw, walk, have) English: four verb forms tenses: present, past, future other inflection: number, person gerunds and infinitive aspect: progressive, perfective voice: active, passive participles, auxiliaries irregular verbs French and Finnish: many more inflections than English

Other parts of speech Adverbs, prepositions, particles phrasal verbs (the plane took off, take it off) particles vs. prepositions (she ran up a bill/hill) Coordinating conjunctions: and, or, but Subordinating conjunctions: if, because, that, although Interjections: Ouch!

Phrase structure Constraints on word order Constituents: NP, PP, VP, AP Phrase structure grammars S NPVP N PN Spot V chased Det N abird

Phrase structure Paradigmatic relationships (e.g., constituency) Syntagmatic relationships (e.g., collocations) S NPVP NP VBD caught the butterfly ThatmanPP IN NP with anet

Peter gave Mary a book. Mary gave Peter a book. Phrase-structure grammars Constituent order (SVO, SOV) imperative forms sentences with auxiliary verbs interrogative sentences declarative sentences start symbol and rewrite rules context-free view of language

Sample phrase-structure grammar S  NP VP NP  AT NNS NP  AT NN NP  NP PP VP  VP PP VP  VBD VP  VBD NP P  IN NP AT  the NNS  children NNS  students NNS  mountains VBD  slept VBD  ate VBD  saw IN  in IN  of NN  cake

Phrase structure grammars Local dependencies Non-local dependencies Subject-verb agreement The women who found the wallet were given a reward. wh-extraction Should Peter buy a book? Which book should Peter buy? Empty nodes

Dependency: arguments and adjuncts Event + dependents (verb arguments are usually NPs) agent, patient, instrument, goal - semantic roles subject, direct object, indirect object transitive, intransitive, and ditransitive verbs active and passive voice Sue watched the man at the next table.

Subcategorization Arguments: subject + complements adjuncts vs. complements adjuncts are optional and describe time, place, manner… subordinate clauses subcategorization frames

Subcategorization Subject: The children eat candy. Object: The children eat candy. Prepositional phrase: She put the book on the table. Predicative adjective: We made the man angry. Bare infinitive: She helped me walk. To-infinitive: She likes to walk. Participial phrase: She stopped singing that tune at the end. That-clause: She thinks that it will rain tomorrow. Question-form clauses: She asked me what book I was reading.

Subcategorization frames Intransitive verbs: The woman walked Transitive verbs: John loves Mary Ditransitive verbs: Mary gave Peter flowers Intransitive with PP: I rent in Paddington Transitive with PP: She put the book on the table Sentential complement: I know that she likes you Transitive with sentential complement: She told me that Gary is coming on Tuesday

Selectional restrictions and preferences Subcategorization frames capture syntactic regularities about complements Selectional restrictions and preferences capture semantic regularities: bark, eat

Phrase structure ambiguity Grammars are used for generating and parsing sentences Parses Syntactic ambiguity Attachment ambiguity: Our company is training workers. The children ate the cake with a spoon. High vs. low attachment Garden path sentences: The horse raced past the barn fell. Is the book on the table red?

Ungrammaticality vs. semantic abnormality * Slept children the. # Colorless green ideas sleep furiously. # The cat barked.

Semantics and pragmatics Lexical semantics and compositional semantics Hypernyms, hyponyms, antonyms, meronyms and holonyms (part-whole relationship, tire is a meronym of car), synonyms, homonyms Senses of words, polysemous words Homophony (bass). Collocations: white hair, white wine Idioms: to kick the bucket

Discourse analysis Anaphoric relations: 1. Mary helped Peter get out of the car. He thanked her. 2. Mary helped the other passenger out of the car. The man had asked her for help because of his foot injury. Information extraction problems (entity crossreferencing) Hurricane Hugo destroyed 20,000 Florida homes. At an estimated cost of one billion dollars, the disaster has been the most costly in the state’s history.

Pragmatics The study of how knowledge about the world and language conventions interact with literal meaning. Speech acts Research issues: resolution of anaphoric relations, modeling of speech acts in dialogues

Other areas of NLP Linguistics is traditionally divided into phonetics, phonology, morphology, syntax, semantics, and pragmatics. Sociolinguistics: interactions of social organization and language. Historical linguistics: change over time. Linguistic typology Language acquisition Psycholinguistics: real-time production and perception of language

Word classes and part-of-speech tagging

Part of speech tagging Problems: transport, object, discount, address More problems: content French: est, président, fils “Book that flight” – what is the part of speech associated with “book”? POS tagging: assigning parts of speech to words in a text. Three main techniques: rule-based tagging, stochastic tagging, transformation-based tagging

Rule-based POS tagging Use dictionary or FST to find all possible parts of speech Use disambiguation rules (e.g., ART+V) Typically hundreds of constraints can be designed manually

Example in French ^ beginning of sentence La rf b nms u article teneur nfs nms noun feminine singular Moyenne jfs nfs v1s v2s v3s adjective feminine singular en p a b preposition uranium nms noun masculine singular des p r preposition rivi`eres nfp noun feminine plural, x punctuation bien_que cs subordinating conjunction délicate jfs adjective feminine singular À p preposition calculer v verb

Sample rules BS3 BI1: A BS3 (3rd person subject personal pronoun) cannot be followed by a BI1 (1st person indirect personal pronoun). In the example: ``il nous faut'' ({\it we need}) - ``il'' has the tag BS3MS and ``nous'' has the tags [BD1P BI1P BJ1P BR1P BS1P]. The negative constraint ``BS3 BI1'' rules out ``BI1P'', and thus leaves only 4 alternatives for the word ``nous''. N K: The tag N (noun) cannot be followed by a tag K (interrogative pronoun); an example in the test corpus would be: ``... fleuve qui...'' (...river, that...). Since ``qui'' can be tagged both as an ``E'' (relative pronoun) and a ``K'' (interrogative pronoun), the ``E'' will be chosen by the tagger since an interrogative pronoun cannot follow a noun (``N''). R V:A word tagged with R (article) cannot be followed by a word tagged with V (verb): for example ``l' appelle'' (calls him/her). The word ``appelle'' can only be a verb, but ``l''' can be either an article or a personal pronoun. Thus, the rule will eliminate the article tag, giving preference to the pronoun.

Stochastic POS tagging HMM tagger Pick the most likely tag for this word P(word|tag) * P(tag|previous n tags) – find tag sequence that maximizes the probability formula A bigram-based HMM tagger chooses the tag t i for word w i that is most probable given the previous tag t i-1 and the current word w i : t i = argmax j P(t j |t i-1,w i ) t i = argmax j P(t j |t i-1 )P(w i |t j ) : HMM equation for a single tag

Example Secretariat/NNP is/VBZ expected/VBN to/TO race/VB tomorrow/ADV People/NNS continue/VBP to/TO inquire/VB the/DT reason/NN for/IN the/DT race/NN for/IN outer/JJ space/NN P(VB|TO)P(race|VB) P(NN|TO)P(race|NN) TO: to+VB (to sleep), to+NN (to school)

Example (cont’d) P(NN|TO) =.021 P(VB|TO) =.34 P(race|NN) = P(race|VB) = P(VB|TO)P(race|VB) = P(NN|TO)P(race|NN) =

HMM Tagging T = argmax P(T|W), where T=t 1,t 2,…,t n By Bayes’ rule: P(T|W) = P(T)P(W|T)/P(W) Thus we are attempting to choose the sequence of tags that maximizes the rhs of the equation P(W) can be ignored P(T)P(W|T) =  P(w i |w 1 t 1 …w i-1 t i- 1 t i )P(t i |w 1 t 1 …w i - 1 t i-1 )

Transformation-based learning P(NN|race) =.98 P(VB|race) =.02 Change NN to VB when the previous tag is TO Types of rules: –The preceding (following) word is tagged z –The word two before (after) is tagged z –One of the two preceding (following) words is tagged z –One of the three preceding (following) words is tagged z –The preceding word is tagged z and the following word is tagged w

Confusion matrix INJJNNNNPRBVBDVBN IN-.2.7 JJ NN NNP RB VBD VBN Most confusing: NN vs. NNP vs. JJ, VBD vs. VBN vs. JJ

Readings J&M Chapters 1, 2, 3, 8 “What is Computational Linguistics” by Hans Uszkoreit Lecture notes #1

Readings J&M Chapters 3, 8 Lecture notes #2