The alignment can be performed via the Expectation-Maximization (EM) by starting with a random initial alignment and calculating the affinity matrix count(e i , c j ) over the whole parallel corpus, where element (i, j) is the number of times character e i was aligned to c j .
from the affinity matrix conditional probabilities P (e i |c j ) can be estimated as Alignment j = θ(i) between {e i } and {c j } that maximizes probability is also the same alignment that minimizes alignment distance D: equations (2) and (5) are the same when we have the distance function d(e i , c j ) = − log P (c j |e i ).