nltk.IBMModel2.__init__

IBMModel2.__init__(sentence_aligned_corpus, iterations, probability_tables=None)[source]

Train on sentence_aligned_corpus and create a lexical translation model and an alignment model.

Translation direction is from AlignedSent.mots to AlignedSent.words.

Parameters:
  • sentence_aligned_corpus (list(AlignedSent)) – Sentence-aligned parallel corpus
  • iterations (int) – Number of iterations to run training algorithm
  • probability_tables (dict[str]: object) – Optional. Use this to pass in custom probability values. If not specified, probabilities will be set to a uniform distribution, or some other sensible value. If specified, all the following entries must be present: translation_table, alignment_table. See IBMModel for the type and purpose of these tables.