49
Artificial Intelligence EDA132 Lecture 14.2: Phrase-Structure Grammars Pierre Nugues Lund University [email protected] http://cs.lth.se/pierre_nugues/ March 3, 2017 Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 1 / 49

Artificial Intelligence EDA132 - Lecture 14.2: Phrase ...fileadmin.cs.lth.se/cs/Education/EDA132/Slides/EDA132_NLP_slides04.… · Lecture14.2: Phrase-StructureGrammars Constituents

  • Upload
    lamthuy

  • View
    223

  • Download
    0

Embed Size (px)

Citation preview

Artificial IntelligenceEDA132

Lecture 14.2: Phrase-Structure Grammars

Pierre Nugues

Lund [email protected]

http://cs.lth.se/pierre_nugues/

March 3, 2017

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 1 / 49

Lecture 14.2: Phrase-Structure Grammars

Applications of Language Processing

Grammar is the focus of natural language processing in the textbook(Russell and Norvig 2010, Chapter 23).Two main (modern) traditions: constituent grammars (Chomsky, mainadvocate) and dependency grammars (Tesnière).Constituent grammars are still dominant for English, although declining.

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 2 / 49

Lecture 14.2: Phrase-Structure Grammars

Constituents

The waiter brought the mealThe waiter brought the meal to the tableThe waiter brought the meal of the day

The waiter brought the meal to the table

The waiter brought the meal of the day

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 3 / 49

Lecture 14.2: Phrase-Structure Grammars

Syntactic Trees

S

VP

PP

NP

Noun

table

Det

the

Prep

to

NP

Noun

meal

Det

the

Verb

brought

NP

Noun

waiter

Det

The

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 4 / 49

Lecture 14.2: Phrase-Structure Grammars

Syntactic Trees

S

VP

NP

PP

NP

Noun

day

Det

the

Prep

of

NP

Noun

meal

Det

the

Verb

brought

NP

Noun

waiter

Det

The

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 5 / 49

Lecture 14.2: Phrase-Structure Grammars

Lexicon (DCG)

noun --> [stench] ; [breeze] ; [glitter] ; [nothing] ;[wumpus] ; [pit] ; [pits] ; [gold] ; [east].

verb --> [is] ; [see] ; [smell] ; [shoot] ; [feel] ;[stinks] ; [go] ; [grab] ; [carry] ; [kill] ; [turn].

adjective --> [right] ; [left] ; [east] ; [south] ; [dead] ;[back] ; [smelly].

adverb --> [here] ; [there] ; [nearby] ; [ahead] ; [right] ;[left] ; [east] ; [south] ; [back].

pronoun --> [me] ; [you] ; [’I’] ; [it]; [she]; [he].pnoun --> [’John’] ; [’Mary’] ; [’Boston’] ; [’UCB’] ;

[’PAJC’].article --> [the] ; [a] ; [an].preposition --> [to] ; [in] ; [on] ; [near].conjunction --> [and] ; [or] ; [but].digit --> [0] ; [1] ; [2] ; [3] ; [4] ; [5] ; [6] ; [7] ;

[8] ; [9].Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 6 / 49

Lecture 14.2: Phrase-Structure Grammars

Grammar Rules (DCG)

s --> np, vp. % I + feel a breezes --> s, conjunction, s.np --> pronoun. %Inp --> pnoun.np --> noun. %pitsnp --> article, noun. %the + wumpusnp --> digit, digit. %3 4np --> np, pp. %the wumpus + to the eastnp --> np, rel_clause. %the wumpus + that is smellyvp --> verb. %stinksvp --> vp, np. %feel + a breezevp --> vp, adjective. %is + smellyvp --> vp, pp. %turn + to the eastvp --> vp, adverb. %go + aheadpp --> preposition, np. %to + the eastrel_clause --> [that], vp. %that + is smellyPierre Nugues Artificial Intelligence EDA132 March 3, 2017 7 / 49

Lecture 14.2: Phrase-Structure Grammars

Parsing and Generation

Parsing tells if a sentence is correct according to the grammar

?-s([the, wumpus, is, dead], []).yes.?- s([the, wumpus, that, stinks, is, in, 2, 2], []).yes.

The parser can generate all the solutions

?- s(L, []).L = [me, is] ;L = [me, see] ;L = [me, smell] ;L = [me, shoot] ;L = [me, feel] ;L = [me, stinks] ;

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 8 / 49

Lecture 14.2: Phrase-Structure Grammars

The Prolog Search

S

VP

NP

Noun

meal

Det

the

Verb

brought

NP

Noun

waiter

Det

The

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 9 / 49

Lecture 14.2: Phrase-Structure Grammars

Ambiguity

S

VP

NP

PP

NP

Noun

table

Det

the

Prep

to

NP

Noun

meal

Det

the

Verb

brought

NP

Noun

waiter

Det

The

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 10 / 49

Lecture 14.2: Phrase-Structure Grammars

Left-Recursive Rules

np --> np, pp.

The sentence:The wumpus in the pit is dead

traps the parser in an infinite recursion.We can use auxiliary symbols to remove left recursion:

npx --> det, noun.np --> npx.np --> npx, pp.

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 11 / 49

Lecture 14.2: Phrase-Structure Grammars

Variables

Overgeneration:

?- s(X, []).X = [me, is] ;X = [me, see] ;X = [me, smell] ;

Solution: Add variables to differentiate between subject and objectpronouns.

s --> np(s), vp.np(Case) --> pronoun(Case).pronoun(s) --> [you] ; [’I’] ; [it]; [she]; [he].pronoun(o) --> [me] ; [you] ; [it].

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 12 / 49

Lecture 14.2: Phrase-Structure Grammars

Probabilistic Context-Free Grammars

P(T ,S) = ∏rule(i)producingT

P(rule(i)).

whereP(lhs→ rhsi |lhs) =

Count(lhs → rhsi )

∑jCount(lhs→ rhsj)

.

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 13 / 49

Lecture 14.2: Phrase-Structure Grammars

An Example of PCFG

Rules P Rules P

s --> np vp 0.8 det --> the 1.0s --> vp 0.2 noun --> waiter 0.4np --> det noun 0.3 noun --> meal 0.3np --> det adj noun 0.2 noun --> day 0.3np --> pronoun 0.3 verb --> bring 0.4np --> np pp 0.2 verb --> slept 0.2vp --> v np 0.6 verb --> brought 0.4vp --> v np pp 0.1 pronoun --> he 1.0vp --> v pp 0.2 prep --> of 0.6vp --> v 0.1 prep --> to 0.4pp --> prep np 1.0 adj --> big 1.0

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 14 / 49

Lecture 14.2: Phrase-Structure Grammars

Parse Trees of Bring the meal of the day

Parse treesT1: vp(verb(bring),

np(np(det(the), noun(meal)),pp(prep(of), np(det(the), noun(day)))))

T2: vp(verb(bring),np(np(det(the), noun(meal))),pp(prep(of), np(det(the), noun(day))))

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 15 / 49

Lecture 14.2: Phrase-Structure Grammars

Computing the Probabilities

P(T1,Bring the meal of the day) =P(vp→ v ,np)×P(v → Bring)×P(np→ np,pp)×P(np→ det,noun)×P(det→ the)×P(noun→meal)×P(pp→ prep,np)×P(prep→ of )×P(np→ det,noun)×P(det→ the)×P(noun→ day) =0.6×0.4×0.2×0.3×1.0×0.3×1.0×0.6×0.3×1.0×0.3 = 0.00023328,

P(T2,Bring the meal of the day) =P(vp→ v ,np,pp)×P(v → Bring)×P(np→ det,noun)×P(det→ the)×P(noun→meal)×P(pp→ prep,np)×P(prep→ of )×P(np→ det,noun)×P(det→ the)×P(noun→ day) =0.1×0.4×0.3×1.0×0.3×1.0×0.6×0.3×1.0×0.3 = 0.0001944.

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 16 / 49

Lecture 14.2: Phrase-Structure Grammars

Computing the Probabilities

VP 0.00023328

NP 0.000972

PP 0.054

NP 0.09

Noun 0.3

day

Det 1.0

the

Prep 0.6

of

NP 0.09

Noun 0.3

meal

Det 1.0

the

Verb 0.4

Bring

VP 0.0001944

PP 0.054

NP 0.09

Noun 0.3

day

Det 1.0

the

Prep 0.6

of

NP 0.09

Noun 0.3

meal

Det 1.0

the

Verb 0.4

Bring

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 17 / 49

Lecture 14.2: Phrase-Structure Grammars

Subcategorization Frames

Valence is a model of verb construction. It can be extended to morespecific patterns as in the Oxford Advanced Learner’s Dictionary (OALD).

Verb Complement structure Exampleslept None (Intransitive) I sleptbring NP The waiter brought the mealbring NP + to + NP The waiter brought the meal to the

patrondepend on + NP It depends on the waiterwait for + NP + to + VP I am waiting for the waiter to bring the

mealkeep VP(ing) He kept workingknow that + S The waiter knows that the patron

loves fish

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 18 / 49

Lecture 14.2: Phrase-Structure Grammars

Semantic Parsing

Converts sentences to first-order logic or predicate-argument structuresExample:

Mr. Schmidt called Bill

to

called(‘Mr. Schmidt’, ‘Bill’).

Assumption: We can compose sentence fragments (phrases) into logicalforms while parsingThis corresponds to the compositionality principle

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 19 / 49

Lecture 14.2: Phrase-Structure Grammars

Semantic Composition

Semantic composition can be viewed as a parse tree annotation

S

VP

NP

Bill

Verb

called

NP

Mr. Schmidt

Sem= called(Mr. Schmidt,Bill)

Sem=Mr. Schmidt Sem= λx .called(x ,Bill)

Sem= λy .λx .called(x ,y) Sem= Bill

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 20 / 49

Lecture 14.2: Phrase-Structure Grammars

Getting the Semantic Structure

Bill rushed rushed(’Bill’).

The verb rushed is represented as a lambda expression: λx .rushed(x)Beta reduction: λx .rushed(x)(Bill) = rushed(Bill)Lambda expressions are represented in Prolog as X^rushed(X).

The patron ordered a meal ordered(patron, meal)ordered a meal X^ordered(X, meal)ordered Y^X^ordered(X, Y)

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 21 / 49

Lecture 14.2: Phrase-Structure Grammars

Getting the Semantic Structure

s(Semantics) --> np(Subject), vp(Subject^Semantics).np(X) --> det, noun(X).vp(Subject^Predicate) --> verb(Subject^Predicate).vp(Subject^Predicate) -->verb(Object^Subject^Predicate), np(Object).noun(waiter) --> [waiter].noun(patron) --> [patron].noun(meal) --> [meal]. det --> [a].det --> [the].

verb(X^rushed(X)) --> [rushed].verb(Y^X^ordered(X, Y)) --> [ordered].verb(Y^X^brought(X, Y)) --> [brought].

?- s(Semantics, [the, patron, ordered, a, meal], []).Semantics = ordered(patron, meal)Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 22 / 49

Lecture 14.2: Phrase-Structure Grammars

Statistical Semantic Parsing: Annotation

1 [<Avenger> His brothers] avenged [<Injured_party> him].2 With this, [<Avenger> El Cid] at once avenged [<Injury> the death of

his son].3 [<Avenger> Hook] tries to avenge [<Injured_party> himself] [<Offender>

on Peter Pan] [<Punishment> by becoming a second and better father].

FrameNet uses three annotation levels: Frame elements, Phrase types(categories), and grammatical functions.GFs are specific to the target’s part-of-speech (i.e. verbs, adjectives,prepositions, and nouns).For the verbs, three GFs: Subject (Ext), Object (Obj), Complement (Dep),and Modifier (Mod), i.e. modifying adverbs ended by –ly or indicatingmanner

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 23 / 49

Lecture 14.2: Phrase-Structure Grammars

Automatic Frame-semantic Analysis (Johansson, 2008)

Given a sentence:I told him a lie

and a target word – tell –, find the semantic arguments.Semantic analysis often uses Propbank instead of Framenet because ofPropbank’s larger annotated corpusIn Propbank, the possible arguments of tell.01 are speaker (Arg0),utterance (Arg1), and hearer (Arg2)Input: a syntax tree

<root> I told him a lieROOT pronoun verb pronoun article noun

root

subject indirect object

object

det

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 24 / 49

Lecture 14.2: Phrase-Structure Grammars

Classification of Semantic Arguments (Johansson, 2008)

Two steps:Find the arguments,Determine the name of each argument

The identification of semantic arguments can be modeled as a statisticalclassification problem.What features are useful for this task? Examples:

Grammatical function: subject, object, . . .Voice: I told a lie / I was told a lieSemantic classes: I told him / the note told himSemantic class usually not available: use word instead

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 25 / 49

Lecture 14.2: Phrase-Structure Grammars

Feature Extraction (Johansson, 2008)

Given a dependency tree:

<root> I told him a lieROOT pronoun verb pronoun article noun

root

subject indirect object

object

det

We select the three dependents of told and we extract features todetermine if it is a semantic argument and its name.

Word Grammatical function Voice ArgumentI Subject Active speaker (Arg0)him Indirect object Active hearer (Arg2)lie Direct object Active utterance (Arg1)

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 26 / 49

Lecture 14.2: Phrase-Structure Grammars

Events

Research on the representation of time, events, and temporal relationsdates back the beginning of logic.It resulted in an impressive number of formulations and models.A possible approach is to reify events: turn them into objects, quantifythem existentially, and connect them using predicates

John saw Mary in London on Tuesday

∃ε[saw(ε,John,Mary)∧place(ε,London)∧ time(ε,Tuesday)],

where ε represents the event.

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 27 / 49

Lecture 14.2: Phrase-Structure Grammars

Temporal Representation of Events (Allen 1983)

# Relations # Inverse relations Graphical representations

1. before(a, b) 2. after(b, a) a b

3. meets(a, b) 4. met_by(b, a) a b

5. overlaps(a, b) 6. overlapped_by(b, a) ab

7. starts(a, b) 8. started_by(b, a) a

b

9. during(b, a) 10. contains(a, b) a

b

11. finishes(b, a) 12. finished_by(a, b) a

b

13. equals(a, b) a

b

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 28 / 49

Lecture 14.2: Phrase-Structure Grammars

Determiners

A caterpillar is eating∃x ,caterpillar(x)∧ eating(x), orexists(X, caterpillar(X), eating(X))Every caterpillar is eating∀x ,caterpillar(x)⇒ eating(x), orall(X, caterpillar(X), eating(X))A caterpillar is eating a hedgehog∃x ,caterpillar(x)∧ (∃y ,hedgehog(y)∧ eating(x ,y)), orexists(X,caterpillar(X),exists(Y, hedgehog(Y), eating(X, Y))Every caterpillar is eating a hedgehog∀x ,caterpillar(x)⇒ (∃y ,hedgehog(y)∧ eating(x ,y)), orall(X, caterpillar(X), exists(Y, hedgehog(Y), eating(X, Y))

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 29 / 49

Lecture 14.2: Phrase-Structure Grammars

General Representation of Determiners

determiner

XSemantics of the nounphrase: SemNP(X...)

Semantics of the rest ofthe sentence: SemRest

Representation:

(X^NP)^(X^Rest)^a(X, NP, Rest)

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 30 / 49

Lecture 14.2: Phrase-Structure Grammars

Compositionality

Some rules to generate the logical form:

noun(X^dog(X)) --> [dog].noun(X^wumpus(X)) --> [wumpus].determiner((X^NP)^exists(X, NP)) --> [a].

np(SemDet) --> determiner((X^NP)^SemDet), noun(X^NP).

?- np(Semantics, [a, wumpus], []).Semantics = exists(_4,wumpus(_4))

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 31 / 49

Lecture 14.2: Phrase-Structure Grammars

Machine Translation

Natural language processing was born with machine translationMassive advance when the US government decided to fund large-scaletranslation programs to have a quick access to documents written inRussianIBM teams pioneered statistical models for machine translation in the early1990sTheir work that used the English (e) and French (f ) parallel versions of theCanadian Hansards is still the standard reference in the field.

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 32 / 49

Lecture 14.2: Phrase-Structure Grammars

Parallel Corpora (Swiss Federal Law)

German French ItalianArt. 35 Milchtransport Art. 35 Transport du

laitArt. 35 Trasporto dellatte

1 Die Milch ist schonendund hygienisch in denVerarbeitungsbetriebzu transportieren. DasTransportfahrzeug iststets sauber zu hal-ten. Zusammen mitder Milch dürfen keineTiere und milchfremdeGegenstände trans-portiert werden, welchedie Qualität der Milchbeeinträchtigen können.

1 Le lait doit être trans-porté jusqu’à l’entreprisede transformation avecménagement et con-formément aux normesd’hygiène. Le véhiculede transport doit êtretoujours propre. Il nedoit transporter avecle lait aucun animal ouobjet susceptible d’enaltérer la qualité.

1 Il latte va trasportatoverso l’azienda di trasfor-mazione in modo accu-rato e igienico. Il veicoloadibito al trasporto vamantenuto pulito. Conil latte non possono es-sere trasportati animalie oggetti estranei, chepotrebbero pregiudicarnela qualità.

2 Wird Milch ausserhalbdes Hofes zum Abtrans-port bereitgestellt, so istsie zu beaufsichtigen.

2 Si le lait destiné àêtre transporté est dé-posé hors de la ferme,il doit être placé soussurveillance.

2 Se viene collocato fuoridall’azienda in vista deltrasporto, il latte deve es-sere sorvegliato.

3 Milchpipelines sindnach den Anweisungendes Herstellers zu reini-gen und zu unterhalten.

3 Les lactoducs desexploitations d’estivagedoivent être nettoyéset entretenus conformé-ment aux instructions dufabricant.

3 I lattodotti vanno pulitie sottoposti a manuten-zione secondo le indi-cazioni del fabbricante.

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 33 / 49

Lecture 14.2: Phrase-Structure Grammars

Alignment (Brown et al. 1993)

Canadian Hansard

And1 the2 program3 has4 been5 implemented6

Le1 programme2 a3 été4 mis5 en6 application7

The1 poor2 don’t3 have4 any5 money6

Les1 pauvres2 sont2 démunis4

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 34 / 49

Lecture 14.2: Phrase-Structure Grammars

Machine Translation Algorithms

A statistical model:

P(f ,d |e) = ∏i

P(fi |ei )P(di ),

where d measures the distortion, how much reassembling is needed fromEnglish to French.Distortion has the form of a right-to-left or left-to-right shift.Steps to build a machine translation system:

Build parallel corporaSegment and align sentencesAlign phrasesExtract distortionsImprove estimates

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 35 / 49

Lecture 14.2: Phrase-Structure Grammars

Speech Recognition

Conditions to take into account:Number of speakersFluency of speech.Size of vocabularySyntaxEnvironment

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 36 / 49

Lecture 14.2: Phrase-Structure Grammars

Structure of Speech Recognition

Words:W = w1,w2, ...,wn.

Acoustic symbols:A= a1,a2, ...,am,

W = argmaxW

P(W |A).

Using Bayes’ formula,

P(W |A) = P(A|W )P(W )

P(A).

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 37 / 49

Lecture 14.2: Phrase-Structure Grammars

Two-Step Recognition

W = argmaxW

P(A|W )P(W ).

Speech

production Acoustic processing

Acoustic and language modeling

Speech $ W A W

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 38 / 49

Lecture 14.2: Phrase-Structure Grammars

Signals

Sampling Digitization

90 140 170 180 170 30 10 40 40 0 90 120 80 0 100 140 100 60 0 70

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 39 / 49

Lecture 14.2: Phrase-Structure Grammars

Fourier Transforms 1.2 Some Basics of Phonetics 3

Table 1.1. Fourier transforms for some functions.Time domain Frequency domain

(Fourier Transforms)Unit constant function: f (x) = 1 Delta function, perfect impulse at 0: (x)

1

Cosine: cos(2 x) Shifted deltas: (x+ )+ (x! )2

!1!

2! 2

Square pulse : wa(x) =

!1 ! 1

2 " x" 12

0 elsewhere sinc(x) =sin( x)

x

1

!

1.2.2 Phonemes

Frequency analysis is a more natural observation tool for speech than time analysis.However, the spectrum of a complete utterance, such as a sentence, is not of interest.Relevant acoustic properties are attached to sound units that show relatively stableproperties over a time interval. A sentence or even a word span are obviously toolarge a unit. This was noticed as early as the end of the 19th century, well beforeautomated spectrum analysis. Phoneticians then invented the concept of phoneme todelimit elementary speech segments.

Phonemes are a finite set of abstract symbols that are used to annotate realsounds: the phones. Inside a same phoneme class, phones show acoustic variationssince speakers never pronounce a phoneme exactly the same way. The allophonesare the members of the phone collection represented by a same phoneme.

Phonemes are not universal but are specific to a language. Two different phonesmay belong to a single phoneme class in one language and to two different classesin another. An English, a French, and a German r correspond obviously to differentsounds. However, most native speakers would recognize them as the same phoneme,an r. They are thus allophones of a same phoneme. On the contrary, leave /li:v/and live /lIv/ are different words in English because pronunciations of /i:/ and /I/are perceived as different phonemes. This is not true in French, and many French

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 40 / 49

Lecture 14.2: Phrase-Structure Grammars

Speech Spectrograms

Amplitude 20 ms

Time

Frequency

FFT

FFT

FFT

Time

20 ms

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 41 / 49

Lecture 14.2: Phrase-Structure Grammars

Speech Signals

The boys I saw yesterday morning

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 42 / 49

Lecture 14.2: Phrase-Structure Grammars

Speech Parameters

Recognition devices derive a set of acoustic parameters from speech frames.Parameters should be related to “natural” features of speech: voiced orunvoiced segments.A simple parameter giving a rough estimate of it: the energy: the darkerthe frame, the higher the energy.

E (Fk) =m+N−1

∑n=m

s2(n).

Linear prediction coefficients:

s(n) = a(1)s(n−1)+a(2)s(n−2)+a(3)s(n−3)+ ...+a(m)s(n−m),

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 43 / 49

Lecture 14.2: Phrase-Structure Grammars

Extraction of Speech Parameters

Features are extracted every 10 ms over a 20 s frame

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 44 / 49

Lecture 14.2: Phrase-Structure Grammars

Automata

essay

assess

1

[e] 3 4

9

2 [s]

[ ] [e] [s] [s]

[e ]

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 45 / 49

Lecture 14.2: Phrase-Structure Grammars

Markov Chains

essay

assess

1

[e] [s] 3 4

5 6 7 8

9

2

0.5

0.5

0.75

0.75

0.25

0.25

0.7 0.65

0.8 0.8 0.7

0.2 0.2

0.35

0.3

0.3 [e ]

[s] [s] [e] [ ]

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 46 / 49

Lecture 14.2: Phrase-Structure Grammars

Hidden-Markov Models

essay

assay

1

3 4

5 6 7

8

2

0.5

0.5

0.75

0.7

0.25

0.7 0.65

0.8 0.8

0.2 0.2

0.35

0.3

0.3

1 0.6 2 0.3 0.1

1 0.0 2 0.0 1.0

1 0.65 2 0.25 0.1

1 0.3 2 0.7 0.0

1 0.0 2 0.0 1.0

1 0.65 2 0.25 0.1

[e] [s]

[s]

[e ]

[e ] [ ]

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 47 / 49

Lecture 14.2: Phrase-Structure Grammars

Solving Problems with Hidden-Markov Models

Given a hidden-Markov model, the main problems to solve are to:Estimate the probability of an observed sequence. It corresponds tothe sum of all the paths producing the observation. It is solved usingthe forward algorithm.Determine the most likely path of an observed sequence. It is adecoding problem. It is solved using the Viterbi algorithm.Determine (learn) the parameters given a set of observations. It isused to build models to recognize speech. It is solved using theforward-backward algorithm.

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 48 / 49

Lecture 14.2: Phrase-Structure Grammars

HMM and Phones

Modeling phones:Simple model

B M E

A more complex model due to Lee

B M E 0.8

0.1 0.1

0.1

0.9

1.0

0.8 0.8 0.7

0.2 0.2 0.3 1

5 6

7

Pierre Nugues Artificial Intelligence EDA132 March 3, 2017 49 / 49