class_docstr: Helper data object for training IBM Models 3 and up
  
  Read-only. For a source sentence and its counterpart in the target
  language, this class holds information about the sentence pair's
  alignment, cepts, and fertility.
  
  Warning: Alignments are one-indexed here, in contrast to
  nltk.translate.Alignment and AlignedSent, which are zero-indexed
  This class is not meant to be used outside of IBM models.
class_docstr_tok: ["Helper","data","object","for","training","IBM","Models","3","and","up","Read-only",".","For","a","source","sentence","and","its","counterpart","in","the","target","language",",","this","class","holds","information","about","the","sentence","pair's","alignment",",","cepts",",","and","fertility",".","Warning",":","Alignments","are","one-indexed","here",",","in","contrast","to","nltk.translate.Alignment","and","AlignedSent",",","which","are","zero-indexed","This","class","is","not","meant","to","be","used","outside","of","IBM","models","."]
code: def __init__(self, alignment, src_sentence, trg_sentence, cepts):
      if not isinstance(alignment, tuple):
          raise TypeError(
              "The alignment must be a tuple because it is used "
              "to uniquely identify AlignmentInfo objects."
          )
  
      self.alignment = alignment
      """
          tuple(int): Alignment function. ``alignment[j]`` is the position
          in the source sentence that is aligned to the position j in the
          target sentence.
          """
  
      self.src_sentence = src_sentence
      """
          tuple(str): Source sentence referred to by this object.
          Should include NULL token (None) in index 0.
          """
  
      self.trg_sentence = trg_sentence
      """
          tuple(str): Target sentence referred to by this object.
          Should have a dummy element in index 0 so that the first word
          starts from index 1.
          """
  
      self.cepts = cepts
      """
          list(list(int)): The positions of the target words, in
          ascending order, aligned to a source word position. For example,
          cepts[4] = (2, 3, 7) means that words in positions 2, 3 and 7
          of the target sentence are aligned to the word in position 4 of
          the source sentence
          """
  
      self.score = None
      """
          float: Optional. Probability of alignment, as defined by the
          IBM model that assesses this alignment
          """
  
imports: from bisect import insort_left
  from collections import defaultdict
  from copy import deepcopy
  from math import ceil
label_desc: Use image node_id 1 to create a new AlignmentInfo object  with example: obj = AlignmentInfo(alignment, src_sentence, trg_sentence, cepts)