Top Banner
Part-of-Speech Tagging CMSC 723 / LING 723 / INST 725 MARINE CARPUAT [email protected]
68

Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Dec 16, 2018

Download

Documents

truongque
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Part-of-Speech

TaggingCMSC 723 / LING 723 / INST 725

MARINE CARPUAT

[email protected]

Page 2: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Today’s Agenda

• What are parts of speech (POS)?

• What is POS tagging?

• How to POS tag text automatically?

Page 3: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Source: Calvin and Hobbs

Page 4: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Parts of Speech

• “Equivalence class” of linguistic entities

– “Categories” or “types” of words

• Study dates back to the ancient Greeks

– Dionysius Thrax of Alexandria (c. 100 BC)

– 8 parts of speech: noun, verb, pronoun,

preposition, adverb, conjunction, participle,

article

– Remarkably enduring list!

4

Page 5: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

How do we define POS?

• By meaning

– Verbs are actions

– Adjectives are properties

– Nouns are things

• By the syntactic environment

– What occurs nearby?

– What does it act as?

• By what morphological processes affect it

– What affixes does it take?

• Combination of the above

Page 6: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Parts of Speech

• Open class

– Impossible to completely enumerate

– New words continuously being invented, borrowed,

etc.

• Closed class

– Closed, fixed membership

– Reasonably easy to enumerate

– Generally, short function words that “structure”

sentences

Page 7: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Open Class POS

• Four major open classes in English

– Nouns

– Verbs

– Adjectives

– Adverbs

• All languages have nouns and verbs... but

may not have the other two

Page 8: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Nouns

• Open class

– New inventions all the time: muggle, webinar, ...

• Semantics:

– Generally, words for people, places, things

– But not always (bandwidth, energy, ...)

• Syntactic environment:

– Occurring with determiners

– Pluralizable, possessivizable

• Other characteristics:

– Mass vs. count nouns

Page 9: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Verbs

• Open class

– New inventions all the time: google, tweet, ...

• Semantics:

– Generally, denote actions, processes, etc.

• Syntactic environment:

– Intransitive, transitive, ditransitive

– Alternations

• Other characteristics:

– Main vs. auxiliary verbs

– Gerunds (verbs behaving like nouns)

– Participles (verbs behaving like adjectives)

Page 10: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Adjectives and Adverbs

• Adjectives

– Generally modify nouns, e.g., tall girl

• Adverbs

– A semantic and formal potpourri…

– Sometimes modify verbs, e.g., sang beautifully

– Sometimes modify adjectives, e.g., extremely

hot

Page 11: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Closed Class POS

• Prepositions

– In English, occurring before noun phrases

– Specifying some type of relation (spatial,

temporal, …)

– Examples: on the shelf, before noon

• Particles

– Resembles a preposition, but used with a verb

(“phrasal verbs”)

– Examples: find out, turn over, go on

Page 12: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Particle vs. Prepositions

He came by the office in a hurry

He came by his fortune honestly

We ran up the phone bill

We ran up the small hill

He lived down the block

He never lived down the nicknames

(by = preposition)(by = particle)

(up = particle)(up = preposition)

(down = preposition)(down = particle)

Page 13: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

More Closed Class POS

• Determiners

– Establish reference for a noun

– Examples: a, an, the (articles), that, this, many,

such, …

• Pronouns

– Refer to person or entities: he, she, it

– Possessive pronouns: his, her, its

– Wh-pronouns: what, who

Page 14: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Closed Class POS: Conjunctions

• Coordinating conjunctions

– Join two elements of “equal status”

– Examples: cats and dogs, salad or soup

• Subordinating conjunctions

– Join two elements of “unequal status”

– Examples: We’ll leave after you finish eating.

While I was waiting in line, I saw my friend.

– Complementizers are a special case: I think

that you should finish your assignment

Page 15: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Beyond English…ChineseNo verb/adjective distinction!

Riau Indonesian/Malay

No ArticlesNo Tense Marking3rd person pronouns neutral to both gender and numberNo features distinguishing verbs from nouns

漂亮: beautiful/to be beautiful

Ayam (chicken) Makan (eat)

The chicken is eating

The chicken ate

The chicken will eat

The chicken is being eaten

Where the chicken is eating

How the chicken is eating

Somebody is eating the chicken

The chicken that is eating

Page 16: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Today’s Agenda

• What are parts of speech (POS)?

• What is POS tagging?

• How to POS tag text automatically?

Page 17: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

POS Tagging: What’s the task?

• Process of assigning part-of-speech tags to words

• But what tags are we going to assign?

– Coarse grained: noun, verb, adjective, adverb, …

– Fine grained: {proper, common} noun

– Even finer-grained: {proper, common} noun animate

• Important issues to remember

– Choice of tags encodes certain distinctions/non-distinctions

– Tagsets will differ across languages!

• For English, Penn Treebank is the most common tagset

Page 18: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Penn Treebank Tagset: 45 Tags

Page 19: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Penn Treebank Tagset: Choices

• Example:

– The/DT grand/JJ jury/NN commmented/VBD on/IN

a/DT number/NN of/IN other/JJ topics/NNS ./.

• Distinctions and non-distinctions

– Prepositions and subordinating conjunctions are

tagged “IN” (“Although/IN I/PRP..”)

– Except the preposition/complementizer “to” is tagged

“TO”

Page 20: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Why do POS tagging?

• One of the most basic NLP tasks

– Nicely illustrates principles of statistical NLP

• Useful for higher-level analysis

– Needed for syntactic analysis

– Needed for semantic analysis

• Sample applications that require POS tagging

– Machine translation

– Information extraction

– Lots more…

Page 21: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Try your hand at tagging…

• The back door

• On my back

• Win the voters back

• Promised to back the bill

Page 22: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Try your hand at tagging…

• I hope that she wins

• That day was nice

• You can go that far

Page 23: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Why is POS tagging hard?

• Ambiguity!

– Not just a lexical problem

– Ambiguity in English

• 11.5% of word types ambiguous in Brown corpus

• 40% of word tokens ambiguous in Brown corpus

• Annotator disagreement in Penn Treebank: 3.5%

Page 24: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Today’s Agenda

• What are parts of speech (POS)?

• What is POS tagging?

• How to POS tag text automatically?

Page 25: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

POS tagging: how to do it?

• Given Penn Treebank, how would you

build a system that can POS tag new text?

• Baseline: pick most frequent tag for each

word type

– 90% accuracy if train+test sets are drawn from

Penn Treebank

• How can we do better?

Page 26: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Prediction problems

Given x, predict y

Binary Prediction/Classification

MulticlassPrediction/Classification

Structured Prediction

Page 27: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

How can we POS tag

automatically?

• POS tagging as multiclass classification

– What is x? What is y?

– What model and training algorithm can we

use?

– What kind of features can we use?

• POS tagging as sequence labeling

– Models sequences of predictions

Page 28: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Hidden Markov Models

• Common approach to sequence labeling

• A finite state machine with probabilistic

transitions

• Markov Assumption

– next state only depends on the current state

and independent of previous history

Page 29: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Hidden Markov Models (HMM)

for POS tagging

• Probabilistic model for generating sequences

– e.g., word sequences

• Assume

– underlying set of hidden (unobserved) states in which

the model can be (e.g., POS)

– probabilistic transitions between states over time (e.g.,

from POS to POS in order)

– probabilistic generation of (observed) tokens from

states (e.g., words generate for each POS)

Page 30: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

HMM for POS tagging: intuition

Credit: Jordan Boyd Graber

Page 31: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

HMM for POS tagging: intuition

Credit: Jordan Boyd Graber

Page 32: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

HMM: Formal Specification

• Q: a finite set of N states

– Q = {q0, q1, q2, q3, …}

• N N Transition probability matrix A = [aij]

– aij = P(q j|qi), Σ aij = 1 I

• Sequence of observations O = o1, o2, ... oT– Each drawn from a given set of symbols (vocabulary V)

• N |V| Emission probability matrix, B = [bit]

– bit = bi(ot) = P(ot|qi), Σ bit = 1 i

• Start and end states

– An explicit start state q0 or alternatively,

a prior distribution over start states: {π1, π2, π3, …}, Σ πi = 1

– The set of final states: qF

Page 33: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Let’s model the stock market…

1 2 3 4 5 6Day:

↑ ↓ ↔ ↑ ↓ ↔↑: Market is up

↓: Market is down

↔: Market hasn’t changed

BullBearSBear BullSBull: Bull Market

Bear: Bear Market

S: Static Market

Not observable !

Here’s what you actually observe:

Credit: Jimmy Lin

Page 34: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Stock Market HMMStates? ✓

Transitions?

Vocabulary?

Emissions?

Priors?

Page 35: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Stock Market HMMStates? ✓

Transitions? ✓

Vocabulary?

Emissions?

Priors?

Page 36: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Stock Market HMMStates? ✓

Transitions? ✓

Vocabulary? ✓

Emissions?

Priors?

Page 37: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Stock Market HMMStates? ✓

Transitions? ✓

Vocabulary? ✓

Emissions?

Priors?

Page 38: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Stock Market HMM

π1=0.5 π2=0.2π3=0.3

States? ✓

Transitions? ✓

Vocabulary? ✓

Emissions?

Priors?

Page 39: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Properties of HMMs

• The (first-order) Markov assumption holds

• The probability of an output symbol depends

only on the state generating it

• The number of states (N) does not have to equal

the number of observations (T)

Page 40: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

HMMs: Three Problems

• Likelihood: Given an HMM λ = (A, B, ∏), and a

sequence of observed events O, find P(O|λ)

• Decoding: Given an HMM λ = (A, B, ∏), and an

observation sequence O, find the most likely

(hidden) state sequence

• Learning: Given a set of observation sequences

and the set of states Q in λ, compute the

parameters A and B

Page 41: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

HMM Problem #1: Likelihood

Page 42: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Computing Likelihood

1 2 3 4 5 6t:

↑ ↓ ↔ ↑ ↓ ↔O:

λstock

Assuming λstock models the stock market, how likely are we to observe the sequence of outputs?

π1=0.5 π2=0.2 π3=0.3

Page 43: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Computing Likelihood

• First try:

– Sum over all possible ways in which we could

generate O from λ

– What’s the problem?

• Right idea, wrong algorithm!

Takes O(NT) time to compute!

Page 44: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Computing Likelihood

• What are we doing wrong?

– State sequences may have a lot of overlap…

– We’re recomputing the shared subsequences every

time

– Let’s store intermediate results and reuse them!

– Can we do this?

• Sounds like a job for dynamic programming!

Page 45: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Forward Algorithm

• Use an N T trellis or chart [αtj]

• Forward probabilities: αtj or αt(j)

– = P(being in state j after seeing t observations)

– = P(o1, o2, ... ot, qt=j)

• Each cell = ∑ extensions of all paths from other cells

αt(j) = ∑iαt-1(i) aij bj(ot)

– αt-1(i): forward path probability until (t-1)

– aij: transition probability of going from state i to j

– bj(ot): probability of emitting symbol ot in state j

• P(O|λ) = ∑i αT(i)

Page 46: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Forward Algorithm: Formal

Definition• Initialization

• Recursion

• Termination

Page 47: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Forward Algorithm

↑ ↓ ↑O =

find P(O|λstock)

Page 48: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Forward Algorithm

time

↑ ↓ ↑t=1 t=2 t=3

Bear

Bull

Static

stat

es

Page 49: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Forward Algorithm: Initialization

α1(Bull)

α1(Bear)

α1(Static)

time

↑ ↓ ↑t=1 t=2 t=3

0.20.7=0.14

0.50.1=0.05

0.30.3=0.09

Bear

Bull

Static

stat

es

Page 50: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Forward Algorithm: Recursion

0.140.60.1=0.0084

α1(Bull)aBullBullbBull(↓)

.... and so on

time

↑ ↓ ↑t=1 t=2 t=3

0.20.7=0.14

0.50.1=0.05

0.30.3=0.09

0.0145

Bear

Bull

Static

stat

es

Page 51: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Forward Algorithm: Recursion

time

↑ ↓ ↑t=1 t=2 t=3

0.20.7=0.14

0.50.1=0.05

0.30.3=0.09

0.0145

?

?

?

?

?

Bear

Bull

Static

stat

es

Work through the rest of these numbers…

What’s the asymptotic complexity of this algorithm?

Page 52: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

HMM Problem #2: Decoding

Page 53: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Decoding

Given λstock as our model and O as our observations, what are the most likely states the market went through to produce O?

1 2 3 4 5 6t:

↑ ↓ ↔ ↑ ↓ ↔O:

λstock

π1=0.5 π2=0.2 π3=0.3

Page 54: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Decoding

• “Decoding” because states are hidden

• First try:

– Compute P(O) for all possible state sequences,

then choose sequence with highest probability

– What’s the problem here?

Page 55: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Viterbi Algorithm

• “Decoding” = computing most likely state

sequence

– Another dynamic programming algorithm

– Efficient: polynomial vs. exponential (brute force)

• Same idea as the forward algorithm

– Store intermediate computation results in a trellis

– Build new cells from existing cells

Page 56: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Viterbi Algorithm

• Use an N T trellis [vtj]

– Just like in forward algorithm

• vtj or vt(j)

– = P(in state j after seeing t observations and passing through the

most likely state sequence so far)

– = P(q1, q2, ... qt-1, qt=j, o1, o2, ... ot)

• Each cell = extension of most likely path from other cells

vt(j) = maxi vt-1(i) aij bj(ot)

– vt-1(i): Viterbi probability until (t-1)

– aij: transition probability of going from state i to j

– bj(ot) : probability of emitting symbol ot in state j

• P = maxi vT(i)

Page 57: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Viterbi vs. Forward

• Maximization instead of summation over previous paths

• This algorithm is still missing something!

– In forward algorithm, we only care about the probabilities

– What’s different here?

• We need to store the most likely path (transition):

– Use “backpointers” to keep track of most likely transition

– At the end, follow the chain of backpointers to recover the most

likely state sequence

Page 58: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Viterbi Algorithm: Formal Definition

• Initialization

• Recursion

• Termination

Page 59: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Viterbi Algorithm

↑ ↓ ↑O =

find most likely state sequence given λstock

Page 60: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Viterbi Algorithm

time

↑ ↓ ↑t=1 t=2 t=3

Bear

Bull

Static

stat

es

Page 61: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Viterbi Algorithm: Initialization

α1(Bull)

α1(Bear)

α1(Static)

time

↑ ↓ ↑t=1 t=2 t=3

0.20.7=0.14

0.50.1=0.05

0.30.3=0.09

Bear

Bull

Static

stat

es

Page 62: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Viterbi Algorithm: Recursion

0.140.60.1=0.0084

Max

α1(Bull)aBullBullbBull(↓)

time

↑ ↓ ↑t=1 t=2 t=3

0.20.7=0.14

0.50.1=0.05

0.30.3=0.09

0.0084

Bear

Bull

Static

stat

es

Page 63: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Viterbi Algorithm: Recursion

.... and so on

time

↑ ↓ ↑t=1 t=2 t=3

0.20.7=0.14

0.50.1=0.05

0.30.3=0.09

0.0084

Bear

Bull

Static

stat

es

store backpointer

Page 64: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Viterbi Algorithm: Recursion

time

↑ ↓ ↑t=1 t=2 t=3

Bear

Bull

Static

stat

es

0.20.7=0.14

0.50.1=0.05

0.30.3=0.09

0.0084

?

?

?

?

?

Work through the rest of the algorithm…

Page 65: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

POS Tagging with HMMs

Page 66: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Modeling the problem

• What’s the problem?

– The/DT grand/JJ jury/NN commmented/VBD on/IN a/DT

number/NN of/IN other/JJ topics/NNS ./.

• What should the HMM look like ?

– States: part-of-speech tags (t1, t2, ..., tN)

– Output symbols: words (w1, w2, ..., w|V|)

Page 67: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

HMMs: Three Problems

• Likelihood: Given an HMM λ = (A, B, ∏), and a

sequence of observed events O, find P(O|λ)

• Decoding: Given an HMM λ = (A, B, ∏), and an

observation sequence O, find the most likely

(hidden) state sequence

• Learning: Given a set of observation sequences

and the set of states Q in λ, compute the

parameters A and B

Page 68: Do SMT systems translate documents consistently? Part 2 ... · –Adjectives are properties –Nouns are things • By the syntactic environment ... –Possessive pronouns: his, her,

Today’s Agenda

• What are parts of speech (POS)?

• What is POS tagging?

• How to POS tag text automatically?

– Sequence labeling problem

– Decoding with Hidden Markov Models