SlideShare a Scribd company logo
1 of 30
Download to read offline
Chap. 12 [Probabilistic Parsing]
Chap. 12 [Probabilistic Parsing]
HATTORI
Univ. of Tokyo, CS
April 25, 2014
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
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
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:
パーザーは多くの候補の中から尤もらしいものを選択
する
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
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))))
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 が無い) しかしながら これで除外で
きるのは一部である
Chap. 12 [Probabilistic Parsing]
12.1 Some Concepts
12.1.2 Treebanks
Treebank
正しいパージング結果の構文木のコレクションを
treebank という
機械学習をしようとする時に用いる
最も多くの人に使われてるのが Penn Treebank
Penn Treebank のマニュアルは 300 ページある
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))))))
.))
単語の子を持たない空のノードは * を子として表現
最後はピリオドで終わる
Chap. 12 [Probabilistic Parsing]
12.1 Some Concepts
12.1.3 Parsing models vs. language models
パージングモデルと 言語モデルとの比較を見る
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)
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)
Chap. 12 [Probabilistic Parsing]
12.1 Some Concepts
12.1.4 Lexicalization
Lexicalization
PCFG の弱点は確率の独立性の仮定
Chap. 12 [Probabilistic Parsing]
12.1 Some Concepts
12.1.4 Lexicalization
Lexicalization
PCFG の弱点は確率の独立性の仮定
例えば VP を考えると 行き先の V がどの単語であって
も展開先の確率は同じ
二重目的語 (ditransitive) である tell の後ろには 2 つ 名
詞句が並ぶのが自然
VP → V N N の確率が一番高そう
Table 12.2 は V によってこれだけ確率が違うよ を示す
(come なら 三割で VP → V PP だけど want ならそれ
の確率はほぼ 0)
Chap. 12 [Probabilistic Parsing]
12.1 Some Concepts
12.1.4 Lexicalization
Lexicalization
PCFG の弱点は確率の独立性の仮定
例えば VP を考えると 行き先の V がどの単語であって
も展開先の確率は同じ
二重目的語 (ditransitive) である tell の後ろには 2 つ 名
詞句が並ぶのが自然
VP → V N N の確率が一番高そう
Table 12.2 は V によってこれだけ確率が違うよ を示す
(come なら 三割で VP → V PP だけど want ならそれ
の確率はほぼ 0)
そこで PCFG の 語彙化 (lexicalization) を行う
Chap. 12 [Probabilistic Parsing]
12.1 Some Concepts
12.1.4 Lexicalization
the most straightforward and common
lexicalize
次のような木の
(PP (P into)
(NP (DT the)
(NN store)))
各ノードに “head word” を付与する
(PP-into (P-into into)
(NP-store (DT-the the)
(NN-store store)))
必ずしも充分ではない
Chap. 12 [Probabilistic Parsing]
12.1 Some Concepts
12.1.4 Lexicalization
Probabilities on structural context
PCFGs は context-freeness を仮定しているが 実際にはこれは
誤り例えば Table 12.3 (p. 420) は NP が主語にあたるか目
的語にあたるかでの確率の違いを示す
Expansion as Sub as Obj
NP → PRP 14.7 % 2.1 %
NP → NNP 3.5 % 0.9 %
NP → NP PP 5.6 % 14.1 %
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]
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)
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)
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 の組み合わせになってる
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
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” で 他
の単語がそれに依存している
Chap. 12 [Probabilistic Parsing]
12.1 Some Concepts
12.1.7 Phrase structure grammars and dependency grammars
compound noun
“phrase structure model” という合成語の依存関係は
の 2 つが考えられて木にすると次のように
実は lexicalized PCFG の下では P(Nx
) = P(Nv
) が成り立ち結局
P(Ny
) <> P(Nu
) によって 2 つの木の確率を比べることになる
更にこれは phrase → structure と phrase → model の 2 つの
依存関係の比較に等しい
Chap. 12 [Probabilistic Parsing]
12.1 Some Concepts
12.1.8 Evaluation
Evaluation
parser の性能評価に PARSEVAL measure を用いる
括弧の正解を見る (ただし根は除く
Chap. 12 [Probabilistic Parsing]
12.2 Some Appraches
以上の知識を実際に適用した例
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
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
Chap. 12 [Probabilistic Parsing]
12.2 Some Appraches
[Collins, 1996]
Recall Precision
88.1 88.6
Chap. 12 [Probabilistic Parsing]
12.2 Some Appraches

More Related Content

Viewers also liked

ICML2016読み会 概要紹介
ICML2016読み会 概要紹介ICML2016読み会 概要紹介
ICML2016読み会 概要紹介Kohei Hayashi
 
Icml読み会 deep speech2
Icml読み会 deep speech2Icml読み会 deep speech2
Icml読み会 deep speech2Jiro Nishitoba
 
Meta-Learning with Memory Augmented Neural Network
Meta-Learning with Memory Augmented Neural NetworkMeta-Learning with Memory Augmented Neural Network
Meta-Learning with Memory Augmented Neural NetworkYusuke Watanabe
 
ベイジアンネットとレコメンデーション -第5回データマイニング+WEB勉強会@東京
ベイジアンネットとレコメンデーション -第5回データマイニング+WEB勉強会@東京ベイジアンネットとレコメンデーション -第5回データマイニング+WEB勉強会@東京
ベイジアンネットとレコメンデーション -第5回データマイニング+WEB勉強会@東京Koichi Hamada
 
Dropout Distillation
Dropout DistillationDropout Distillation
Dropout DistillationShotaro Sano
 
Matching networks for one shot learning
Matching networks for one shot learningMatching networks for one shot learning
Matching networks for one shot learningKazuki Fujikawa
 
Zero shot learning through cross-modal transfer
Zero shot learning through cross-modal transferZero shot learning through cross-modal transfer
Zero shot learning through cross-modal transferRoelof Pieters
 
NIPS2013読み会 DeViSE: A Deep Visual-Semantic Embedding Model
NIPS2013読み会 DeViSE: A Deep Visual-Semantic Embedding ModelNIPS2013読み会 DeViSE: A Deep Visual-Semantic Embedding Model
NIPS2013読み会 DeViSE: A Deep Visual-Semantic Embedding ModelSeiya Tokui
 
Learning Convolutional Neural Networks for Graphs
Learning Convolutional Neural Networks for GraphsLearning Convolutional Neural Networks for Graphs
Learning Convolutional Neural Networks for GraphsTakuya Akiba
 
Learning stochastic neural networks with Chainer
Learning stochastic neural networks with ChainerLearning stochastic neural networks with Chainer
Learning stochastic neural networks with ChainerSeiya Tokui
 
論文紹介 Pixel Recurrent Neural Networks
論文紹介 Pixel Recurrent Neural Networks論文紹介 Pixel Recurrent Neural Networks
論文紹介 Pixel Recurrent Neural NetworksSeiya Tokui
 
Estimating structured vector autoregressive models
Estimating structured vector autoregressive modelsEstimating structured vector autoregressive models
Estimating structured vector autoregressive modelsAkira Tanimoto
 
Chainer v2 alpha
Chainer v2 alphaChainer v2 alpha
Chainer v2 alphaSeiya Tokui
 
グラフィカルモデル入門
グラフィカルモデル入門グラフィカルモデル入門
グラフィカルモデル入門Kawamoto_Kazuhiko
 
勾配降下法の 最適化アルゴリズム
勾配降下法の最適化アルゴリズム勾配降下法の最適化アルゴリズム
勾配降下法の 最適化アルゴリズムnishio
 
色彩センスのいらない配色講座
色彩センスのいらない配色講座色彩センスのいらない配色講座
色彩センスのいらない配色講座Mariko Yamaguchi
 
見やすいプレゼン資料の作り方 - リニューアル増量版
見やすいプレゼン資料の作り方 - リニューアル増量版見やすいプレゼン資料の作り方 - リニューアル増量版
見やすいプレゼン資料の作り方 - リニューアル増量版MOCKS | Yuta Morishige
 

Viewers also liked (17)

ICML2016読み会 概要紹介
ICML2016読み会 概要紹介ICML2016読み会 概要紹介
ICML2016読み会 概要紹介
 
Icml読み会 deep speech2
Icml読み会 deep speech2Icml読み会 deep speech2
Icml読み会 deep speech2
 
Meta-Learning with Memory Augmented Neural Network
Meta-Learning with Memory Augmented Neural NetworkMeta-Learning with Memory Augmented Neural Network
Meta-Learning with Memory Augmented Neural Network
 
ベイジアンネットとレコメンデーション -第5回データマイニング+WEB勉強会@東京
ベイジアンネットとレコメンデーション -第5回データマイニング+WEB勉強会@東京ベイジアンネットとレコメンデーション -第5回データマイニング+WEB勉強会@東京
ベイジアンネットとレコメンデーション -第5回データマイニング+WEB勉強会@東京
 
Dropout Distillation
Dropout DistillationDropout Distillation
Dropout Distillation
 
Matching networks for one shot learning
Matching networks for one shot learningMatching networks for one shot learning
Matching networks for one shot learning
 
Zero shot learning through cross-modal transfer
Zero shot learning through cross-modal transferZero shot learning through cross-modal transfer
Zero shot learning through cross-modal transfer
 
NIPS2013読み会 DeViSE: A Deep Visual-Semantic Embedding Model
NIPS2013読み会 DeViSE: A Deep Visual-Semantic Embedding ModelNIPS2013読み会 DeViSE: A Deep Visual-Semantic Embedding Model
NIPS2013読み会 DeViSE: A Deep Visual-Semantic Embedding Model
 
Learning Convolutional Neural Networks for Graphs
Learning Convolutional Neural Networks for GraphsLearning Convolutional Neural Networks for Graphs
Learning Convolutional Neural Networks for Graphs
 
Learning stochastic neural networks with Chainer
Learning stochastic neural networks with ChainerLearning stochastic neural networks with Chainer
Learning stochastic neural networks with Chainer
 
論文紹介 Pixel Recurrent Neural Networks
論文紹介 Pixel Recurrent Neural Networks論文紹介 Pixel Recurrent Neural Networks
論文紹介 Pixel Recurrent Neural Networks
 
Estimating structured vector autoregressive models
Estimating structured vector autoregressive modelsEstimating structured vector autoregressive models
Estimating structured vector autoregressive models
 
Chainer v2 alpha
Chainer v2 alphaChainer v2 alpha
Chainer v2 alpha
 
グラフィカルモデル入門
グラフィカルモデル入門グラフィカルモデル入門
グラフィカルモデル入門
 
勾配降下法の 最適化アルゴリズム
勾配降下法の最適化アルゴリズム勾配降下法の最適化アルゴリズム
勾配降下法の 最適化アルゴリズム
 
色彩センスのいらない配色講座
色彩センスのいらない配色講座色彩センスのいらない配色講座
色彩センスのいらない配色講座
 
見やすいプレゼン資料の作り方 - リニューアル増量版
見やすいプレゼン資料の作り方 - リニューアル増量版見やすいプレゼン資料の作り方 - リニューアル増量版
見やすいプレゼン資料の作り方 - リニューアル増量版
 

Recently uploaded

業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)
業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)
業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)Hiroshi Tomioka
 
自分史上一番早い2024振り返り〜コロナ後、仕事は通常ペースに戻ったか〜 by IoT fullstack engineer
自分史上一番早い2024振り返り〜コロナ後、仕事は通常ペースに戻ったか〜 by IoT fullstack engineer自分史上一番早い2024振り返り〜コロナ後、仕事は通常ペースに戻ったか〜 by IoT fullstack engineer
自分史上一番早い2024振り返り〜コロナ後、仕事は通常ペースに戻ったか〜 by IoT fullstack engineerYuki Kikuchi
 
AWS の OpenShift サービス (ROSA) を使った OpenShift Virtualizationの始め方.pdf
AWS の OpenShift サービス (ROSA) を使った OpenShift Virtualizationの始め方.pdfAWS の OpenShift サービス (ROSA) を使った OpenShift Virtualizationの始め方.pdf
AWS の OpenShift サービス (ROSA) を使った OpenShift Virtualizationの始め方.pdfFumieNakayama
 
クラウドネイティブなサーバー仮想化基盤 - OpenShift Virtualization.pdf
クラウドネイティブなサーバー仮想化基盤 - OpenShift Virtualization.pdfクラウドネイティブなサーバー仮想化基盤 - OpenShift Virtualization.pdf
クラウドネイティブなサーバー仮想化基盤 - OpenShift Virtualization.pdfFumieNakayama
 
TataPixel: 畳の異方性を利用した切り替え可能なディスプレイの提案
TataPixel: 畳の異方性を利用した切り替え可能なディスプレイの提案TataPixel: 畳の異方性を利用した切り替え可能なディスプレイの提案
TataPixel: 畳の異方性を利用した切り替え可能なディスプレイの提案sugiuralab
 
デジタル・フォレンジックの最新動向(2024年4月27日情洛会総会特別講演スライド)
デジタル・フォレンジックの最新動向(2024年4月27日情洛会総会特別講演スライド)デジタル・フォレンジックの最新動向(2024年4月27日情洛会総会特別講演スライド)
デジタル・フォレンジックの最新動向(2024年4月27日情洛会総会特別講演スライド)UEHARA, Tetsutaro
 
CTO, VPoE, テックリードなどリーダーポジションに登用したくなるのはどんな人材か?
CTO, VPoE, テックリードなどリーダーポジションに登用したくなるのはどんな人材か?CTO, VPoE, テックリードなどリーダーポジションに登用したくなるのはどんな人材か?
CTO, VPoE, テックリードなどリーダーポジションに登用したくなるのはどんな人材か?akihisamiyanaga1
 
モーダル間の変換後の一致性とジャンル表を用いた解釈可能性の考察 ~Text-to-MusicとText-To-ImageかつImage-to-Music...
モーダル間の変換後の一致性とジャンル表を用いた解釈可能性の考察  ~Text-to-MusicとText-To-ImageかつImage-to-Music...モーダル間の変換後の一致性とジャンル表を用いた解釈可能性の考察  ~Text-to-MusicとText-To-ImageかつImage-to-Music...
モーダル間の変換後の一致性とジャンル表を用いた解釈可能性の考察 ~Text-to-MusicとText-To-ImageかつImage-to-Music...博三 太田
 
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)NTT DATA Technology & Innovation
 

Recently uploaded (9)

業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)
業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)
業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)
 
自分史上一番早い2024振り返り〜コロナ後、仕事は通常ペースに戻ったか〜 by IoT fullstack engineer
自分史上一番早い2024振り返り〜コロナ後、仕事は通常ペースに戻ったか〜 by IoT fullstack engineer自分史上一番早い2024振り返り〜コロナ後、仕事は通常ペースに戻ったか〜 by IoT fullstack engineer
自分史上一番早い2024振り返り〜コロナ後、仕事は通常ペースに戻ったか〜 by IoT fullstack engineer
 
AWS の OpenShift サービス (ROSA) を使った OpenShift Virtualizationの始め方.pdf
AWS の OpenShift サービス (ROSA) を使った OpenShift Virtualizationの始め方.pdfAWS の OpenShift サービス (ROSA) を使った OpenShift Virtualizationの始め方.pdf
AWS の OpenShift サービス (ROSA) を使った OpenShift Virtualizationの始め方.pdf
 
クラウドネイティブなサーバー仮想化基盤 - OpenShift Virtualization.pdf
クラウドネイティブなサーバー仮想化基盤 - OpenShift Virtualization.pdfクラウドネイティブなサーバー仮想化基盤 - OpenShift Virtualization.pdf
クラウドネイティブなサーバー仮想化基盤 - OpenShift Virtualization.pdf
 
TataPixel: 畳の異方性を利用した切り替え可能なディスプレイの提案
TataPixel: 畳の異方性を利用した切り替え可能なディスプレイの提案TataPixel: 畳の異方性を利用した切り替え可能なディスプレイの提案
TataPixel: 畳の異方性を利用した切り替え可能なディスプレイの提案
 
デジタル・フォレンジックの最新動向(2024年4月27日情洛会総会特別講演スライド)
デジタル・フォレンジックの最新動向(2024年4月27日情洛会総会特別講演スライド)デジタル・フォレンジックの最新動向(2024年4月27日情洛会総会特別講演スライド)
デジタル・フォレンジックの最新動向(2024年4月27日情洛会総会特別講演スライド)
 
CTO, VPoE, テックリードなどリーダーポジションに登用したくなるのはどんな人材か?
CTO, VPoE, テックリードなどリーダーポジションに登用したくなるのはどんな人材か?CTO, VPoE, テックリードなどリーダーポジションに登用したくなるのはどんな人材か?
CTO, VPoE, テックリードなどリーダーポジションに登用したくなるのはどんな人材か?
 
モーダル間の変換後の一致性とジャンル表を用いた解釈可能性の考察 ~Text-to-MusicとText-To-ImageかつImage-to-Music...
モーダル間の変換後の一致性とジャンル表を用いた解釈可能性の考察  ~Text-to-MusicとText-To-ImageかつImage-to-Music...モーダル間の変換後の一致性とジャンル表を用いた解釈可能性の考察  ~Text-to-MusicとText-To-ImageかつImage-to-Music...
モーダル間の変換後の一致性とジャンル表を用いた解釈可能性の考察 ~Text-to-MusicとText-To-ImageかつImage-to-Music...
 
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
 

It

  • 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)
  • 13. Chap. 12 [Probabilistic Parsing] 12.1 Some Concepts 12.1.4 Lexicalization Lexicalization PCFG の弱点は確率の独立性の仮定
  • 14. Chap. 12 [Probabilistic Parsing] 12.1 Some Concepts 12.1.4 Lexicalization Lexicalization PCFG の弱点は確率の独立性の仮定 例えば VP を考えると 行き先の V がどの単語であって も展開先の確率は同じ 二重目的語 (ditransitive) である tell の後ろには 2 つ 名 詞句が並ぶのが自然 VP → V N N の確率が一番高そう Table 12.2 は V によってこれだけ確率が違うよ を示す (come なら 三割で VP → V PP だけど want ならそれ の確率はほぼ 0)
  • 15. Chap. 12 [Probabilistic Parsing] 12.1 Some Concepts 12.1.4 Lexicalization Lexicalization PCFG の弱点は確率の独立性の仮定 例えば VP を考えると 行き先の V がどの単語であって も展開先の確率は同じ 二重目的語 (ditransitive) である tell の後ろには 2 つ 名 詞句が並ぶのが自然 VP → V N N の確率が一番高そう Table 12.2 は V によってこれだけ確率が違うよ を示す (come なら 三割で VP → V PP だけど want ならそれ の確率はほぼ 0) そこで PCFG の 語彙化 (lexicalization) を行う
  • 16. Chap. 12 [Probabilistic Parsing] 12.1 Some Concepts 12.1.4 Lexicalization the most straightforward and common lexicalize 次のような木の (PP (P into) (NP (DT the) (NN store))) 各ノードに “head word” を付与する (PP-into (P-into into) (NP-store (DT-the the) (NN-store store))) 必ずしも充分ではない
  • 17. Chap. 12 [Probabilistic Parsing] 12.1 Some Concepts 12.1.4 Lexicalization Probabilities on structural context PCFGs は context-freeness を仮定しているが 実際にはこれは 誤り例えば Table 12.3 (p. 420) は NP が主語にあたるか目 的語にあたるかでの確率の違いを示す Expansion as Sub as Obj NP → PRP 14.7 % 2.1 % NP → NNP 3.5 % 0.9 % NP → NP PP 5.6 % 14.1 %
  • 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” で 他 の単語がそれに依存している
  • 24. Chap. 12 [Probabilistic Parsing] 12.1 Some Concepts 12.1.7 Phrase structure grammars and dependency grammars compound noun “phrase structure model” という合成語の依存関係は の 2 つが考えられて木にすると次のように 実は lexicalized PCFG の下では P(Nx ) = P(Nv ) が成り立ち結局 P(Ny ) <> P(Nu ) によって 2 つの木の確率を比べることになる 更にこれは phrase → structure と phrase → model の 2 つの 依存関係の比較に等しい
  • 25. Chap. 12 [Probabilistic Parsing] 12.1 Some Concepts 12.1.8 Evaluation Evaluation parser の性能評価に PARSEVAL measure を用いる 括弧の正解を見る (ただし根は除く
  • 26. Chap. 12 [Probabilistic Parsing] 12.2 Some Appraches 以上の知識を実際に適用した例
  • 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
  • 29. Chap. 12 [Probabilistic Parsing] 12.2 Some Appraches [Collins, 1996] Recall Precision 88.1 88.6
  • 30. Chap. 12 [Probabilistic Parsing] 12.2 Some Appraches