class_docstr: Translation model that keeps track of vacant positions in the target
  sentence to decide where to place translated words
  
  >>> bitext = []
  >>> bitext.append(AlignedSent(['klein', 'ist', 'das', 'haus'], ['the', 'house', 'is', 'small']))
  >>> bitext.append(AlignedSent(['das', 'haus', 'war', 'ja', 'groß'], ['the', 'house', 'was', 'big']))
  >>> bitext.append(AlignedSent(['das', 'buch', 'ist', 'ja', 'klein'], ['the', 'book', 'is', 'small']))
  >>> bitext.append(AlignedSent(['ein', 'haus', 'ist', 'klein'], ['a', 'house', 'is', 'small']))
  >>> bitext.append(AlignedSent(['das', 'haus'], ['the', 'house']))
  >>> bitext.append(AlignedSent(['das', 'buch'], ['the', 'book']))
  >>> bitext.append(AlignedSent(['ein', 'buch'], ['a', 'book']))
  >>> bitext.append(AlignedSent(['ich', 'fasse', 'das', 'buch', 'zusammen'], ['i', 'summarize', 'the', 'book']))
  >>> bitext.append(AlignedSent(['fasse', 'zusammen'], ['summarize']))
  >>> src_classes = {'the': 0, 'a': 0, 'small': 1, 'big': 1, 'house': 2, 'book': 2, 'is': 3, 'was': 3, 'i': 4, 'summarize': 5 }
  >>> trg_classes = {'das': 0, 'ein': 0, 'haus': 1, 'buch': 1, 'klein': 2, 'groß': 2, 'ist': 3, 'war': 3, 'ja': 4, 'ich': 5, 'fasse': 6, 'zusammen': 6 }
  
  >>> ibm5 = IBMModel5(bitext, 5, src_classes, trg_classes)
  
  >>> print(round(ibm5.head_vacancy_table[1][1][1], 3))
  1.0
  >>> print(round(ibm5.head_vacancy_table[2][1][1], 3))
  0.0
  >>> print(round(ibm5.non_head_vacancy_table[3][3][6], 3))
  1.0
  
  >>> print(round(ibm5.fertility_table[2]['summarize'], 3))
  1.0
  >>> print(round(ibm5.fertility_table[1]['book'], 3))
  1.0
  
  >>> print(round(ibm5.p1, 3))
  0.033
  
  >>> 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, None), (4, 3)])
docstr: Set vacancy probabilities uniformly to
  1 / cardinality of vacancy difference values
docstr_tok: ["Set","vacancy","probabilities","uniformly","to","1","\/","cardinality","of","vacancy","difference","values"]
code: def set_uniform_probabilities(self, sentence_aligned_corpus):
      """
      Set vacancy probabilities uniformly to
      1 / cardinality of vacancy difference values
      """
      max_m = longest_target_sentence_length(sentence_aligned_corpus)
  
      # The maximum vacancy difference occurs when a word is placed in
      # the last available position m of the target sentence and the
      # previous word position has no vacancies.
      # The minimum is 1-max_v, when a word is placed in the first
      # available position and the previous word is placed beyond the
      # last available position.
      # Thus, the number of possible vacancy difference values is
      # (max_v) - (1-max_v) + 1 = 2 * max_v.
      if max_m > 0 and (1 / (2 * max_m)) < IBMModel.MIN_PROB:
          warnings.warn(
              "A target sentence is too long ("
              + str(max_m)
              + " words). Results may be less accurate."
          )
  
      for max_v in range(1, max_m + 1):
          for dv in range(1, max_m + 1):
              initial_prob = 1 / (2 * max_v)
              self.head_vacancy_table[dv][max_v] = defaultdict(
                  lambda: initial_prob
              )
              self.head_vacancy_table[-(dv - 1)][max_v] = defaultdict(
                  lambda: initial_prob
              )
              self.non_head_vacancy_table[dv][max_v] = defaultdict(
                  lambda: initial_prob
              )
              self.non_head_vacancy_table[-(dv - 1)][
                  max_v
              ] = defaultdict(lambda: initial_prob)
  
imports: import warnings
  from collections import defaultdict
  from math import factorial
  from nltk.translate import AlignedSent, Alignment, IBMModel, IBMModel4
  from nltk.translate.ibm_model import Counts, longest_target_sentence_length
label_desc: Use image node_id 3 for calling the IBMModel5 obj's underlying member method code with example usage: obj.set_uniform_probabilities(sentence_aligned_corpus) without return types