code: def sentence_ter_one_ref(hypothesis: str, reference: str) -> float:
      hypo_tokens, ref_tokens = hypothesis.split(), reference.split()
      n_shifts = 0
      prev_n_edits = get_edit_distance(hypo_tokens, ref_tokens)
      while True:
          new_n_edits, new_tokens = _shift(hypo_tokens, ref_tokens)
          if prev_n_edits - new_n_edits <= 0:
              break
          n_shifts += 1
          prev_n_edits = new_n_edits
          hypo_tokens = new_tokens
      return (n_shifts + prev_n_edits) / len(ref_tokens)
  
file_path: vizseq/vizseq/scorers/_ter.py
imports: from typing import List, Tuple
  from functools import lru_cache
label_desc: Use image node_id 5 for calling a global function with example usage: sentence_ter_one_ref(hypothesis, reference) and returns: unknown