class_docstr: Lexical translation model that considers 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']))
  
  >>> ibm2 = IBMModel2(bitext, 5)
  
  >>> print(round(ibm2.translation_table['buch']['book'], 3))
  1.0
  >>> print(round(ibm2.translation_table['das']['book'], 3))
  0.0
  >>> print(round(ibm2.translation_table['buch'][None], 3))
  0.0
  >>> print(round(ibm2.translation_table['ja'][None], 3))
  0.0
  
  >>> print(round(ibm2.alignment_table[1][1][2][2], 3))
  0.939
  >>> print(round(ibm2.alignment_table[1][2][2][2], 3))
  0.0
  >>> print(round(ibm2.alignment_table[2][2][4][5], 3))
  1.0
  
  >>> 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)])
class_docstr_tok: ["Lexical","translation","model","that","considers","word","order",">",">",">","bitext","=","[","]",">",">",">","bitext.append","(","AlignedSent","(","[","'klein","'",",","'ist","'",",","'das","'",",","'haus","'","]",",","[","'the","'",",","'house","'",",","'is","'",",","'small","'","]",")",")",">",">",">","bitext.append","(","AlignedSent","(","[","'das","'",",","'haus","'",",","'ist","'",",","'ja","'",",","'gro\u00df","'","]",",","[","'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","'","]",")",")",">",">",">","ibm2","=","IBMModel2","(","bitext",",","5",")",">",">",">","print","(","round","(","ibm2.translation_table","[","'buch","'","]","[","'book","'","]",",","3",")",")","1.0",">",">",">","print","(","round","(","ibm2.translation_table","[","'das","'","]","[","'book","'","]",",","3",")",")","0.0",">",">",">","print","(","round","(","ibm2.translation_table","[","'buch","'","]","[","None","]",",","3",")",")","0.0",">",">",">","print","(","round","(","ibm2.translation_table","[","'ja","'","]","[","None","]",",","3",")",")","0.0",">",">",">","print","(","round","(","ibm2.alignment_table","[","1","]","[","1","]","[","2","]","[","2","]",",","3",")",")","0.939",">",">",">","print","(","round","(","ibm2.alignment_table","[","1","]","[","2","]","[","2","]","[","2","]",",","3",")",")","0.0",">",">",">","print","(","round","(","ibm2.alignment_table","[","2","]","[","2","]","[","4","]","[","5","]",",","3",")",")","1.0",">",">",">","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",")","]",")"]
code: def align_all(self, parallel_corpus):
      for sentence_pair in parallel_corpus:
          self.align(sentence_pair)
  
imports: import warnings
  from collections import defaultdict
  from nltk.translate import AlignedSent, Alignment, IBMModel, IBMModel1
  from nltk.translate.ibm_model import Counts
label_desc: Use image node_id 8 for calling the IBMModel2 obj's underlying member method code with example usage: obj.align_all(parallel_corpus) without return types