1 / 64

Ling 570

Ling 570. Day # 3 Stemming, Probabilistic Automata, Markov Chains/Model. Morphology and FSTs. Last Class. FST as Translator. FR: ce bill met de le baume sur une blessure EN: this bill puts balm on a sore wound. FST Application Examples. Case folding: He said  he said

keahi
Télécharger la présentation

Ling 570

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. Ling 570 Day #3 Stemming, Probabilistic Automata, Markov Chains/Model

  2. Morphology and FSTs

  3. Last Class FST as Translator FR: ce bill met de le baume sur une blessure EN: this bill putsbalm on a sore wound

  4. FST Application Examples • Case folding: • He said  he said • Tokenization: • “He ran.”  “ He ran . “ • POS tagging: • They can fish  PRO VERB NOUN

  5. FST Application Examples • Pronunciation: • B AH T EH R  B AH DX EH R • Morphological generation: • Fox s  Foxes • Morphological analysis: • cats  cat s

  6. Roadmap • Motivation: • Representing words • A little (mostly English) Morphology • Stemming

  7. The Lexicon • Goal: Represent all the words in a language • Approach?

  8. The Lexicon • Goal: Represent all the words in a language • Approach? • Enumerate all words?

  9. The Lexicon • Goal: Represent all the words in a language • Approach? • Enumerate all words? • Doable for English • Typical for ASR (Automatic Speech Recognition) • English is morphologically relatively impoverished

  10. The Lexicon • Goal: Represent all the words in a language • Approach? • Enumerate all words? • Doable for English • Typical for ASR (Automatic Speech Recognition) • English is morphologically relatively impoverished • Other languages?

  11. The Lexicon • Goal: Represent all the words in a language • Approach? • Enumerate all words? • Doable for English • Typical for ASR (Automatic Speech Recognition) • English is morphologically relatively impoverished • Other languages? • Wildly impractical • Turkish: 40,000 forms/verb; uygarlas¸tıramadıklarımızdanmıs¸sınızcasına “(behaving) as if you are among those whom we could not civilize”

  12. Morphological Parsing • Goal: Take a surface word form and generate a linguistic structure of component morphemes

  13. Morphological Parsing • Goal: Take a surface word form and generate a linguistic structure of component morphemes • A morpheme is the minimal meaning-bearing unit in a language.

  14. Morphological Parsing • Goal: Take a surface word form and generate a linguistic structure of component morphemes • A morpheme is the minimal meaning-bearing unit in a language. • Stem: the morpheme that forms the central meaning unit in a word • Affix: prefix, suffix, infix, circumfix

  15. Morphological Parsing • Goal: Take a surface word form and generate a linguistic structure of component morphemes • A morpheme is the minimal meaning-bearing unit in a language. • Stem: the morpheme that forms the central meaning unit in a word • Affix: prefix, suffix, infix, circumfix • Prefix: e.g., possible impossible

  16. Morphological Parsing • Goal: Take a surface word form and generate a linguistic structure of component morphemes • A morpheme is the minimal meaning-bearing unit in a language. • Stem: the morpheme that forms the central meaning unit in a word • Affix: prefix, suffix, infix, circumfix • Prefix: e.g., possible impossible • Suffix: e.g., walk walking

  17. Morphological Parsing • Goal: Take a surface word form and generate a linguistic structure of component morphemes • A morpheme is the minimal meaning-bearing unit in a language. • Stem: the morpheme that forms the central meaning unit in a word • Affix: prefix, suffix, infix, circumfix • Prefix: e.g., possible impossible • Suffix: e.g., walk walking • Infix: e.g., hingihumingi (Tagalog)

  18. Morphological Parsing • Goal: Take a surface word form and generate a linguistic structure of component morphemes • A morpheme is the minimal meaning-bearing unit in a language. • Stem: the morpheme that forms the central meaning unit in a word • Affix: prefix, suffix, infix, circumfix • Prefix: e.g., possible impossible • Suffix: e.g., walk walking • Infix: e.g., hingihumingi (Tagalog) • Circumfix: e.g., sagengesagt (German)

  19. Surface Variation & Morphology • Searching (a la Bing) for documents about: • Televised sports

  20. Surface Variation & Morphology • Searching (a la Bing) for documents about: • Televised sports • Many possible surface forms: • Televised, television, televise,.. • Sports, sport, sporting,…

  21. Surface Variation & Morphology • Searching (a la Bing) for documents about: • Televised sports • Many possible surface forms: • Televised, television, televise,.. • Sports, sport, sporting,… • How can we match?

  22. Surface Variation & Morphology • Searching (a la Bing) for documents about: • Televised sports • Many possible surface forms: • Televised, television, televise,.. • Sports, sport, sporting,… • How can we match? • Convert surface forms to common base form • Stemming or morphological analysis

  23. Two Perspectives • Stemming: • writing 

  24. Two Perspectives • Stemming: • writing  write (or writ) • Beijing

  25. Two Perspectives • Stemming: • writing  write (or writ) • Beijing  Beije • Morphological Analysis:

  26. Two Perspectives • Stemming: • writing  write (or writ) • Beijing  Beije • Morphological Analysis: • writing  write+V+prog

  27. Two Perspectives • Stemming: • writing  write (or writ) • Beijing  Beije • Morphological Analysis: • writing  write+V+prog • cats  cat + N + pl • writes  write+V+3rdpers+Sg

  28. Stemming • Simple type of morphological analysis • Supports matching using base form • e.g. Television, televised, televising  televise

  29. Stemming • Simple type of morphological analysis • Supports matching using base form • e.g. Television, televised, televising  televise • Most popular: Porter stemmer

  30. Stemming • Simple type of morphological analysis • Supports matching using base form • e.g. Television, televised, televising  televise • Most popular: Porter stemmer • Task: Given surface form, produce base form • Typically, removes suffixes

  31. Stemming • Simple type of morphological analysis • Supports matching using base form • e.g. Television, televised, televising  televise • Most popular: Porter stemmer • Task: Given surface form, produce base form • Typically, removes suffixes • Model: • Rule cascade • No lexicon!

  32. Stemming • Used in many NLP/IR applications • For building equivalence classes Connect Connected Connecting Connection Connections Porter Stemmer, simple and efficient Website: http://www.tartarus.org/~martin/PorterStemmer On patas: ~/dropbox/12-13/570/porter Same class; suffixes irrelevant

  33. Porter Stemmer • Rule cascade: • Rule form: • (condition) PATT1  PATT2

  34. Porter Stemmer • Rule cascade: • Rule form: • (condition) PATT1  PATT2 • E.g. stem contains vowel, ING -> ε

  35. Porter Stemmer • Rule cascade: • Rule form: • (condition) PATT1  PATT2 • E.g. stem contains vowel, ING -> ε • ATIONAL  ATE

  36. Porter Stemmer • Rule cascade: • Rule form: • (condition) PATT1  PATT2 • E.g. stem contains vowel, ING -> ε • ATIONAL  ATE • Rule partial order: • Step1a: -s • Step1b: -ed, -ing

  37. Porter Stemmer • Rule cascade: • Rule form: • (condition) PATT1  PATT2 • E.g. stem contains vowel, ING -> ε • ATIONAL  ATE • Rule partial order: • Step1a: -s • Step1b: -ed, -ing • Step 2-4: derivational suffixes

  38. Porter Stemmer • Rule cascade: • Rule form: • (condition) PATT1  PATT2 • E.g. stem contains vowel, ING -> ε • ATIONAL  ATE • Rule partial order: • Step1a: -s • Step1b: -ed, -ing • Step 2-4: derivational suffixes • Step 5: cleanup • Pros:

  39. Porter Stemmer • Rule cascade: • Rule form: • (condition) PATT1  PATT2 • E.g. stem contains vowel, ING -> ε • ATIONAL  ATE • Rule partial order: • Step1a: -s • Step1b: -ed, -ing • Step 2-4: derivational suffixes • Step 5: cleanup • Pros: Simple, fast, buildable for a variety of languages • Cons:

  40. Porter Stemmer • Rule cascade: • Rule form: • (condition) PATT1  PATT2 • E.g. stem contains vowel, ING -> ε • ATIONAL  ATE • Rule partial order: • Step1a: -s • Step1b: -ed, -ing • Step 2-4: derivational suffixes • Step 5: cleanup • Pros: Simple, fast, buildable for a variety of languages • Cons: Overaggressive and underaggressive

  41. Stemming & eval

  42. Evaluating Performance • Measures of Stemming Performance rely on similar metrics used in IR: • Precision: measure of the proportion of selected items the system got right • precision = tp / (tp + fp) • # of correct answers / # of answers given • Recall: measure of the proportion of the target items the system selected • recall = tp / (tp + fn) • # of correct answers / # of possible correct answers • Rule of thumb: as precision increases, recall drops, and vice versa • Metrics widely adopted in Stat NLP

  43. Precision and Recall • Take a given stemming task • Suppose there are 100 words that could be stemmed • A stemmer gets 52 of these right (tp) • But it inadvertently stems 10 others (fp) Precision = 52 / (52 + 10) = .84 Recall = 52 / (52 + 48) = .52

  44. Precision and Recall • Take a given stemming task • Suppose there are 100 words that could be stemmed • A stemmer gets 52 of these right (tp) • But it inadvertently stems 10 others (fp) Precision = 52 / (52 + 10) = .84 Recall = 52 / (52 + 48) = .52 Note: easy to get precision of 1.0. Why?

  45. Weighted automata & Markov chains

  46. PFA Definition • A Probabilistic Finite-State Automaton is a 6-tuple: • A set of states Q • An alphabet Σ • A set of transitions: δsubset Q x Σ x Q • Initial state probabilities: Q  R+ • Transition probabilities: δ R+ • Final state probabilities: Q  R+

  47. PFA Recap • Subject to constraints: • Computing sequence probabilities

  48. PFA Example • Example • I(q0)=1 • I(q1)=0 • F(q0)=0 • F(q1)=0.2 • P(q0,a,q1)=1; P(q1,b,q1) =0.8 • P(abn) = I(q0)*P(q0,a,q1)*P(q1,b,q1)n*F(q1) • = 0.8n*0.2

  49. Markov Chain • A Markov Chain is a special case of a PFA in which the sequence uniquely determines which states the automaton will go through. • Markov Chains can not represent inherently ambiguous problems • Can assign probability to unambiguous sequences

More Related