code: def compute_alignments(emission, transcript, dictionary):
      tokens = [
          dictionary[char] for word in transcript for char in word
      ]
      alignment, scores = align(emission, tokens)
      token_spans = F.merge_tokens(alignment, scores)
      word_spans = unflatten(
          token_spans, [len(word) for word in transcript]
      )
      return word_spans
  
file_path: audio/examples/tutorials/ctc_forced_alignment_api_tutorial.py
imports: import torch
  import torchaudio
  import IPython
  import matplotlib.pyplot
  import torchaudio.functional
label_desc: Use image node_id 8 for calling a global function with example usage: compute_alignments(emission, transcript, dictionary) and returns: word_spans