LING 438/538 Computational Linguistics Sandiway Fong Lecture 14: 10/12.

Slides:



Advertisements
Similar presentations
CS Morphological Parsing CS Parsing Taking a surface input and analyzing its components and underlying structure Morphological parsing:
Advertisements

LING 438/538 Computational Linguistics Sandiway Fong Lecture 17: 10/25.
Computational Morphology. Morphology S.Ananiadou2 Outline What is morphology? –Word structure –Types of morphological operation – Levels of affixation.
C O N T E X T - F R E E LANGUAGES ( use a grammar to describe a language) 1.
LING/C SC/PSYC 438/538 Computational Linguistics Sandiway Fong Lecture 13: 10/9.
1 Morphology September 2009 Lecture #4. 2 What is Morphology? The study of how words are composed of morphemes (the smallest meaning-bearing units of.
Morphological Analysis Chapter 3. Morphology Morpheme = "minimal meaning-bearing unit in a language" Morphology handles the formation of words by using.
1 Morphology September 4, 2012 Lecture #3. 2 What is Morphology? The study of how words are composed of morphemes (the smallest meaning-bearing units.
Finite-State Transducers Shallow Processing Techniques for NLP Ling570 October 10, 2011.
LING 388: Language and Computers Sandiway Fong Lecture 9: 9/27.
LING 388: Language and Computers Sandiway Fong 9/29 Lecture 11.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 16: 10/19.
6/2/2015CPSC503 Winter CPSC 503 Computational Linguistics Lecture 2 Giuseppe Carenini.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 8: 9/29.
Finite-State Automata Shallow Processing Techniques for NLP Ling570 October 5, 2011.
6/10/2015CPSC503 Winter CPSC 503 Computational Linguistics Lecture 3 Giuseppe Carenini.
LING/C SC/PSYC 438/538 Computational Linguistics Sandiway Fong Lecture 12: 10/4.
LING 388: Language and Computers Sandiway Fong Lecture 12: 10/5.
6/12/2015Prof. Hilfinger CS164 Lecture 111 Bottom-Up Parsing Lecture (From slides by G. Necula & R. Bodik)
LING 438/538 Computational Linguistics Sandiway Fong Lecture 10: 9/26.
Computational language: week 9 Finish finite state machines FSA’s for modelling word structure Declarative language models knowledge representation and.
LING 388 Language and Computers Lecture 4 9/11/03 Sandiway FONG.
CSCI 5832 Natural Language Processing Lecture 5 Jim Martin.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 11: 10/3.
1 Morphological analysis LING 570 Fei Xia Week 4: 10/15/07 TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A.
LING 388: Language and Computers Sandiway Fong Lecture 6: 9/13.
LING 388: Language and Computers Sandiway Fong Lecture 11: 10/3.
LING/C SC/PSYC 438/538 Computational Linguistics Sandiway Fong Lecture 16: 10/23.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 12: 10/5.
Morphological analysis
LING 388: Language and Computers Sandiway Fong Lecture 10: 9/26.
LING 388 Language and Computers Lecture 7 9/23/03 Sandiway FONG.
LING/C SC/PSYC 438/538 Computational Linguistics Sandiway Fong Lecture 11: 10/2.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 5: 9/5.
LING/C SC/PSYC 438/538 Computational Linguistics Sandiway Fong Lecture 15: 10/16.
CS5371 Theory of Computation Lecture 8: Automata Theory VI (PDA, PDA = CFG)
Finite State Transducers The machine model we will study for morphological parsing is called the finite state transducer (FST) An FST has two tapes –input.
Introduction to English Morphology Finite State Transducers
Chapter 3. Morphology and Finite-State Transducers From: Chapter 3 of An Introduction to Natural Language Processing, Computational Linguistics, and Speech.
Morphology and Finite-State Transducers. Why this chapter? Hunting for singular or plural of the word ‘woodchunks’ was easy, isn’t it? Lets consider words.
LING 388: Language and Computers Sandiway Fong Lecture 17.
October 2006Advanced Topics in NLP1 CSA3050: NLP Algorithms Finite State Transducers for Morphological Parsing.
Lecture 1, 7/21/2005Natural Language Processing1 CS60057 Speech &Natural Language Processing Autumn 2007 Lecture4 1 August 2007.
Morphological Recognition We take each sub-lexicon of each stem class and we expand each arc (e.g. the reg-noun arc) with all the morphemes that make up.
LING 388: Language and Computers Sandiway Fong Lecture 22: 11/10.
LING 438/538 Computational Linguistics
Finite State Automata and Tries Sambhav Jain IIIT Hyderabad.
10/8/2015CPSC503 Winter CPSC 503 Computational Linguistics Lecture 2 Giuseppe Carenini.
CSE202: Introduction to Formal Languages and Automata Theory Chapter 9 The Turing Machine These class notes are based on material from our textbook, An.
CSC312 Automata Theory Lecture # 2 Languages.
LING/C SC/PSYC 438/538 Lecture 7 9/15 Sandiway Fong.
Finite State Transducers for Morphological Parsing
Morphological Analysis Chapter 3. Morphology Morpheme = "minimal meaning-bearing unit in a language" Morphology handles the formation of words by using.
LING 388: Language and Computers Sandiway Fong 9/27 Lecture 10.
CSA3050: Natural Language Algorithms Finite State Devices.
November 2003CSA4050: Computational Morphology IV 1 CSA405: Advanced Topics in NLP Computational Morphology IV: xfst.
Natural Language Processing Chapter 2 : Morphology.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
FST Morphology Miriam Butt October 2003 Based on Beesley and Karttunen 2003.
CSA4050: Advanced Topics in NLP Computational Morphology II Introduction 2 Level Morphology.
October 2004CSA3050 NLP Algorithms1 CSA3050: Natural Language Algorithms Morphological Parsing.
November 2003Computational Morphology VI1 CSA4050 Advanced Topics in NLP Non-Concatenative Morphology – Reduplication – Interdigitation.
Two Level Morphology Alexander Fraser & Liane Guillou CIS, Ludwig-Maximilians-Universität München Computational Morphology.
CIS, Ludwig-Maximilians-Universität München Computational Morphology
Composition is Our Friend
Chapter 9 TURING MACHINES.
Speech and Language Processing
CSCI 5832 Natural Language Processing
Morphological Parsing
CSCI 5832 Natural Language Processing
Presentation transcript:

LING 438/538 Computational Linguistics Sandiway Fong Lecture 14: 10/12

2 Administrivia Reminder –Homework 3 due tonight

3 Last Time morphology –words are composed of morphemes –morpheme: semantic unit, e.g. -ee in employee –Inflectional: no change in category, e.g. V -ed  V –Derivational: category-changing, e.g. V -able  A Porter Stemmer –normalization procedure –based on (manually determined) ad hoc rules –“measure” of a stem: C(VC) m V –output: “root” (not necessarily a word) words that stem to the same root are considered “variants” –English orthography an illustration of the gap that can occur between computation and linguistic theory

4 Walkers. Standees. © Sandiway Fong sign above travelator at Pittsburgh International Airport

5 Today’s Topic Finite State Transducers (FST) for morphological processing –... also Prolog implementation

6 Recall Finite State Automata (FSA) from lecture 8 –(Q,s,f,Σ,  ) 1.set of states (Q): {s,x,y}must be a finite set 2.start state (s): s 3.end state(s) (f): y 4.alphabet ( Σ ): {a, b} 5.transition function  : signature: character × state → state  (a,s)=x  (a,x)=x  (b,x)=y  (b,y)=y sx y a a b b

7 Modeling English Adjectives using FSA –from section 3.2 of textbook examples –big, bigger, biggest, *unbig –cool, cooler, coolest, coolly –red, redder, reddest, *redly –clear, clearer, clearest, clearly, unclear, unclearly –happy, happier, happiest, happily –unhappy, unhappier, unhappiest, unhappily –real, *realer, *realest, unreal, really fsa (3.4) Initial machine is overly simple need more classes to make finer grain distinctions e.g. *unbig

8 Modeling English Adjectives using FSA divide adjectives into classes examples –adj-root 2 : big, bigger, biggest, *unbig –adj-root 2 : cool, cooler, coolest, coolly –adj-root 2 : red, redder, reddest, *redly –adj-root 1 : clear, clearer, clearest, clearly, unclear, unclearly –adj-root 1 : happy, happier, happiest, happily –adj-root 1 : unhappy, unhappier, unhappiest, unhappily –adj-root 1 : real, *realer, *realest, unreal, really fsa (3.5) However... Examples uncooler Smoking uncool and getting uncooler. google: 22,800 (2006), 10,900 (2005) *realer google: 3,500,000 (2006) 494,000 (2005) *realest google: 795,000 (2006) 415,000 (2005)

9 Modeling English Adjectives using FSA e.g. *unbig google: 11,000 hits (2006) morphology is productive morphemes carry (compositional) meaning can be used for dramatic effect unbig vs. small

10 The Mapping Problem To map between a surface form and the decomposition of a word into its components –e.g. root +  (person/number/gender) and other features using spelling rules Example: (3.11) Notes: ^ marks a morpheme boundary # is the end-of-word marker

11 Stage 1: Lexical  Intermediate Levels example: –f o x +N +PL (lexical) –f o x ^s# (intermediate) lexical level: –uninflected “dictionary” level intermediate level: –replace abstract morphemes by concrete ones key –+N : noun fox can also be a verb, but fox +V cannot combine with +PL –+PL : (abstract) plural morpheme realized in English as s (basic case) –boundary markers ^ and # for use by the spelling rule machine (later)

12 Stage 1: Lexical  Intermediate Levels example: –f o x +N +PL (lexical) –f o x ^s# (intermediate) machine idea –character-by-character correspondences –f  f –o  o –x  x –+N   (  = empty string) –+PL  ^s# use a Finite State Machine with input/output mapping –Finite State Transducer (FST)

13 Stage 1: Lexical  Intermediate Levels Example: –g o o s e +N +PL (lexical) –g e e s e # (intermediate) Example: –g o o s e +N +SG (lexical) –g o o s e # (intermediate) Example: –m o u s e +N +PL (lexical) –m i  c e # (intermediate) Example: –s h e e p +N +PL (lexical) –s h e e p # (intermediate)

14 Stage 1: Lexical  Intermediate Levels 3.11 Notation: input : output f means f:f

15 Extension to Finite State Transducers (FST) [Mealy machine extension to FSA] –(Q,s,f,Σ,  ) 1.set of states (Q): {s,x,y}must be a finite set 2.start state (s): s 3.end state(s) (f): y 4.alphabet ( Σ ): pairs I:O –I = input alphabet, O = output alphabet –ε may be included in I and O 5.transition function (or matrix)  : signature: i/o pair × state → state  (a:b,s)=x  (a:b,x)=x  (b:a,x)=y  (b:ε,y)=y sx y a:b b: ε b:a

16 Finite State Automata (FSA) recall: one possible Prolog encoding strategy –define one predicate for each state taking one argument (the input string) consume input character call next state with remaining input string –query ?- s(L). call start state s

17 Finite State Automata (FSA) –from lecture 9 –define one predicate for each state take one argument (the input string), and consume input character call next state with remaining input string –query ?- s(L). i.e. call start state s –state s: (start state) s([a|L]) :- x(L). –state x: x([a|L]) :- x(L). x([b|L]) :- y(L). –state y: (end state) y([]). y([b|L]) :- y(L). sx y a a b b simple extension to FST: each predicate takes two arguments: input and output

18 Stage 1: Lexical  Intermediate Levels example –s0([f|L1],[f|L2]) :- s1(L1,L2). –s0([c|L1],[c|L2]) :- s3(L1,L2). –s1([o|L1],[o|L2]) :- s2(L1,L2). –s2([x|L1],[x|L2]) :- s5(L1,L2). –s3([a|L1],[a|L2]) :- s4(L1,L2). –s4([t|L1],[t|L2]) :- s5(L1,L2). –s5([‘+N’|L1],L2) :- s6(L1,L2). –s6([‘+PL’|L1],[^,s,#|L2]) :- s7(L1,L2). –s7([],[]).% end state

19 Stage 1: Lexical  Intermediate Levels FST queries –lexical  intermediate ?- s0([f,o,x,’+N’,’+PL’],X). –X = [f, o, x, ^, s, #] –intermediate  lexical ?- s0(X,[f,o,x,^,s,#]). –X = [f, o, x, '+N', '+PL'] –enumerator ?- s0(X,Y). –X = [f, o, x, '+N', '+PL'] –Y = [f, o, x, ^, s, #] ; –X = [c, a, t, '+N', '+PL'] –Y = [c, a, t, ^, s, #] ; No inversion of a transducer T: T -1 switch input and output labels in Prolog, simply change the call

20 Stage 1: Lexical  Intermediate Levels Figure 3.17 (top half): tape view of input/output pairs

21 The Mapping Problem Example: (3.11) (Context-Sensitive) Spelling Rule: (3.5) –   e / { x, s, z } ^ __ s#  rewrites to letter e in left context x^ or s^ or z^ and right context s# i.e. insert e after the ^ when you see x^s# or s^s# or z^s# in particular, we have x^s#  x^es#

22 Stage 2: Intermediate  Surface Levels also can be implemented using a FST important! machine is designed to pass input not matching the rule through unmodified (rather than fail) implements context-sensitive rule q 0 to q 2 : left context q 3 to q 0 : right context

23 Stage 2: Intermediate  Surface Levels Example (3.17)

24 Stage 2: Intermediate  Surface Levels Transition table for FST in 3.14 Note: –other: (catch-all case) means pass any remaining symbol (other than specified explicitly in the state) to the other side unchanged –#: # is never included in other

25 Stage 2: Intermediate  Surface Levels in Prolog (simplified) –with special treatment for “other” –q0([],[]). % final state –q0([^|L1],L2) :- !, q0(L1,L2). –% ^:  –q0([z|L1],[z|L2]) :- !, q1(L1,L2). –% repeat for s,x –q0([#|L1],[#|L2]) :- !, q0(L1,L2). –q0([X|L1],[X|L2]) :- q0(L1,L2). –% other ! is known as the “cut” predicate –it affects how Prolog searches –it means “cut” the search off –Prolog will not try any other compatible rule on backtracking –problematic for generation, e.g. ^:  case

26 Stage 2: Intermediate  Surface Levels in Prolog (simplified) –with special treatment for “other” –q0([],[]). % final state –q0([^|L1],L2) :- !, q0(L1,L2). –% ^:  –q0([z|L1],[z|L2]) :- !, q1(L1,L2). –% repeat for s,x –q0([#|L1],[#|L2]) :- !, q0(L1,L2). –q0([X|L1],[X|L2]) :- q0(L1,L2). –% other ! is known as the “cut” predicate –it affects how Prolog searches –it means “cut” the search off –Prolog will not try any other compatible rule on backtracking –problematic for generation, e.g. ^:  case backtrack points: other choices

27 Stage 2: Intermediate  Surface Levels problem for generation –?- q0(X,[f,o,x,e,s,#]). X = [^|L1] ?- q0(L1,[f,o,x,e,s,#]). L1 = [^|L1’] –?- q0(L1’,[f,o,x,e,s,#]). –infinite loop –Culprit: ^:  case (morpheme boundary deletion) –can keep introducing ^^^^^^^... ad infinitum –requires more than finite state power to correct q0([],[]). % final state q0([^|L1],L2) :- !, q0(L1,L2). % ^:  q0([z|L1],[z|L2]) :- !, q1(L1,L2). % repeat for s,x q0([#|L1],[#|L2]) :- !, q0(L1,L2). q0([X|L1],[X|L2]) :- q0(L1,L2). % other q0([],[]). % final state q0([^|L1],L2) :- !, q0(L1,L2). % ^:  q0([z|L1],[z|L2]) :- !, q1(L1,L2). % repeat for s,x q0([#|L1],[#|L2]) :- !, q0(L1,L2). q0([X|L1],[X|L2]) :- q0(L1,L2). % other

28 Stage 2: Intermediate  Surface Levels Other cases of ^:  do not loop. Could eliminate just the loop case.

29 Stage 2: Intermediate  Surface Levels query (generation) –?- q0(X,[c,a,t,s,#]). X = [c, a, t, s, ^, #] ; q0+ -> q1 -> q2 -> q0 X = [c, a, t, s, #] ; q0+ -> q1 -> q0 No

30 Looking ahead Read Chapter 5: Probabilistic Models of (Pronunciation and) Spelling