SlideShare a Scribd company logo
1 of 29
言語処理のための機械学習入門
ch. 5 系列ラベリング
輪読会用資料
yatzhash
注意
• 発表者は専門家ではありません。
• 厳密性・一貫性に欠ける記述があります。
• 一度は対象書の5章を読んだことがある方が対象です。
• 理解につまずきそうなところを中心に扱います。
(そもそも対象書は記述が簡素な割には内容がとても濃いです)
• 間違って解釈している部分があるかもしれません。ご指摘いた
だけると幸いです。
• 質問があっても、調べきれていない部分があるため、答えられ
ないかもしれません。でも有意義な時間にするために質問
Welcome
• 社外での発表は社会人になってから初めてなのでお手柔らかに
motivation
系列ラベリング(Sequence Labeling / Tagging)とは
sequence labeling is a type of pattern recognition task that involves the
algorithmic assignment of a categorical label to each member of a sequence of
observed values.
(Wikipedia 英語版 https://en.wikipedia.org/wiki/Sequence_labelingより)
=> 系統立って並んでいる一連の観測値それぞれに対し
分類・ラベリングを行うタスク
自然言語処理に関するタスク例
・形態素解析(品詞のタグ付け含む)
・チャンキング (固有表現認識(NER)含む)
・音声認識
基本は教師あり学習
系列ラベリングの問題
• ラベルの組み合わせになるので、可能なラベル列が膨大
• 例:品詞
単語トークン数 : 10
品詞種類数:9
910
= 3486784401通り
• 普通の分類問題ならばラベルの種類数だけなので、
せいぜい数百通り
分類器の逐次適用 (ch5.3)
Naïve bayseやSVM、logistic regressionなどの分類器を頭から
適用。
Pros
・直前までの分類結果を利用できる
・高精度
Cons
・計算量が膨大
系列ラベリングに有効な手法
• HMM (隠れマルコフモデル)
実装例: Chasen
・CRF (条件付き確率場)
実装例:Mecab
・構造化SVM
実装例:Cabocha
• Deep Learning / Neural Network
実装例:juman++
HMMによる系列ラベリングの問題設定
(P. 150)
• ある系列に対しもっともらしいラベル列はなにか
=>「系列( 𝑥)と
有りうるラベル列( 𝒚)の
組み合わせのち
もっともらしいものはどれか?」
=> 系列との同時確率が最も高いラベル列を見つける問題
𝒚 𝒎𝒂𝒙
= argmax
𝒚
𝑃(𝒙, 𝒚)
x0 x1
x2
xk
y0
yKy2y1
HMMの仮定(P149)
出力する確率
状態の遷移確率
観察可能な
変数𝒙
(系列)
※系列の各要素同士は直接
依存がないと仮定している。
P 𝑦2|𝑦1
P 𝑦1|𝑦0
P 𝒙, 𝒚
P 𝑦 𝑘|𝑦 𝑘−1
P 𝑥0 |𝑦0
P 𝑦3|𝑦2
太字はベクトル
P 𝑥2|𝑦1
隠れている状態
(ラベル列𝒚 )
今の状態が前の状態だけに依
存していることを仮定する。
P 𝑥3|𝑦2 P 𝑥 𝑘|𝑦 𝑘−1
隠れている
状態と観察
可能な変数
𝑃 𝒙, 𝒚 = 𝑃 𝑥0 , 𝑥1 , 𝑥2 ⋯ 𝑥 𝑘, 𝑦0, 𝑦1, 𝑦2 ⋯ 𝑦 𝑘
=
𝑖
𝑘
𝑃 𝑥𝑖 𝑦𝑖 𝑃 𝑦𝑖 𝑦𝑖−1
の意味する
ところ
同時
確率
パラメータ推定・most-liklihood(P149)
𝑙𝑜𝑔P 𝐷 = log 𝑃 𝑥 𝑖 , 𝑦 𝑖
= 𝑥 𝑖 , 𝑦 𝑖 ∈𝐷 𝑗 log 𝑃 𝑥𝑗
(𝑖)
𝑦𝑗
(𝑖)
+ 𝑗 log 𝑃 𝑦𝑗
(𝑖)
𝑦𝑗−1
(𝑖)
=
𝑥,𝑦
𝑛 𝑥, 𝑦 , 𝐷 log 𝑝 𝑥|𝑦 +
𝑦′,𝑦
𝑛 𝑦′, 𝑦 , 𝐷 log 𝑝 𝑦|𝑦′
Most-liklihood
※ラベルが分かる場合。分からな
い場合はEMアルゴリズム
※行列が分かるなら、
行列を使ったほうが
分かりやすい。
青の部分の式変形は次ページで解説
ラグランジェ法によりパラメータについて
解析的に解ける
パラメータ推定・most-liklihoodの式変形
前ページ2行目から3行目への補足(P149)
※同じxの値とyの値
を持っている項を
まとめる。
𝑤 𝑘 ∈ W : 観察変数の種類
𝑙ℎ ∈ 𝐿 : ラベルの種類
log 𝑃 𝑥𝑗
( 𝑖)
𝑦𝑗
( 𝑖)
𝑗𝑥(𝑖), 𝑦(𝑖) ∈𝐷
= log 𝑃 𝑥𝑗
(𝑖)
= 𝑤 𝑘 𝑦𝑗
(𝑖)
= 𝑙ℎ𝑗𝑥(𝑖), 𝑦(𝑖) ∈𝐷
= log 𝑃 𝑥1
(𝑖)
= 𝑤 𝑘 𝑦1
(𝑖)
= 𝑙ℎ + log 𝑃 𝑥2
(𝑖)
= 𝑤 𝑘 𝑦2
(𝑖)
= 𝑙ℎ + log 𝑃 𝑥3
(𝑖)
= 𝑤 𝑘 𝑦3
(𝑖)
= 𝑙ℎ ⋯ + log 𝑃 𝑥𝑗
(𝑖)
= 𝑤 𝑘 𝑦𝑗
(𝑖)
= 𝑙ℎ𝑥(𝑖), 𝑦(𝑖) ∈𝐷
=log 𝑃 𝑥1
(𝑖)
= 𝑤2 𝑦1
(𝑖)
= 𝑙3 + log 𝑃 𝑥2
(𝑖)
= 𝑤4 𝑦2
(𝑖)
= 𝑙1 + log 𝑃 𝑥3
(𝑖)
= 𝑤7 𝑦3
(𝑖)
= 𝑙5 ⋯ + log 𝑃 𝑥𝑗
(𝑖)
= 𝑤5 𝑦𝑗
(𝑖)
= 𝑙2
+log 𝑃 𝑥1
(2)
= 𝑤4 𝑦1
(2)
= 𝑙1 + log 𝑃 𝑥2
(2)
= 𝑤5 𝑦2
(2)
= 𝑙2 + log 𝑃 𝑥3
(2)
= 𝑤2 𝑦3
(2)
= 𝑙3 ⋯ + log 𝑃 𝑥𝑗
(2)
= 𝑤6 𝑦𝑗
(2)
= 𝑙6
⋯
+log 𝑃 𝑥1
(|𝐷|)
= 𝑤6 𝑦1
(|𝐷|)
= 𝑙6 + log 𝑃 𝑥2
(|𝐷|)
= 𝑤4 𝑦2
(|𝐷|)
= 𝑙1 + log 𝑃 𝑥3
(|𝐷|)
= 𝑤2 𝑦3
(|𝐷|)
= 𝑙|𝐿| ⋯ + log 𝑃 𝑥𝑗
(|𝐷|)
= 𝑤4 𝑦𝑗
(|𝐷|)
= 𝑙1
= 𝑛 (𝑥 = 𝑤1, 𝑦 = 𝑙1), 𝐷 log 𝑃(𝑥 = 𝑤1|𝑦 = 𝑙1)
+ 𝑛 (𝑥 = 𝑤1, 𝑦 = 𝑙2), 𝐷 log 𝑃(𝑥 = 𝑤1|𝑦 = 𝑙2) ⋯
+𝑛 𝑥 = 𝑤1, 𝑦 = 𝑙|𝐿| , 𝐷 log 𝑃 𝑥 = 𝑤1 𝑦 = 𝑙|𝐿| + 𝑛 (𝑥 = 𝑤2, 𝑦 = 𝑙1), 𝐷 log 𝑃(𝑥 = 𝑤2|𝑦 = 𝑙1) ⋯ ⋯ + 𝑛 𝑥 = 𝑤|𝑊|, 𝑦 =
𝑙|𝐿| , 𝐷 log 𝑃 𝑥 = 𝑤|𝑊| 𝑦 = 𝑙|𝐿| = 𝑛 (𝑥 = 𝑤 𝑘, 𝑦 = 𝑙ℎ ), 𝐷 log 𝑃(𝑥 = 𝑤 𝑘|𝑦 = 𝑙ℎ)( 𝑤 𝑘∈𝑊, 𝑙ℎ ∈𝐿) = 𝑛 (𝑥, 𝑦), 𝐷 log 𝑃(𝑥|𝑦)𝑥,𝑦
動的計画法とは?
対象となる問題を複数の部分問題に分割し、部分問題の計算結果
を記録しながら解いていく手法
以下の2条件を満たす。
1. 分割統治法:部分問題を解き、その結果を利用して、問題全
体を解く
2. メモ化:部分問題の計算結果を再利用する
効率のよいアルゴリズムの設計技法として知られる代表的な構造
の一つである。
動的計画法 – Wikipedia より引用・改変
https://ja.wikipedia.org/wiki/%E5%8B%95%E7%9A%84%E8%A8%88%E7%94%BB%E6%B3%95
始点から終点への経路のスコア
𝑙𝑜𝑔𝑃 𝒙, 𝒚
=
𝑖
log(𝑃 𝑥𝑖 𝑦𝑖 𝑃 𝑦𝑖 𝑦𝑖−1 ) =
𝑖
log 𝑃 𝑥𝑖 𝑦𝑖 + log(𝑃 𝑦𝑖 𝑦𝑖−1 )
HMMのためのViterbi アルゴリズム(以下
Viterbi)
※label = [A , B, C, D] 系列の長さ: 5の場合
ノード: あるラベルの候補と観測された
変数が割り当てられた頂点
エッジ:あるxに対するラベルから
次のxに対するラベルへの遷移
からなる有向グラフの最長経路(=ス
コアの合計値が最も高い経路)を求め
る問題とみなせる。
※始点・終点はダ
ミー
j=6j=5j=3 j=4j=2j=1j=0
A
始点
B
C
D
A
B
C
D
A
B
C
D
A
B
C
D
A
B
C
D
終点
エッジスコア(遷移確率)ノードスコア(出力確率)
𝑃 𝑥𝑖 𝑦𝑖
𝑦𝑖𝑦𝑖−1
A
B
C
D
A
5
20
10
30
B
C
D
15 A
10
5
7
3
そのノード
までの合計
スコア
ノード
スコア
エッジ
スコア
HMMのためのviterbi前半
𝑡(𝑗, 𝑦𝑗) = max
𝑦 𝑗−1
𝑙𝑜𝑝𝑃 𝑥𝑗, 𝑦𝑗 𝑥𝑗−1, 𝑦𝑗−1) + 𝑡(𝑗 − 1, 𝑦𝑗−1)
𝑠(𝑗, 𝑦𝑗) = argmax
𝑦 𝑗−1
𝑙𝑜𝑝𝑃 𝑥𝑗, 𝑦𝑗 𝑥𝑗−1, 𝑦𝑗−1) + 𝑡(𝑗 − 1, 𝑦𝑗−1)
20 + 10 + 5 = 35
10 + 5 + 5 = 20
30 + 7 + 5 = 42
15 + 3 + 5 = 23
max
𝑦𝑖𝑦𝑖−1
A
B
C
D
A
20
10
30
B
C
D
15 A
42 C
最大スコアとそれを与え
る経路(前のノードラベ
ル)だけを保持
前のノードラベル
合計スコア
ノードスコア
HMMのためのviterbi前半終了時点のグラフ
各ノードへの最大スコアを
与える経路だけが残る
j=6j=5j=3 j=4j=2j=1j=0
A
始点
B
C
D
A
B
C
D
A
B
C
D
A
B
C
D
A
B
C
D
終点
10
0
A
85 D
90 C
95 A
70 C
80 B
20 C
20 B
75 D
20 A
20 A
20 D
20 C
20 C
20 B
20 D
20 D
20 始
20 始
20 始
20 始
※テキストと違い、ダミーの終点
(|x| + 1)を加えていることに注意。
HMMのためのViterbi 後半
j=6j=5j=3 j=4j=2j=1j=0
A
始点
B
C
D
A
B
C
D
A
B
C
D
A
B
C
D
A
B
C
D
終点
10
0
A
85 D
90 C
95 A
70 C
80 B
20 C
20 B
75 D
20 A
20 A
20 D
20 C
20 C
20 B
20 D
20 D
20 始
20 始
20 始
20 始
後ろから最大スコアを与える
経路をたどって行く
for 𝑗 = 𝒙 𝑡𝑜 1
𝑦𝑗
𝑚𝑎𝑥
= s j + 1, 𝑦𝑗+1
𝑚𝑎𝑥
end for
※テキストと違い、ダミーの終点
(|x| + 1)を加えていることに注意。
CRFによる系列ラベリングの問題設定
• ある系列に対しもっともらしいラベル列はなにか
=>「系列( 𝑥)が与えられた時
有りうるラベル列のうち
もっともらしいものはどれか?」
=> 系列が与えられた時の条件付き確率が最も高いラベル列を見つ
ける問題
𝒚∗
= argmax
𝒚
𝑃 𝒙 𝒚)
CRF導入1(P153)
𝑃 𝒚|𝒙 =
1
𝑍 𝑥,𝜔
exp(𝝎 ∙ 𝝓(𝒙, 𝒚))
前ページの条件確率を対数線形モデルで表す
𝝎 : 素性対する重みベクトル
𝜙 : 素性抽出関数
ただし、
𝑦
P 𝑥, 𝑦 = 1 𝑍 𝑥,𝜔 =
𝑦
exp(𝝎 ∙ 𝝓(𝒙, 𝒚))
𝒚∗
= argmax
𝒚
𝑃 𝒙 𝒚)
= argmax
𝒚
1
𝑍 𝑥,𝜔
exp(𝝎 ∙ 𝝓(𝒙, 𝒚))
= argmax
𝒚
𝝎 ∙ 𝝓(𝒙, 𝒚)
よって得くべき最大化問題は
素性の例:品詞タグ付けに用いられる素性
• 単語そのもの
• 前の単語
• 単語の品詞(分かっている場合)
• 前の単語の品詞
• 単語の形 (ly・ingがついている)
CRFの仮定(P154)
𝒚∗
= argmax
𝒚
𝝎 ∙ 𝝓(𝒙, 𝒚)
はそのままだと、
ラベルの組み合わせ分のクラスを持つ分類器となる
=計算量が膨大。
そこで
𝝓 𝒌 𝒙, 𝒚 =
𝑡
𝝓 𝒌(𝒙, 𝑦𝑡, 𝑦𝑡−1) と仮定。
系列全体で一気に抽出した素性と
1つずつずらしながら
系列の連続した2つの部分をもとに抽出した素性の和
が同じ
𝑦1 ・・・・𝑦0 𝑦2
𝑦3 𝑦|𝑇|
𝝓 𝒌 𝒙, 𝒚
素性抽出
素性抽出
𝝓 𝒌(𝒙, 𝑦1, 𝑦0) 𝝓 𝒌(𝒙, 𝑦2, 𝑦1) 𝝓 𝒌(𝒙, 𝑦|𝑇|, 𝑦 𝑇 −1)
仮定の意味
= 𝝓 𝒌 𝒙, 𝒚
CRFの目的関数(P154)
𝒚∗
= argmax
𝒚
𝝎 ∙
𝑡
𝝓 (𝒙, 𝑦𝑡, 𝑦𝑡−1)
= argmax
𝒚
𝑡
𝝎 ∙ 𝝓 (𝒙, 𝑦𝑡, 𝑦𝑡−1)
前頁の仮定より
ここだけで部分ごとの
対数線形モデルになる
yについては、tとt-1における情報に依存
それをtについて足し合わせたものが目的関数
HMMの時と同様にViterbi Algorithmで
高速に解ける
CRFの学習・パラメータの更新(P154)
目的関数(log-likelihood)
𝜖は学習率
最急勾配法の更新式は
𝐿 𝝎 =
(𝑥(𝑖),𝑦(𝑖)) ∈𝐷
logP 𝑦(𝑖)
|𝑥(𝑖)
𝑍 𝑥,𝜔 =
𝑦
exp(𝝎 ∙ 𝝋(𝒙, 𝒚))
最適化法として最急勾配法を用いる
𝜕𝐿 𝝎
𝜕𝝎
=
(𝑥(𝑖),𝑦(𝑖)) ∈𝐷
𝜙 𝒙 𝑖 , 𝒚 𝒊 −
𝒚
𝑃 𝒚 𝒙 𝑖 𝜙(𝒙 𝑖 , 𝒚 𝒊 )
𝝎 𝑛𝑒𝑤
= 𝝎 𝑜𝑙𝑑
+ 𝜖
𝜕𝐿 𝝎 𝒐𝒍𝒅
𝜕𝝎
※実際の実装の最適化では
・SGD
・L-BFGS
パラメータ更新の計算速度のボトルネック
(P155)
𝒚 𝑃 𝒚 𝒙 𝜙(𝒙 , 𝒚 )内の
をあらゆるラベルyについて計算する必要がある。𝑃 𝒚 𝒙(𝒊)
つまりラベルの種類の数を|L|
系列の長さをTとすると
一つの事例𝒙(𝒊)に対して
𝐿 𝑇 通りの計算が必要
になる。
実用的ではない!
※普通の分類問題ならば
系列の長さは1なので
(そもそも系列ではないが)
𝐿
通りで済む。
条件付確率の式変形(P155)
𝒚
𝑃 𝒚 𝒙 𝜙 𝒙, 𝒚 =
𝒚
𝑃(𝒚|𝒙)
𝒕
𝜙 𝒙, 𝑦𝑡, 𝑦𝑡−𝟏
= 𝑃 𝑦0, 𝑦1, 𝑦2 ⋯ 𝑦𝑡 𝒙
𝑡
𝜙 𝒙, 𝑦𝑡, 𝑦𝑡−1
= 𝑃 𝑦0, 𝑦1 𝒙 𝑃 𝑦1, 𝑦2 𝒙 ⋯ 𝑃 𝑦𝑡−1, 𝑦𝑡 𝒙
𝑡
𝜙 𝒙, 𝑦𝑡, 𝑦𝑡−1
=
𝑡 𝑦 𝑡,𝑦𝑡−1
𝑃 𝑦𝑡−1, 𝑦𝑡 𝒙 𝜙 𝒙, 𝑦𝑡, 𝑦𝑡−1
yはtとt-1における情報のみに依存
しているというCRFの仮定より
例えば𝑇 を系列の長さとするならば、
t= 1, 2, 3, ・・・T
このsumのtは系列に
おける位置
この𝑦𝑡, 𝑦𝑡−1はそれぞれラベルの値
例えば𝑙ℎ ∈ 𝐿 : ラベルの種類とするならば
(𝑦𝑡, 𝑦𝑡−1) = (𝑙1, 𝑙1) , (𝑙2, 𝑙2), (𝑙3, 𝑙3) ⋯ (𝑙|𝐿|, 𝑙|𝐿|)
Forward-backward Algorithm
周辺確率の式変形1(P155)
𝑦𝑡 , 𝑦𝑡−1
はこれらの周辺確率を求めるうえでは一定と
なるため
P(yt,yt−1|x) = 𝑃( 𝒚| 𝒙)
𝒚 𝒕+𝟏:𝑻+𝟏𝒚0:𝑡−2
=
1
𝑍 𝑥,𝜔
Ψ𝑡′ ( 𝑦𝑡′ , 𝑦𝑡′−1)
𝑡′𝒚 𝒕+𝟏:𝑻+𝟏𝒚0:𝑡−2
=
𝜓𝑡( 𝑦𝑡, 𝑦𝑡−1)
𝑍 𝑥,𝜔
𝜓𝑡′ ( 𝑦𝑡′ , 𝑦𝑡′ −1)
𝑡′ ≠𝑡𝒚 𝒕+𝟏:𝑻+𝟏𝒚0:𝑡−2
Ψ𝑡(𝑦𝑡, 𝑦𝑡−1) = exp⁡( 𝝎, 𝜑𝑡(𝒙, 𝑦𝑡, 𝑦𝑡−1))
𝑃( 𝒚| 𝒙) =
𝜓𝑡(𝑦𝑡, 𝑦𝑡−1)
𝑍 𝑥,𝝎
𝑡
更新式の右辺では, x, ωともに一定であるため
以下のようにあらわせる よって
以上より周辺確率は
𝑦0,⋯𝑦𝑡−2
と変形できる
ただし
𝑦0:𝑡−2
変形により、周辺確率が𝒚 𝒕 , 𝒚 𝒕−𝟏
以外のyの値だけに
依存しているように表現できる
最後に𝑦 𝑇+1 = 𝐸 (一定)
先頭に𝑦0 = 𝐵(一定)
Forward-backward Algorithm
周辺確率の式変形2(P156)前ページの青□の部分
𝛽( 𝑦𝑡, 𝑡) = 𝜓𝑡+1( 𝑦𝑡′ , 𝑦𝑡′ −1)
𝑇+1
𝑡′ =𝑡+1𝒚 𝒕+𝟏:𝑻+𝟏
𝛼( 𝑦𝑡, 𝑡) = 𝜓𝑡′ ( 𝑦𝑡′ , 𝑦𝑡′ −1)
𝑡
𝑡′ =1𝒚0:𝑡−1
ただし
𝛼 𝑦0, 0 = 1, 𝛽 𝑦 𝑇+1, 𝑇 + 1 = 1
P( 𝑦𝑡, 𝑦𝑡−1|𝒙) =
1
𝒁 𝒙,𝝎
ψt(yt, yt−1)α(yt−1, t − 1)β(yt,t)
周辺確率の変形後の式
𝜓 𝑡′ (𝑦 𝑡′ , 𝑦 𝑡′ −1)
𝑡′ ≠𝑡𝒚 𝒕+𝟏:𝑻+𝟏𝒚0:𝑡−2
= 𝜓1(𝑦1, 𝑦0)𝜓2(𝑦2, 𝑦1) ⋯ 𝜓 𝑡−1(𝑦𝑡−1, 𝑦𝑡−2)𝜓 𝑡+1(𝑦𝑡+1, 𝑦𝑡 ) ⋯ 𝜓 𝑇+1(𝑦 𝑇+1, 𝑦 𝑇)
𝒚 𝒕+𝟏:𝑻+𝟏𝒚0:𝑡−2
= 𝜓1(𝑦1, 𝑦0)𝜓2(𝑦2, 𝑦1) ⋯ 𝜓 𝑡−1(𝑦𝑡−1, 𝑦𝑡−2)
𝒚0:𝑡−2
𝜓 𝑡+1(𝑦𝑡+1, 𝑦𝑡 ) ⋯ 𝜓 𝑇+1(𝑦 𝑇+1, 𝑦 𝑇)
𝒚 𝒕+𝟏:𝑻+𝟏
= ( 𝜓 𝑡′ (𝑦 𝑡′ , 𝑦 𝑡′ −1)
𝑡−1
𝑡′ =1𝒚0:𝑡−2
)( 𝜓 𝑡+1(𝑦 𝑡′ , 𝑦 𝑡′ −1)
𝑇+1
𝑡′ =𝑡+1𝒚 𝒕+𝟏:𝑻+𝟏
)
𝛼 𝑦𝑡, 𝑡 と𝛽 𝑦𝑡, 𝑡 が
高速に計算できれば、
全体としても高速に計算できる
ではどのように
高速に
𝛼 𝑦𝑡, 𝑡 と𝛽(𝑦𝑡, 𝑡)を
計算するか?
Forward-backward Algorithm
𝛼 𝑦𝑡, 𝑡 と𝛽(𝑦𝑡, 𝑡)の計算
※label = [A , B, C, D]
計算量は𝑶 𝑳 × |𝑳| = 𝑶( 𝑳 𝟐
)
ラベル
A
B
C
D
𝛼 𝑦𝑡−1, 𝑡 − 1
A
B
C
D
𝛼 𝑦𝑡, 𝑡
𝜓 𝑡 𝑦𝑡, 𝑦𝑡−1
𝛼( 𝑦𝑡, 𝑡) = 𝜓𝑡′ ( 𝑦𝑡′ , 𝑦𝑡′ −1)
𝑡
𝑡′ =1𝒚0:𝑡−1
= 𝜓𝑡( 𝑦𝑡, 𝑦𝑡−1)𝒚 𝑡−1
𝜓𝑡′ ( 𝑦𝑡′ , 𝑦𝑡′ −1)𝑡−1
𝑡′ =1𝒚0:𝑡−1
= 𝜓𝑡( 𝑦𝑡, 𝑦𝑡−1)𝒚 𝑡−1
𝛼(𝑦𝑡−1, 𝑡 − 1)
𝑂 𝐿 2
𝑇
一つ前の𝛼との関係式が得られる
式より動的計画法で計算可能なこと
が分かる
前の計算結果を
記憶しておき、
再利用する
𝑂 𝐿 2 𝑇2
全体としての計算量
動的計画法なし 動的計画法あり
𝛽(𝑦𝑡, 𝑡)も同様
チャンキングへの適用
省略
参考文献・参考サイト
・Cookpad 開発者ブログ
日本語形態素解析の裏側を覗く!MeCab はどのように形態素解析してい
るか
http://techlife.cookpad.com/entry/2016/05/11/170000
・Pattern Recognition and Machine Learning
Christopher Bishop (著), Springer(2010/2/15)
・自然言語処理 (放送大学教材)
黒橋 禎夫 (著),放送大学教育振興会 (2015/03)
・日本語入力を支える技術 ~変わり続けるコンピュータと言葉の世界
徳永 拓之 (著),技術評論社 (2012/2/8)

More Related Content

Featured

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 

Featured (20)

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 

Machine learning for_nlp_ch5