code: def get_alignments(attention_matrix: np.ndarray, threshold: float = .9) -> Iterator[Tuple[int, int]]:
      
      for src_idx in range(attention_matrix.shape[1]):
          for trg_idx in range(attention_matrix.shape[0]):
              if attention_matrix[trg_idx, src_idx] > threshold:
                  yield (src_idx, trg_idx)
docs: Yields hard alignments from an attention_matrix (target_length, source_length)
      given a threshold.
  
      :param attention_matrix: The attention matrix.
      :param threshold: The threshold for including an alignment link in the result.
      :return: Generator yielding strings of the form 0-0, 0-1, 2-1, 2-2, 3-4...