360 likes | 575 Vues
An Introduction to Statistical Machine Translation. Dept. of CSIE, NCKU Yao-Sheng Chang Date: 2011.04.12. Outline. Introduction Peter Brown The Mathematics of Machine Translation: Parameter Estimation, computational linguistics , vol. 19,1993, pp.263-311. Model 1. Introduction (1).
E N D
An Introduction to Statistical Machine Translation Dept. of CSIE, NCKU Yao-Sheng Chang Date: 2011.04.12
Outline • Introduction • Peter Brown • The Mathematics of Machine Translation: Parameter Estimation, computational linguistics, vol. 19,1993, pp.263-311. • Model 1
Introduction (1) • Machine translation is available • Statistical method, information theory • Faster computer, large storage • Machine-readable corpora • Statistical method have proven their value • Automatic speech recognition • Lexicography, Natural language processing
Introduction (2) • Translations involve many cultural respects • We only consider the translation of individual sentence, just acceptable sentences. • Every sentence in one language is a possible translation of any sentence in the other • Assign (S,T) a probability, Pr(T|S), to be the probability that a translator will produce T in the target language when presented with S in the source language.
Statistical Machine Translation(SMT) • Noise channel problem
Fundamental of SMT • Given a string of French f, the job of our translation system is to find the string e that the speaker had in mind when he produced f. (Baye’s theorem) • Since denominator Pr(f) here is a constant, the best e is one which has the greatest probability.
Practical Challenges • Computation of translation model Pr(f|e) • Computation of language model Pr(e) • Decoding (i.e., search for e that maximize Pr(f|e) Pr(e))
e = e1e2…ei…el aj=i f = f1 f2… fj… fm faj =ei Formulation of Alignment(1) • Let e = e1le1e2…el and f = f1mf1f2…fm • An alignment between a pair of strings e and f use a mapping of every word ei to some word fj • In other words, an alignment a between e and f tells that the word ei, 1il is generated by the word faj, aj{1,…,m} • There are (l+1)mdifferent alignments between e and f. (Including Null – no mapping )
Formulation of Alignment(2) • Probability of an alignment
Translation Model • The alignment, a, can be represented by a series, a1m = ala2... am, of m values, each between 0 and lsuch that if the word in position j of the French string is connected to the word in position i of the English string, then aj= i , and if it is not connected to any English word, then aj= 0 (null). Pr(f,a|e,m)
IBM Model I (1)
IBM Model I (2) • The alignment is determined by specifying the values of ajfor j from 1 to m, each of which can take any value from 0 to l. Pr(f|e) = ∑Pr(f,a|e)
Constrained Maximization • We wish to adjust the translation probabilities so as to maximize Pr(f|e ) subject to the constraints that for each e
Lagrange Multipliers (1) • Method of Lagrange multipliers(拉格朗乘數法): Lagrange multipliers with one constraint • If there is a maximum or minimum subject to the constraint g(x,y) = 0, then it will occur at one of the critical numbers of the function F defined by is called the • f(x,y) is called the objective function(目標函數). • g(x,y) is called the constrained equation(條件限制方程式). • F(x, y, ) is called the Lagrange function(拉格朗函數). • is called the Lagrange multiplier(拉格朗乘數).
Lagrange Multipliers (2) • Example 1: Maximize • Subject to • Let • Set • 代入(2)與(3),可得 • (5)與(6)代入(4),可得 • ,由此可得 因此,最大值為
Lagrange Multipliers (3) • Following standard practice for constrained maximization, we introduce Lagrange multipliers e, and seek an unconstrained extremum of the auxiliary function
Derivation (1) • The partial derivative of h with respect to t(f|e)is • where is the Kronecker delta function, equal to one when both of its arguments are the same and equal to zero otherwise
Derivation (2) • We call the expected number of times that e connects to f in the translation (f|e) the count of f given e for (f|e) and denote it by c(f|e; f, e).By definition,
Derivation (3) • replacing e by ePr(f|e), then Equation (11) can be written very compactly as • In practice, our training data consists of a set of translations, (f(1) le(1)), (f(2) le(2)), ..., (f(s) le(s)), , so this equation becomes
Derivation (4) • For an expression that can be evaluated efficiently.
Derivation (5) • Thus, the number of operations necessary to calculate a count is proportional to l + m rather than to (l + 1)m as Equation (12)
Introduction(1) In statistical computing, an expectation-maximization (EM) algorithm is an algorithm for finding maximum likelihood estimates of parameters in probabilistic models, where the model depends on unobserved latent variables. EM is frequently used for data clustering in machine learning and computer vision.
Introduction(2) EM alternates between performing an expectation (E) step, which computes an expectation of the likelihood by including the latent variables as if they were observed, and a maximization (M) step, which computes the maximum likelihood estimates of the parameters by maximizing the expected likelihood found on the E step. The parameters found on the M step are then used to begin another E step, and the process is repeated. (From: http://en.wikipedia.org/wiki/Expectation-maximization_algorithm )
EM algorithm is a soft version of K-means clustering. • The idea is that the observed data are generated by several underlying causes. • Each cause contributes independently to the generation process, bur we only see the final mixture –without information about which cause contributed what.
Observable data • Each • Unobservable / hidden data • Each zij can be interpreted as cluster membership probabilities. • The component zij is 1 if object i is a member of cluster j.
Initial Assumption At first , suppose we have a data set , where each is the vector that correspond to the ith data point. Further , assume the samples are drawn from k mixture Gaussians , . Notice that the p.d.f. of multivariate normal distribution is
E-step Let be a n by k matrix , where Notice that , if we set for then by Bayes formula we have
M-step .
log likelihood The log likelihood of the data set X given the parameters is , where , and is the weight of cluster j . Notice that
計算示範(1) 假設 則