class_docstr: Lexical translation model that ignores word order
  
  >>> bitext = []
  >>> bitext.append(AlignedSent(['klein', 'ist', 'das', 'haus'], ['the', 'house', 'is', 'small']))
  >>> bitext.append(AlignedSent(['das', 'haus', 'ist', 'ja', 'groß'], ['the', 'house', 'is', 'big']))
  >>> bitext.append(AlignedSent(['das', 'buch', 'ist', 'ja', 'klein'], ['the', 'book', 'is', 'small']))
  >>> bitext.append(AlignedSent(['das', 'haus'], ['the', 'house']))
  >>> bitext.append(AlignedSent(['das', 'buch'], ['the', 'book']))
  >>> bitext.append(AlignedSent(['ein', 'buch'], ['a', 'book']))
  
  >>> ibm1 = IBMModel1(bitext, 5)
  
  >>> print(round(ibm1.translation_table['buch']['book'], 3))
  0.889
  >>> print(round(ibm1.translation_table['das']['book'], 3))
  0.062
  >>> print(round(ibm1.translation_table['buch'][None], 3))
  0.113
  >>> print(round(ibm1.translation_table['ja'][None], 3))
  0.073
  
  >>> test_sentence = bitext[2]
  >>> test_sentence.words
  ['das', 'buch', 'ist', 'ja', 'klein']
  >>> test_sentence.mots
  ['the', 'book', 'is', 'small']
  >>> test_sentence.alignment
  Alignment([(0, 0), (1, 1), (2, 2), (3, 2), (4, 3)])
docstr: Train on ``sentence_aligned_corpus`` and create a lexical
  translation model.
  
  Translation direction is from ``AlignedSent.mots`` to
  ``AlignedSent.words``.
  
  :param sentence_aligned_corpus: Sentence-aligned parallel corpus
  :type sentence_aligned_corpus: list(AlignedSent)
  
  :param iterations: Number of iterations to run training algorithm
  :type iterations: int
  
  :param probability_tables: 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, the following entry must be present:
      ``translation_table``.
      See ``IBMModel`` for the type and purpose of this table.
  :type probability_tables: dict[str]: object
docstr_tok: ["Train","on","``","sentence_aligned_corpus","``","and","create","a","lexical","translation","model",".","Translation","direction","is","from","``","AlignedSent.mots","``","to","``","AlignedSent.words","``",".",":","param","sentence_aligned_corpus",":","Sentence-aligned","parallel","corpus",":","type","sentence_aligned_corpus",":","list","(","AlignedSent",")",":","param","iterations",":","Number","of","iterations","to","run","training","algorithm",":","type","iterations",":","int",":","param","probability_tables",":","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",",","the","following","entry","must","be","present",":","``","translation_table","``",".","See","``","IBMModel","``","for","the","type","and","purpose","of","this","table",".",":","type","probability_tables",":","dict","[","str","]",":","object"]
code: def __init__(
      self, sentence_aligned_corpus, iterations, probability_tables=None
  ):
      """
      Train on ``sentence_aligned_corpus`` and create a lexical
      translation model.
  
      Translation direction is from ``AlignedSent.mots`` to
      ``AlignedSent.words``.
  
      :param sentence_aligned_corpus: Sentence-aligned parallel corpus
      :type sentence_aligned_corpus: list(AlignedSent)
  
      :param iterations: Number of iterations to run training algorithm
      :type iterations: int
  
      :param probability_tables: 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, the following entry must be present:
          ``translation_table``.
          See ``IBMModel`` for the type and purpose of this table.
      :type probability_tables: dict[str]: object
      """
      super().__init__(sentence_aligned_corpus)
  
      if probability_tables is None:
          self.set_uniform_probabilities(sentence_aligned_corpus)
      else:
          # Set user-defined probabilities
          self.translation_table = probability_tables[
              "translation_table"
          ]
  
      for n in range(0, iterations):
          self.train(sentence_aligned_corpus)
  
      self.align_all(sentence_aligned_corpus)
  
file_path: nltk/nltk/translate/ibm1.py
imports: import warnings
  from collections import defaultdict
  from nltk.translate import AlignedSent, Alignment, IBMModel
  from nltk.translate.ibm_model import Counts
label_desc: Use image node_id 1 to create a new IBMModel1 object from inherited base classes: IBMModel with example: obj = IBMModel1(sentence_aligned_corpus, iterations, probability_tables)