code: def visualize(
      cls, ref: List[str], hypo: Dict[str, List[str]], ref_idx: int
  ) -> Dict[str, List[str]]:
      hypo_ids = sorted(hypo.keys())
      rendered = {k: [] for k in hypo_ids}
      for i, r in enumerate(ref):
          ref_tokens = r.split()
          hypo_tokens = {
              h_id: hypo[h_id][i].split() for h_id in hypo_ids
          }
          alignments = VizseqRefHypoTextAligner.align(
              ref_tokens, hypo_tokens
          )
          visualized = VizseqRefHypoTextAligner.to_span_html(
              hypo_tokens, alignments, "hypo", i, f"ref_{ref_idx}"
          )
          for h_id in hypo_ids:
              sent_markup = Markup(" ".join(visualized[h_id]))
              rendered[h_id].append(sent_markup)
      return rendered
  
file_path: vizseq/vizseq/_visualizers/seq_visualizer.py
imports: from typing import Dict, List
  from jinja2 import Markup
  from vizseq._aligners import VizseqSrcRefTextAligner, VizseqRefHypoTextAligner
label_desc: Use image node_id 1 for calling the VizSeqHypoVisualizer obj's underlying member method code with example usage: obj.visualize(cls, ref, hypo, ref_idx) and returns: rendered