1. Chap. 12 [Probabilistic Parsing]
Chap. 12 [Probabilistic Parsing]
HATTORI
Univ. of Tokyo, CS
April 25, 2014
2. Chap. 12 [Probabilistic Parsing]
1 12.1 Some Concepts
12.1.1 Parsing for disambiguation
12.1.2 Treebanks
12.1.3 Parsing models vs. language models
12.1.4 Lexicalization
12.1.5 Tree Prob and derivision Prob
12.1.6 more than one way to do it
12.1.7 Phrase structure grammars and dependency
grammars
12.1.8 Evaluation
2 12.2 Some Appraches
3. Chap. 12 [Probabilistic Parsing]
12.1 Some Concepts
The practice of parsing is an implementation of chunking
chunking – recognizing higher level units of structre
The overall goal is to produce a system that can place a
probably useful structure over arbitrary sentences, that is,
to build a parser
4. Chap. 12 [Probabilistic Parsing]
12.1 Some Concepts
12.1.1 Parsing for disambiguation
パーザーを考えるとき 次の 3 種類の確率が登場する
この章では特に 3 つ目を説明する
determining the sentence:
パーザーとして ある word lattice (わからない Figure
12.1) 上の言語モデルを用いる場合 (e.g. 音声認識) 文章
を語の列と見て 確率を決定する 最大化する
speedier parsing:
パーザーの探索空間における枝刈りのための確率
choosing between parses:
パーザーは多くの候補の中から尤もらしいものを選択
する
5. Chap. 12 [Probabilistic Parsing]
12.1 Some Concepts
12.1.1 Parsing for disambiguation
Example.
次の例文に対して いくつかのパージング結果が考えられる
The post office will hold out discounts and service
concessions as incentives
6. Chap. 12 [Probabilistic Parsing]
12.1 Some Concepts
12.1.1 Parsing for disambiguation
結果 (a)
((S (NP The post office) (Aux will))
(VP (V hold out)
(NP (NP discounts)
(Conj and)
(NP service concessins))
(PP as incentives)))
結果 (b)
((S (NP The post office) (Aux will))
(VP (VP (V hold out)
(NP discounts))
(Conj and)
(VP (VV service)
(NP concessions)
(PP as incentives))))
7. Chap. 12 [Probabilistic Parsing]
12.1 Some Concepts
12.1.1 Parsing for disambiguation
結果 (d)
((S (NP The post office) (Aux will))
(VP (V hold)
(PP (P out)
(NP (NP discounts)
(Conj and)
(NP service concessions)))
(PP as incentives)))
例えばこれは 明らかな文法ミスで除外できる ((V hold) に
対して 目的語 (句) NP が無い) しかしながら これで除外で
きるのは一部である
8. Chap. 12 [Probabilistic Parsing]
12.1 Some Concepts
12.1.2 Treebanks
Treebank
正しいパージング結果の構文木のコレクションを
treebank という
機械学習をしようとする時に用いる
最も多くの人に使われてるのが Penn Treebank
Penn Treebank のマニュアルは 300 ページある
9. Chap. 12 [Probabilistic Parsing]
12.1 Some Concepts
12.1.2 Treebanks
Example. A Penn Treebank tree
((S (NP-SBI The move)
(VP followed
(NP (NP a round)
(PP of
(NP (NP similar increases)
(PP by
(NP other leaders))
(PP against
(NP Arizona real estate loans)))))
(S-ADV (NP-SBI *)
(VP reflecting
(NP (NP a continuing decline)
(PP-LOC in
(NP that market))))))
.))
単語の子を持たない空のノードは * を子として表現
最後はピリオドで終わる
10. Chap. 12 [Probabilistic Parsing]
12.1 Some Concepts
12.1.3 Parsing models vs. language models
パージングモデルと 言語モデルとの比較を見る
11. Chap. 12 [Probabilistic Parsing]
12.1 Some Concepts
12.1.3 Parsing models vs. language models
Parsing model
パージングとは ある文法 G によって文 s から木 t を作る
こと
パージングモデルとは 次のような確率を与えるものである
P(t|s, G) where
∑
t
P(t|s, G) = 1
これを用いたパーザーとは 次の探索である
t′
= arg max P(t|s, G)
12. Chap. 12 [Probabilistic Parsing]
12.1 Some Concepts
12.1.3 Parsing models vs. language models
Language model
文法 G によって生成され得る全ての木に対して確率 P(t, s) を次のよう
に与える
P(t, s|G) = P(t|G) if yield(t) = s and 0 otherwise
これを与えるのが 言語モデル
Definition of yield (p. 383)
N →∗
wa · · · wb ⇐⇒ yield(N) = wa · · · wb
この時 パーザーは次の探索をすればよい
t′
= arg max P(t|s, G) = arg max P(t, s|G)
18. Chap. 12 [Probabilistic Parsing]
12.1 Some Concepts
12.1.5 Tree Prob and derivision Prob
Tree probability and derivision probability
P(t) =
∑
d is derivision to t
P(d)
大抵の場合は同じ木の導出の順序が違うものを数えている
だけなので順序を固定した導出 canonical derivision d′
to t
(e.g. 最左導出) を定めて
P(t) = P(d′
)
としてよい [Hopcroft and Ullman 1979]
19. Chap. 12 [Probabilistic Parsing]
12.1 Some Concepts
12.1.5 Tree Prob and derivision Prob
導出 d は 書き換えルール ri によって次のように表せて
d = S
r1
−→ α1
r2
−→ α2
r3
−→ · · ·
rm
−→ αm = s
その確率
P(d) =
m∏
i=1
P(ri |r1 . . . ri−1)
20. Chap. 12 [Probabilistic Parsing]
12.1 Some Concepts
12.1.6 more than one way to do it
CFG 以外の手法
HMM
Probabilistic Left-Corner Grammars (PLCGs)
21. Chap. 12 [Probabilistic Parsing]
12.1 Some Concepts
12.1.6 more than one way to do it
Probabilistic left-corner grammars (確率的?
LC文法)
PCFG が top-down なのに対して PLCG は bottom-up と
top-down の組み合わせになってる
22. Chap. 12 [Probabilistic Parsing]
12.1 Some Concepts
12.1.6 more than one way to do it
LC parsing
initial:
input = sentence
stack = [S]
loop:
while possible
do one of actions
acrions are
Shift push into stack popped from input
Attach If aa is on top of stack, remove both
Project If a is on top of stack and A → ab, replace a by bA
temination:
if isEmpty input and isEmpty stack
then exit success
else exit failure
23. Chap. 12 [Probabilistic Parsing]
12.1 Some Concepts
12.1.7 Phrase structure grammars and dependency grammars
Phrase structure grammars and dependency
grammars
矢印は後の依存関係を表現し矢印の先が “head word” で 他
の単語がそれに依存している
27. Chap. 12 [Probabilistic Parsing]
12.2 Some Appraches
PCFG estimation from a tree bank
[Charniak, 1996]
PCFG from Penn Treebank
POS and phrasal categories
no smoothing
Penn Treebank は特に分岐が多いので個々の展開は希少なた
め本来はスムージングするのが普通だけど最尤推定におい
てはそこまで害にならない
Recall Precision
80.4 78.8
28. Chap. 12 [Probabilistic Parsing]
12.2 Some Appraches
Partially unsupervised learning [Pereira and
Schabes, 1992]
Chmosky normal form
15 non-terminal
45 POS as terminal