Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
SlideShare a Scribd company logo
Graph Structure
・Use search graph in phrase-based model
・At weighted acyclic directed graph G < Ф,V,E,s,g,𝐴>
Ф : phrase pair sets
Ф=feature vector h(・)・weight 𝜔
V: vertex ≡ partial hypotheses
E:edges ≡ weight of route
E ⊆ V×V× Ф×A
A: weight sets
Graph Structure
• out(𝑣)= 𝑣 = 𝑒 ∈ 𝐸|tail(𝑒) : edge sets which go
out from vertex 𝑣
• in(𝑣) = 𝑣 = 𝑒 ∈ 𝐸|head(𝑒) : edge sets which
head to vertex 𝑣
->Phrase pairs are linked by <out(𝑣), in(𝑣)>
At figure 5.8, phrase pair <へ行った, I went to> is
linked by
out(𝑣) = <-----,0,<s>> and in(𝑣)=<--・・・,9,went to>
𝑣
𝑣
Graph Structure
• If Ѱ=(𝑒1, 𝑒1,…, 𝑒l): rout from start to any vertexs,
head(𝑒k)=tail(𝑒k+1), then
Source language phrase sets:
𝑘=1
𝑙
𝑓(∅(𝑒 𝑘)) ≡ 𝑓(Ѱ)
Target language phrase sets:
𝑒(∅ 𝑒1 ), … , 𝑒(∅ 𝑒𝑙 ≡ 𝑒(Ѱ)
Route weight: 𝜔(Ѱ)= 𝑘=1
𝑙
𝜔(𝑒 𝑘)
Graph Structure
• In Fig.5.8, for the route
-> the parallel of word sets of source language
「行った」「へ」「領事館」is
“He went to the consulate”
Start
<行った,He went>
<へ,to>
<領事館,
the consulate>
Semiring
• set R equipped with two binary operations
addition“ + ” and multiplication “ × ”
• Associative:
a+(b+c)=(a+b)+c, a×(b×c)=(a×b)×c
• Commutative: a+b=b+a
• Distributional: a×(b+c)=(a×b)+(a×c)
• Additive inverse, multiplicative inverse
0+a=a+0=a; 1×a=a×1=a; 0×a=a×0=0
are not defined
Semiring
• In Table 5.1, tropical semiring is used to solve
maximization problem for route weight in
decoder
A ⊕ ⊗ 𝟎 𝟏
Tropical 𝑅−∞
∞ max + ー∞ 0
Semiring
• In weight directed graph G, for a rout from
starting point to ending point of source
language input f is Ѱ= 𝑒1, 𝑒1,…, 𝑒l
• Score of Ѱ = product of partial routes
𝜔(Ѱ)=⊗ 𝑘=1 𝜔(𝑒 𝑘)
-> Problem which maximize this score is
max⊗𝜔(𝑒)= ⊕⊗𝜔(𝑒)
A ⊕ ⊗ 𝟎 𝟏
Tropical 𝑅−∞
∞ max + ー∞ 0
Semiring
• In Fig.5.7,line 11
Q(𝑣′
, 𝑗′′
+1,𝑒′
𝑠 𝑒′′
𝑠)←max
Q(𝑣′
, 𝑗′′
+1,𝑒′
𝑠 𝑒′′
𝑠),
Q(𝑣, 𝑗, 𝑒′
𝑒′′
)+𝑠 𝑑 + 𝑠∅ + 𝑠𝑙𝑚
additive operation ⊕ is implemented for
each vertex tail(e)=s of G
• As semiring sastifies distributional feature
-> weight 𝜔(𝑣)of any vertexs 𝑣 ∈V is
⊕⊗𝜔(𝑒)=⊕ 𝑒∈𝑖𝑛(𝑣) 𝜔(𝑒)⊗ 𝜔(𝑡𝑎𝑖𝑙(𝑒))
Semiring
• Forward-backward algorithm for finding
maximum of route weight in graph structure
• topological order(G): list of vertexs of graph G
which arranged in topological order
• 𝛼, 𝛽: external variable
Semiring
FORWARD(G)
• 𝑣 ∈ topological order(G), e∈in(𝑣)
𝜔 = 𝜔(𝑒)⊗ 𝛼(𝑡𝑎𝑖𝑙(𝑒))
𝛼 𝑣 = 𝛼(𝑣)⊕ 𝜔
Start
tail(e)
𝜔(e)
𝜔 = 𝜔(e) ⊗ 𝛼(𝑡𝑎𝑖𝑙(𝑒))
Semiring
BACKWARD(G)
• 𝑣 ∈ inversetopological order(G), e∈ out(𝑣)
𝜔 = 𝜔(𝑒)⊗ 𝛽(ℎ𝑒𝑎𝑑(𝑒))
𝛽 𝑣 = 𝛽(𝑣)⊕ 𝜔
Goal
𝜔(e)
𝜔 = 𝜔(e)⊗ 𝛽(ℎ𝑒𝑎𝑑(𝑒))
head(e)
Semiring
In problem which choose the optimum
translation from search space expressed by
weighted directed graph G
Tropical semiring + Forward algorithm
->Viterbi semiring
k-best
• Besides forward-backward algorithm, k-best
algorithm is used to optimize route weight
• Dijkstra’s algorithm: for single source shortest
path problem
• Eppstein’s algorithm: for heaping multiple paths
efficiently
k-best
• Assume problem satisfies Tropical semiring
and backward algorithm
• Calculate and choose max (weight 𝛽(𝑣))
• Fig.5.10 algorithm
・cand: priority queue
・< 𝑣, s>: partial route
・< 𝑣′
,𝑠′
>: partial route whose vertex 𝑣′
= 𝑣
and edge 𝑠′
= tail 𝑒 = 𝑒 ∈out(𝑣)
・D: set of < 𝑣′
,𝑠′
>
k-best
• k=1: Initialized cand
• Optimize weight of partial route and whole
route
Whole route
D
cand
optimal
get out < 𝑣, s>,register D
Choose 𝑣′ = 𝑣 and
𝑒′ = e ∈out(𝑣)
insert to cand
heap 𝛽(・) to get optimal
k time
Limitation of Search Space
• If search space is big
->any sort can be forgiven
->calculation amount of decode algorithm
become massive
->limitation is necessary:
・Distortion limit, constraint
・Reordering limit, constraint
Distortion Constraint
• Upper limit setting d for distance between
phrase pair ∅ 𝑘and∅ 𝑘−1: start 𝑘 − end 𝑘−1 ≤d
The purpose is making model score small if
model distorted lead to penalty become big
For language pair which do not have big sort,
distortion constraint reach good efficiency
If d=0: no skip, translate from left to right
smoothly
->monotone translation
Distortion Constraint
• Constraint for case when have partial phrases
do not reach the ending point
𝑗: position of the first phrase of source language
start 𝑘: the first position of translated phrase
If ( 𝑗 < start 𝑘), add
end 𝑘 − 𝑗 ≤d
・IBM Constraint
𝑗 𝑠𝑡𝑎𝑟𝑡 𝑘 𝑒𝑛𝑑 𝑘・・・
∅ 𝑘 phrase
No need to
exam
Beam Search
・Prune disused partial hypothesis and pay
attention only partial hypothesis with high score
for computational reduction
・Group of vertexs of search graph and prune
partial hypothesis which has low score
Beam Search
・Group of vertexs of search graph and prune
partial hypothesis which has low score
Partial hypothesis pruned Partial hypothesis chose
Beam Search
Some kinds of grouping:
- Cover vector grouping
- Radix grouping
- Beam width pruning
- Histogram pruning
Heuristic Function
• Prevent partial hypothesis which has not been
translated yet from pruning
• Give predicted score for the rout and learn by
A* search so that rout score get the maximum
• ->can reduce search error
Pre-reordering Method
Translation between languages which has
significantly different grammatical structure
• Pre-reordering rule
• Pre-reordering model
• Pre-reordering learning
Pre-reordering Rule
• Based on tree from syntactic analysis, reorder to
target language word order
• Head-driven phrase structure grammar(HPSG)’s
rule:
- Syntactic anlysis
- Move the subjects back
Pre-reordering Model
• Source languages must have syntactic analysis
tool and morphological analysis tool
• Bilingual data are necessary
• Probability value of pre-reordering patterns
obtained will be estimated by maximum-
likelihood estimation(MLE)
• Choose the suitable pre-reordering patterns
based on reordering part of speech from
morphological analysis, or clustering word
class
Pre-reordering Learning
• For language pairs without any syntactic
analysis tools and morphological analysis tools
• Provisional tree structure automatically
generated from syntactic analysis result
• Divide tree factors to 2 labels: reordering label
[X],and no-reordering label <X>
• Use linear ordering problem(LOP) to
formulate reordering model to find the
approximate solution and build the parse tree

More Related Content

[Book Reading] 機械翻訳 - Section 5 No.2

  • 1. Graph Structure ・Use search graph in phrase-based model ・At weighted acyclic directed graph G < Ф,V,E,s,g,𝐴> Ф : phrase pair sets Ф=feature vector h(・)・weight 𝜔 V: vertex ≡ partial hypotheses E:edges ≡ weight of route E ⊆ V×V× Ф×A A: weight sets
  • 2. Graph Structure • out(𝑣)= 𝑣 = 𝑒 ∈ 𝐸|tail(𝑒) : edge sets which go out from vertex 𝑣 • in(𝑣) = 𝑣 = 𝑒 ∈ 𝐸|head(𝑒) : edge sets which head to vertex 𝑣 ->Phrase pairs are linked by <out(𝑣), in(𝑣)> At figure 5.8, phrase pair <へ行った, I went to> is linked by out(𝑣) = <-----,0,<s>> and in(𝑣)=<--・・・,9,went to> 𝑣 𝑣
  • 3. Graph Structure • If Ѱ=(𝑒1, 𝑒1,…, 𝑒l): rout from start to any vertexs, head(𝑒k)=tail(𝑒k+1), then Source language phrase sets: 𝑘=1 𝑙 𝑓(∅(𝑒 𝑘)) ≡ 𝑓(Ѱ) Target language phrase sets: 𝑒(∅ 𝑒1 ), … , 𝑒(∅ 𝑒𝑙 ≡ 𝑒(Ѱ) Route weight: 𝜔(Ѱ)= 𝑘=1 𝑙 𝜔(𝑒 𝑘)
  • 4. Graph Structure • In Fig.5.8, for the route -> the parallel of word sets of source language 「行った」「へ」「領事館」is “He went to the consulate” Start <行った,He went> <へ,to> <領事館, the consulate>
  • 5. Semiring • set R equipped with two binary operations addition“ + ” and multiplication “ × ” • Associative: a+(b+c)=(a+b)+c, a×(b×c)=(a×b)×c • Commutative: a+b=b+a • Distributional: a×(b+c)=(a×b)+(a×c) • Additive inverse, multiplicative inverse 0+a=a+0=a; 1×a=a×1=a; 0×a=a×0=0 are not defined
  • 6. Semiring • In Table 5.1, tropical semiring is used to solve maximization problem for route weight in decoder A ⊕ ⊗ 𝟎 𝟏 Tropical 𝑅−∞ ∞ max + ー∞ 0
  • 7. Semiring • In weight directed graph G, for a rout from starting point to ending point of source language input f is Ѱ= 𝑒1, 𝑒1,…, 𝑒l • Score of Ѱ = product of partial routes 𝜔(Ѱ)=⊗ 𝑘=1 𝜔(𝑒 𝑘) -> Problem which maximize this score is max⊗𝜔(𝑒)= ⊕⊗𝜔(𝑒) A ⊕ ⊗ 𝟎 𝟏 Tropical 𝑅−∞ ∞ max + ー∞ 0
  • 8. Semiring • In Fig.5.7,line 11 Q(𝑣′ , 𝑗′′ +1,𝑒′ 𝑠 𝑒′′ 𝑠)←max Q(𝑣′ , 𝑗′′ +1,𝑒′ 𝑠 𝑒′′ 𝑠), Q(𝑣, 𝑗, 𝑒′ 𝑒′′ )+𝑠 𝑑 + 𝑠∅ + 𝑠𝑙𝑚 additive operation ⊕ is implemented for each vertex tail(e)=s of G • As semiring sastifies distributional feature -> weight 𝜔(𝑣)of any vertexs 𝑣 ∈V is ⊕⊗𝜔(𝑒)=⊕ 𝑒∈𝑖𝑛(𝑣) 𝜔(𝑒)⊗ 𝜔(𝑡𝑎𝑖𝑙(𝑒))
  • 9. Semiring • Forward-backward algorithm for finding maximum of route weight in graph structure • topological order(G): list of vertexs of graph G which arranged in topological order • 𝛼, 𝛽: external variable
  • 10. Semiring FORWARD(G) • 𝑣 ∈ topological order(G), e∈in(𝑣) 𝜔 = 𝜔(𝑒)⊗ 𝛼(𝑡𝑎𝑖𝑙(𝑒)) 𝛼 𝑣 = 𝛼(𝑣)⊕ 𝜔 Start tail(e) 𝜔(e) 𝜔 = 𝜔(e) ⊗ 𝛼(𝑡𝑎𝑖𝑙(𝑒))
  • 11. Semiring BACKWARD(G) • 𝑣 ∈ inversetopological order(G), e∈ out(𝑣) 𝜔 = 𝜔(𝑒)⊗ 𝛽(ℎ𝑒𝑎𝑑(𝑒)) 𝛽 𝑣 = 𝛽(𝑣)⊕ 𝜔 Goal 𝜔(e) 𝜔 = 𝜔(e)⊗ 𝛽(ℎ𝑒𝑎𝑑(𝑒)) head(e)
  • 12. Semiring In problem which choose the optimum translation from search space expressed by weighted directed graph G Tropical semiring + Forward algorithm ->Viterbi semiring
  • 13. k-best • Besides forward-backward algorithm, k-best algorithm is used to optimize route weight • Dijkstra’s algorithm: for single source shortest path problem • Eppstein’s algorithm: for heaping multiple paths efficiently
  • 14. k-best • Assume problem satisfies Tropical semiring and backward algorithm • Calculate and choose max (weight 𝛽(𝑣)) • Fig.5.10 algorithm ・cand: priority queue ・< 𝑣, s>: partial route ・< 𝑣′ ,𝑠′ >: partial route whose vertex 𝑣′ = 𝑣 and edge 𝑠′ = tail 𝑒 = 𝑒 ∈out(𝑣) ・D: set of < 𝑣′ ,𝑠′ >
  • 15. k-best • k=1: Initialized cand • Optimize weight of partial route and whole route Whole route D cand optimal get out < 𝑣, s>,register D Choose 𝑣′ = 𝑣 and 𝑒′ = e ∈out(𝑣) insert to cand heap 𝛽(・) to get optimal k time
  • 16. Limitation of Search Space • If search space is big ->any sort can be forgiven ->calculation amount of decode algorithm become massive ->limitation is necessary: ・Distortion limit, constraint ・Reordering limit, constraint
  • 17. Distortion Constraint • Upper limit setting d for distance between phrase pair ∅ 𝑘and∅ 𝑘−1: start 𝑘 − end 𝑘−1 ≤d The purpose is making model score small if model distorted lead to penalty become big For language pair which do not have big sort, distortion constraint reach good efficiency If d=0: no skip, translate from left to right smoothly ->monotone translation
  • 18. Distortion Constraint • Constraint for case when have partial phrases do not reach the ending point 𝑗: position of the first phrase of source language start 𝑘: the first position of translated phrase If ( 𝑗 < start 𝑘), add end 𝑘 − 𝑗 ≤d ・IBM Constraint 𝑗 𝑠𝑡𝑎𝑟𝑡 𝑘 𝑒𝑛𝑑 𝑘・・・ ∅ 𝑘 phrase No need to exam
  • 19. Beam Search ・Prune disused partial hypothesis and pay attention only partial hypothesis with high score for computational reduction ・Group of vertexs of search graph and prune partial hypothesis which has low score
  • 20. Beam Search ・Group of vertexs of search graph and prune partial hypothesis which has low score Partial hypothesis pruned Partial hypothesis chose
  • 21. Beam Search Some kinds of grouping: - Cover vector grouping - Radix grouping - Beam width pruning - Histogram pruning
  • 22. Heuristic Function • Prevent partial hypothesis which has not been translated yet from pruning • Give predicted score for the rout and learn by A* search so that rout score get the maximum • ->can reduce search error
  • 23. Pre-reordering Method Translation between languages which has significantly different grammatical structure • Pre-reordering rule • Pre-reordering model • Pre-reordering learning
  • 24. Pre-reordering Rule • Based on tree from syntactic analysis, reorder to target language word order • Head-driven phrase structure grammar(HPSG)’s rule: - Syntactic anlysis - Move the subjects back
  • 25. Pre-reordering Model • Source languages must have syntactic analysis tool and morphological analysis tool • Bilingual data are necessary • Probability value of pre-reordering patterns obtained will be estimated by maximum- likelihood estimation(MLE) • Choose the suitable pre-reordering patterns based on reordering part of speech from morphological analysis, or clustering word class
  • 26. Pre-reordering Learning • For language pairs without any syntactic analysis tools and morphological analysis tools • Provisional tree structure automatically generated from syntactic analysis result • Divide tree factors to 2 labels: reordering label [X],and no-reordering label <X> • Use linear ordering problem(LOP) to formulate reordering model to find the approximate solution and build the parse tree

Editor's Notes

  1. 句に基づく機会翻訳のモデルを構築するには、グラフ構造を利用することも考えられます。図5.8,各部分仮説を頂点とし、フレーズ∅が割り当てられる重み付き非周期有向グラフをグラフの各辺のラベルとして表現します。Фはフレーズペアの集合、Aは各辺に割り当てられる重みの集合とします。Vは頂点の集合であり、Eは辺の集合です。
  2. out(v)を頂点vから出ていく辺の集合とし、In(v)を頂点vへ向かう辺の集合とする。このとき、各フレーズペアが表された辺により結ばれる。図5.8では、フレーズペアphrase pair <へ行った, I went to>がで結ばれることが分かりました。
  3. 開始頂点から任意の頂点v∈𝑉へのある経路Ѱは辺の系列Ѱ=( 𝑒 1 , 𝑒 1 ,…, 𝑒 l )として表すことができます。このとき、Ѱの各辺のフレーズペアの原言語側の集合 𝑘=1 𝑙 𝑓 (∅( 𝑒 𝑘 )) ≡ 𝑓 (Ѱ) は、原言語の入力文の部分単語列であり、目的言語側を連結した単語列 𝑒 (∅ 𝑒 1 ),…, 𝑒 (∅ 𝑒 𝑙 ≡ 𝑒 (Ѱ)は、翻訳された目的言語の文の接頭辞に相当する。経路の重みは、各辺の重みの和として表されます。
  4. 「行った、He went」、「へ,to」、「領事館、consulate」という三つのペアで構造される経路により、原言語の単語の集合「」「」「」に対応する目的言語の翻訳文は”He went to the consulate”
  5. 半環は集合に対する加算、乗算という二つの二項演算で定義される。結合性、可換性、分配性という性質を持っている。ただし、加法逆元、および乗法逆元が定義されないのです。
  6. 重み付き有向グラフGにおいて、開始頂点から終了頂点までの経路はѰ= 𝑒 1 , 𝑒 1 ,…, 𝑒 l 。経路のスコアは各部分経路のスコアの積であり、
  7. 半環は分配性を満たすため、図5.7の行11で、加法演算に対応する⊕がGの各頂点について実行されるため、ある頂点vの重みを𝜔(𝑣)とすると
  8. 前向き後ろ向きアルゴリズムをグラフ構造へ一般化したものと考えられます。ここで、topological order(G)はグラフGの頂点を位相的順序に並び替えられたリストとします。𝛼,𝛽:外部変数
  9. 位相的順序の逆順のリスト
  10. 重み付き有向グラフGで表された探索空間から最適な翻訳を選択する問題は、前向きアルゴリズムでTropical半環を用いる経路を記憶することはビタビ半環といいます。
  11. 最適な翻訳を求めるのには、前向きアルゴリズムの他、最短経路問題の解を求めるダイクストラ法、複数の経路をヒープで効率よくするエプシュタイン法があります
  12. Cand:優先度付きキュー、<v,s>部分経路 𝑣 ′ =𝑣 and edge 𝑠 ′ =tail 𝑒 =𝑒∈out(𝑣)だけを列挙
  13. 全体経路から部分経路<v,s>を取り出し、Dへ登録、頂点vの各辺e∈out(𝑣) を列挙して、新しい< 𝑣 ′ , 𝑠 ′ >をキューcandへ挿入する。𝛽(・)が最大になるようねheapでキューcandの各要素の順序を決定する。部分経路のmax𝛽から全体経路の𝛽の最大を求めるアルゴリズムです。
  14. 探索空間が膨大だと、任意の並び変えを許してしまい、デコードのアルゴリズムの計算量が大きくなってしまう。そこで、歪み制限、制約あるいは並べ替え制限、制約などを加え、現実的な計算量を削減する必要がある。
  15. ・原言語の連続するフレーズペア ∅ 𝑘 および ∅ 𝑘−1 の距離に対し上限値dを設定し、歪みモデルによるペナルティが大きい場合には、モデルのスコアが小さくなる。 ・また、原言語の最初の単語をスキップして残りの単語を全てスキップなしで単調に翻訳した場合、最後にスキップされた最初の単語へと戻るために、歪み制約を満たすことができない。そこで、飛びすぎた句があったとしても、戻ることを可能とするように、
  16. ・原言語の連続するフレーズペア ∅ 𝑘 および ∅ 𝑘−1 の距離に対し上限値dを設定し、歪みモデルによるペナルティが大きい場合には、モデルのスコアが小さくなる。 ・また、原言語の最初の単語をスキップして残りの単語を全てスキップなしで単調に翻訳した場合、最後にスキップされた最初の単語へと戻るために、歪み制約を満たすことができない。そこで、飛びすぎた句があったとしても、戻ることを可能とするように、さらに制約を加える。例えば、まだ翻訳されていない、最初の原言語の単語の位置をjとする。つぎにk翻訳されるフレーズペアの最初の位置がjよりも右にあったとき(j<start),最後の位置とjとの距離をd以内とする制約を加える。
  17. ビーム探索では、部分仮説を枝刈りし、高いスコアをもつ部分仮説のみに注目し、近似的に最大化のl問題を解く。ビーム探索では、類似した部分仮説、探索グラフの頂点をグループ化し、各グループごとにスコアの低い部分仮説を枝刈りする。
  18. ビーム探索では、部分仮説を枝刈りし、高いスコアをもつ部分仮説のみに注目し、近似的に最大化のl問題を解く。ビーム探索では、類似した部分仮説、探索グラフの頂点をグループ化し、各グループごとにスコアの低い部分仮説を枝刈りする。
  19. ビーム探索では、部分仮説を枝刈りし、高いスコアをもつ部分仮説のみに注目し、近似的に最大化のl問題を解く。ビーム探索では、類似した部分仮説、探索グラフの頂点をグループ化し、各グループごとにスコアの低い部分仮説を枝刈りする。
  20. 文法構造が大幅n異なる言語間の翻訳を行う時に使う。
  21. HPSGの解析結果から得られる主辞の情報を利用し、主辞を後ろへ移動させると言ったルールー>大幅に機械翻訳の性能を向上させている。
  22. 原言語と目的言語を精通するスペシャリストがいない場合、翻訳が実現不可能。これに対して、両言語の単語アライメントを利用して、並び替えルールを自動的に取得するモデル。 このモデルを使う条件として、原言語に対して構文解析器、あるいは形態素解析器が存在し、かつ対訳データが存在する。各パターンの確率値を最尤推定する。各パターンを適用するモデルを対数線形モデルにより実現し、エントロピー最大法によりそのパラメータを学習する。形態素解析結果から品詞の並び、あるいは、クラスタリングにより単語クラスの並びを用いて並び替えパターンを取得する
  23. 構文解析器から仮の構文解析木が自動的に生成され、を並び替えをしないラベル、並び替えをするラベルに分けられる。並び替えのモデルを線形順序付け問題として定式化し、近似解を見つけ、解析木を構築する