nltk.IBMModel5.best_model2_alignment

IBMModel5.best_model2_alignment(sentence_pair, j_pegged=None, i_pegged=0)

Finds the best alignment according to IBM Model 2

Used as a starting point for hill climbing in Models 3 and above, because it is easier to compute than the best alignments in higher models

Parameters:
  • sentence_pair (AlignedSent) – Source and target language sentence pair to be word-aligned
  • j_pegged (int) – If specified, the alignment point of j_pegged will be fixed to i_pegged
  • i_pegged (int) – Alignment point to j_pegged