An efficient probabilistic context-free. Parsing algorithm that computes prefix probabilities презентация

Содержание

Overview What is this paper all about? Key ideas from the title: Context-Free Parsing Probabilistic Computes Prefix Probabilities Efficient

Слайд 1Probabilistic Earley Parsing
Charlie Kehoe, Spring 2004
Based on the 1995 paper by Andreas

Stolcke:
An Efficient Probabilistic Context-Free Parsing Algorithm that Computes Prefix Probabilities

Слайд 2Overview
What is this paper all about?

Key ideas from the title:
Context-Free Parsing
Probabilistic
Computes

Prefix Probabilities
Efficient

Слайд 3Context-Free Parsing
The ball is heavy.

Parser

The ball

is heavy

Слайд 4Context-Free Parsing

Parser


Grammar

The ball is heavy.
The ball

is heavy

Слайд 5Context-Free Parsing

Parser


Grammar


Lexicon

The ball is heavy.
The ball

is heavy

Слайд 6Context-Free Parsing
What if there are multiple legal parses?
Example: “Yair looked over

the paper.”
How does the word “over” function?

Yair looked over the paper

S

NP

VP

V

NP

Yair looked over the paper

S

NP

VP

V

NP

PP

P

N

N

or


Слайд 7Probabilistic Parsing
Use probabilities to find the most likely parse
Store typical probabilities

for words and rules
In this case:

P = 0.99

P = 0.01

Yair looked over the paper

S

NP

VP

V

NP

Yair looked over the paper

S

NP

VP

V

NP

PP

P

N

N

or


Слайд 8Prefix Probabilities
How likely is a partial parse?
Yair looked over …
Yair

looked over …

S

NP

VP

V

NP

S

NP

VP

V

NP

PP

P

N

N

or


Слайд 9Efficiency

The Earley algorithm (upon which Stolcke builds) is one of the

most efficient known parsing algorithms

Probabilities allow intelligent pruning of the developing parse tree(s)

Слайд 10Parsing Algorithms

How do we construct a parse tree?
Work from grammar to

sentence (top-down)
Work from sentence to grammar (bottom-up)
Work from both ends at once (Earley)

Predictably, Earley works best

Слайд 11Earley Parsing Overview
Start with a root constituent, e.g. sentence
Until the sentence

is complete, repeatedly
Predict: expand constituents as specified in the grammar
Scan: match constituents with words in the input
Complete: propagate constituent completions up to their parents
Prediction is top-down, while scanning and completion are bottom-up

Слайд 12Earley Parsing Overview
Earley parsing uses a chart rather than a tree

to develop the parse
Constituents are stored independently, indexed by word positions in the sentence
Why do this?
Eliminate recalculation when tree branches are abandoned and later rebuilt
Concisely represent multiple parses

Слайд 13Earley Parsing Example
S → NP VP NP → ART N VP →

V ADJ

Слайд 14Earley Parsing Example
S → NP VP NP → ART N VP →

V ADJ

Слайд 15Earley Parsing Example
S → NP VP NP → ART N VP →

V ADJ

Слайд 16Earley Parsing Example
S → NP VP NP → ART N VP →

V ADJ

Слайд 17Earley Parsing Example
S → NP VP NP → ART N VP →

V ADJ

Слайд 18Earley Parsing Example
S → NP VP NP → ART N VP →

V ADJ

Слайд 19Earley Parsing Example
S → NP VP NP → ART N VP →

V ADJ

Слайд 20Earley Parsing Example
S → NP VP NP → ART N VP →

V ADJ

Слайд 21Earley Parsing Example
S → NP VP NP → ART N VP →

V ADJ

Слайд 22Probabilistic Parsing

How do we parse probabilistically?
Assign probabilities to grammar rules and

words in lexicon
Grammar and lexicon “randomly” generate all possible sentences in the language
P(parse tree) = P(sentence generation)


Слайд 23Probabilistic Parsing
Terminology
Earley state: each step of the processing that a constituent

undergoes. Examples:
Starting sentence
Half-finished sentence
Complete sentence
Half-finished noun phrase
etc.
Earley path: a sequence of linked states
Example: the complete parse just described

Слайд 24etc.
Probabilistic Parsing
Can represent the parse as a Markov chain:





Markov assumption (state

probability is independent of path) applies, due to CFG


S ►
NP VP
Begin


S
Begin


NP ►
ART N Begin


NP ►
PN Begin


NP Half Done


NP Done


S Half Done

(path abandoned)

Predict S

Predict NP

Scan “the”

Scan “ball”

Complete NP


Слайд 25Probabilistic Parsing
Every Earley path corresponds to a parse tree
P(tree) = P(path)
Assign

a probability to each state transition
Prediction: probability of grammar rule
Scanning: probability of word in lexicon
Completion: accumulated (“inner”) probability of the finished constituent
P(path) = product of P(transition)s

Слайд 26Probabilistic Parse Example
Grammar
Lexicon


Слайд 27Probabilistic Parse Example


Слайд 28Probabilistic Parse Example


Слайд 29Probabilistic Parse Example


Слайд 30Probabilistic Parse Example


Слайд 31Probabilistic Parse Example


Слайд 32Probabilistic Parse Example


Слайд 33Probabilistic Parse Example


Слайд 34Probabilistic Parse Example


Слайд 35Probabilistic Parse Example


Слайд 36Probabilistic Parse Example


Слайд 37Probabilistic Parse Example


Слайд 38Prefix Probabilities

Current algorithm reports parse tree probability when the sentence is

completed

What if we don’t have a full sentence?

Probability is tracked by constituent (“inner”), rather than by path (“forward”)

Слайд 39Prefix Probabilities

Solution: add a separate path probability

Same as before, but propagate

down on prediction step

This is the missing link to chain the path probabilities together

Слайд 40Prefix Probability Example


Слайд 41Prefix Probability Example


Слайд 42Prefix Probability Example


Слайд 43Prefix Probability Example


Слайд 44Prefix Probability Example


Слайд 45Prefix Probability Example


Слайд 46Prefix Probability Example


Слайд 47Prefix Probability Example


Слайд 48Prefix Probability Example


Слайд 49Summary
Use Earley chart parser for efficient parsing, even with ambiguous or

complex sentences
Use probabilities to choose among multiple possible parse trees
Track constituent probability for complete sentences
Also track path probability for incomplete sentences

Обратная связь

Если не удалось найти и скачать презентацию, Вы можете заказать его на нашем сайте. Мы постараемся найти нужный Вам материал и отправим по электронной почте. Не стесняйтесь обращаться к нам, если у вас возникли вопросы или пожелания:

Email: Нажмите что бы посмотреть 

Что такое ThePresentation.ru?

Это сайт презентаций, докладов, проектов, шаблонов в формате PowerPoint. Мы помогаем школьникам, студентам, учителям, преподавателям хранить и обмениваться учебными материалами с другими пользователями.


Для правообладателей

Яндекс.Метрика