Prob obab abil ilit ity y an and d Tim Time: Ma Marko kov - - PowerPoint PPT Presentation

prob obab abil ilit ity y an and d tim time ma marko kov
SMART_READER_LITE
LIVE PREVIEW

Prob obab abil ilit ity y an and d Tim Time: Ma Marko kov - - PowerPoint PPT Presentation

Prob obab abil ilit ity y an and d Tim Time: Ma Marko kov v Mo Mode dels ls Com omputer Science c cpsc sc322, Lecture 3 31 (Te Text xtboo ook k Chpt 6.5.1) June, 2 20, 2 2017 6/21/2017 CPSC322 Summer 2017 Slide 1


slide-1
SLIDE 1

CPSC322 Summer 2017 Slide 1

Prob

  • bab

abil ilit ity y an and d Tim Time: Ma Marko kov v Mo Mode dels ls

Com

  • mputer Science c

cpsc sc322, Lecture 3 31 (Te Text xtboo

  • ok

k Chpt 6.5.1)

June, 2 20, 2 2017

6/21/2017

slide-2
SLIDE 2

CPSC322 Summer 2017 Slide 2

Lectu ture re Ov Overv rvie iew

  • Recap

p

  • Te

Tempo poral l Prob

  • babi

bilistic ic Mo Mode dels ls

  • Start Markov Models
  • Markov Chain
  • Markov Chains in Natural Language

Processing

6/21/2017

slide-3
SLIDE 3

CPSC322 Summer 2017 Slide 3

Bi Big g Pi Pict ctur ure: e: R&R &R sy syst stem ems

Environ

  • nment

Prob

  • blem

Qu Query Planning Dete terministi tic Sto tochas asti tic Se Sear arch Arc Consiste tency Sear arch Sear arch Val alue Ite terat ation Var

  • ar. Eliminat

ation Constr trai aint t Sat atisfac acti tion Logics STRIPS Belief N Nets ts Var ars + Constr trai aints ts Decision Nets ts Mar arkov Pr v Processes Var

  • ar. Eliminat

ation Sta tati tic Se Sequenti tial al Representa tati tion Reas asoning Technique SLS

6/21/2017

slide-4
SLIDE 4

CPSC322 Summer 2017 Slide 4

Answerin ing Query u y unde der Un Uncertai ainty

Sta tati tic B Belief Netw twork

& V Variab able le Elimi mina nation ion Dynamic mic Bayesia ian n Network rk Probab abil ility ity Theory ry Hidden n Markov

  • v Models

Email il spam m filters rs Diagno nosti stic c Sy Systems ms (e.g., ., medici cine ne) Natural al Language age Processin ssing St Student t Tracing ng in tutorin ing g Sy Systems ms Monitori

  • ring

ng (e.g credit t cards) BioInforma rmati tics cs Markov

  • v Chains

6/21/2017

slide-5
SLIDE 5

CPSC322 Summer 2017 Slide 5

Lectu ture re Ov Overv rvie iew

  • Recap

p

  • Te

Tempo poral l Prob

  • babi

bilistic ic Mo Mode dels ls

  • Start Markov Models
  • Markov Chain
  • Markov Chains in Natural Language

Processing

6/21/2017

slide-6
SLIDE 6

Mod

  • dell

llin ing g st stat atic ic Envi viro ronme ments ts

So far we have used Bnets to perform inference in st static environ

  • nments

s

  • For instance, the system keeps collecting evidence to

diagnose the cause of a fault in a system (e.g., a car).

  • The environment (values of the evidence, the true cause)

does not change as I gather new evidence

  • What does change?

The system’s beliefs over possible causes

6/21/2017 CPSC322 Summer 2017 Slide 6

slide-7
SLIDE 7

Mode deli ling Ev Evolv lvin ing E Envir ironments

  • Often we need to make inferences about evolving

environments.

  • Represent the state of the world at each specific point

in time via a series of snapshots, or time sl slices, Tu Tutor

  • ring

g sy syst stem tracing student knowledge and morale

Knows-Subtrac action t-1 Moral ale t-1 Moral ale t Solve veProblem t-1 Solve veProblemt Knows-Subtrac action t

t

6/21/2017 CPSC322 Summer 2017 Slide 7

slide-8
SLIDE 8

CPSC322 Summer 2017 Slide 8

Lectu ture re Ov Overv rvie iew

  • Recap

p

  • Te

Tempo poral l Prob

  • babi

bilistic ic Mo Mode dels ls

  • Start Markov Models
  • Mar

arko kov v Ch Chai ain

  • Markov Chains in Natural Language

Processing

6/21/2017

slide-9
SLIDE 9

CPSC322 Summer 2017 Slide 9

Si Simp mple lest st Pos

  • ssi

sible le DBN BN

  • Thus
  • Intuitively St conveys all of the information about the history

that can affect the future states.

  • “The future is independent of the past given the present.”
  • On

One ran andom va variab able for each time slice: let’s assume St represents the state at time t. with domain {v1 …vn }

  • Eac

ach ran andom va variab able depends only o y on th the previ vious one

6/21/2017

slide-10
SLIDE 10

Simplest Possible DBN (cont’)

  • Stationary process assumption: the mechanism

that regulates how state variables change overtime is st station

  • nary, that is it can be described by a single

transition model

  • P(St|St-1)
  • How many CPTs do we need to specify?
  • B. 4

A.

  • A. 1

C . . 2 D.

  • D. 3

6/21/2017 CPSC322 Summer 2017 Slide 10

slide-11
SLIDE 11

Stat atio ionar ary Ma y Markov Ch v Chai ain ( (SMC MC)

A stationary Markov Chain : for all t >0

  • P (St+1| S0,…,St) = P (St+1|St) and
  • P (St +1|St) is the same

We only need to specify and

  • Simple Model, easy to specify
  • Often the natural model
  • The network can extend indefinitely
  • Var

ariat ations of SMC ar are at at th the c core o

  • f man

any y Nat atural al L Lan anguag age Processing (NLP) ap applicat ations!

6/21/2017 CPSC322 Summer 2017 Slide 1 1

slide-12
SLIDE 12

Stat atio ionar ary Ma y Markov Ch v Chai ain ( (SMC MC)

A stationary Markov Chain : for all t >0

  • P (St+1| S0,…,St) = P (St+1|St) and
  • P (St +1|St) is the same
  • B. P (S0)

A.

  • A. P (St +1 |St) and P (S0)

C . . P (St +1|St) D.

  • D. P (St |St+1 )

So we only need to specify?

6/21/2017 CPSC322 Summer 2017 Slide 12

slide-13
SLIDE 13

Sta Stati tion

  • nar

ary y Mar arko kov-Ch Chai ain: Exa xamp mple le

Probability of initial state

t t q p q p .3 .4 .6 1 a h e .4 1 a h e .3 .4 .6 1

1  t

S

t

S

Domain of variable Si is {t , q, p, a, h, e}

t q .6 .4 p a h e

Stochastic Transition Matrix

P (S0) P (St+1|St)

t t q p q p 1 1 .3 1 a h e a h e 1 1 .2 1

1  t

S

t

S

  • B. Right one only

A. A.Left one only C . . Both D.

  • D. None

Which of these two is a possible STM?

6/21/2017 CPSC322 Summer 2017 Slide 13

slide-14
SLIDE 14

CPSC322 Summer 2017 Slide 14

Sta Stati tion

  • nar

ary y Mar arko kov-Ch Chai ain: Exa xamp mple le

Probability of initial state

t t q p q p .3 .4 .6 1 a h e .4 1 a h e .3 .4 .6 1

1  t

S

t

S

Domain of variable Si is {t , q, p, a, h, e} We only need to specify…

t q .6 .4 p a h e

Stochastic Transition Matrix

P (S0) P (St+1|St)

6/21/2017

slide-15
SLIDE 15

CPSC322 Summer 2017 Slide 15

Mark rkov

  • v-Chai

ain: Infe fere rence

Probability of a sequence of states S0 … ST

) ,..., (

T

S S P  ) , , ( p q t P

Exa xample:

t q .6 .4 p a h e t t q p q p 0 .3 .4 0 .6 1 a h e .4 1 a h e .3 .4 .6 0 1

P (S0) P (St+1|St)

6/21/2017

slide-16
SLIDE 16

CPSC322 Summer 2017 Slide 16

Lectu ture re Ov Overv rvie iew

  • Recap

p

  • Te

Tempo poral l Prob

  • babi

bilistic ic Mo Mode dels ls

  • Marko

kov Mod

  • dels

ls

  • Mar

arko kov v Ch Chai ain

  • Markov Chains in Natural Language

Processing

6/21/2017

slide-17
SLIDE 17

6/21/2017 CPSC322 Summer 2017 17

Ke Key pro roble lems s in in NLP

Assign a probability to a sentence

  • Part-of-speech tagging
  • Word-sense disambiguation,
  • Probabilistic Parsing

Predict the next word

  • Speech recognition
  • Hand-writing recognition
  • Augmentative communication for the disabled

? ) ,.., (

1 n

w w P

Impo possib ible le t to estim imat ate 

? ) ,.., (

1 n

w w P

“Book me a room near UBC”

Summariza zation

  • n, Machine

Translation….....

slide-18
SLIDE 18

6/21/2017 CPSC322 Summer 2017 18

Impo possib ible le t to e estim imat ate!

Assuming 105 words and average sentence contains 10 words …….

Go Google le la languag age re repo posit itory y (22 Sept. 2006)

contained “only”: 95,119,665,584 sentences

? ) ,.., (

1 n

w w P

Mos

  • st se

sentences w s will not

  • t appear or
  • r appear on
  • nly on
  • nce 
slide-19
SLIDE 19

6/21/2017 CPSC322 Summer 2017 19

What at can an w we do?

  • ?

Make a strong simplifying assumption! Sentences are generated by a Markov Chain P(Th The b big g red dog

  • g barks

ks)= P(Th The|<S>) * * ) | ( ) | ( ) ,.., (

1 2 1 1  

  

k k n k n

w w P S w P w w P

slide-20
SLIDE 20

6/21/2017 CPSC322 Summer 2017 20

Est stim imat ates es fo for r Bi Bigr gram ams

    ) ( ) , ( ) ( ) , ( ) ( ) , ( ) | ( big C red big C N big C N red big C big P red big P big red P

words pairs

Silly language repositories with on

  • nly two
  • se

sentences: “<S>The big red dog barks against the big pink dog” “<S>The big pink dog is much smaller”

slide-21
SLIDE 21

Bigrams in practice…

) | (

1  i i w

w P

If you have 105 words in your dictionary will contain this many numbers.. ?? C. . 5 * 105 A. A.2 *105 B.

  • B. 1010

D. D.2 *1010

6/21/2017 CPSC322 Summer 2017 Slide 21

slide-22
SLIDE 22

CPSC322 Summer 2017 Slide 22

Learning Goals for today’s class

Yo You c can an:

  • Specify a Markov Chain and compute the

probability of a sequence of states

  • Justify and apply Markov Chains to compute

the probability of a Natural Language sentence

6/21/2017

slide-23
SLIDE 23

CPSC322 Summer 2017 Slide 23

Mar arko kov v Mod

  • del

els

Markov Chains Hidden Markov Model Markov Decision Processes (MDPs) Simplest Possible Dynamic Bnet We cannot observe directly what we care about Add Actions and Values (Rewards)

6/21/2017

slide-24
SLIDE 24

CPSC322 Summer 2017 Slide 24

Ne Next xt Cl Clas ass

  • Fin

inis ish P Proba babi bili lity y an and d Ti Time: : Hidden Markov Models (HMM) (TextBook 6.5.2)

  • Star

art D Decis isio ion n networks (TextBook chpt 9)

  • As

Assi sign gnment 4 is s available on

  • n Con
  • nnect. Due Su

Sunday, June 2 25th @ @ 11:5 :59 pm. . Late su submiss ssion

  • ns

s will not

  • t be

accepted, a and late days s may not

  • t be use
  • sed. Th

This s is s due t to

  • next

xt week k being e g exa xam week, k, and we w want to

  • be ab

able to

  • release

se the so solution

  • ns

s immediately.

Co Cour urse se Ele leme ment nts

6/21/2017