code: def view_scores(
      references: PathOrPathsOrDictOfStrList,
      hypothesis: Optional[PathOrPathsOrDictOfStrList],
      metrics: List[str],
      tags: Optional[PathOrPathsOrDictOfStrList] = None,
  ):
      _ref = VizSeqDataSources(references)
      _hypo = VizSeqDataSources(hypothesis)
      _tags, tag_set = None, []
      if tags is not None:
          _tags = VizSeqDataSources(tags, text_merged=True)
          tag_set = sorted(_tags.unique())
          _tags = _tags.text
      models = _hypo.names
      all_metrics = get_scorer_ids()
      _metrics = []
      for s in metrics:
          if s in all_metrics:
              _metrics.append(s)
          else:
              logger.warn(f'"{s}" is not a valid metric.')
  
      scores = {
          s: {
              m: get_scorer(s)(
                  corpus_level=True, sent_level=False
              ).score(_hypo.data[i].text, _ref.text, tags=_tags)
              for i, m in enumerate(models)
          }
          for s in _metrics
      }
  
      corpus_scores = {
          s: {m: scores[s][m].corpus_score for m in models}
          for s in _metrics
      }
      group_scores = {
          s: {
              t: {m: scores[s][m].group_scores[t] for m in models}
              for t in tag_set
          }
          for s in _metrics
      }
  
      metrics_and_names = [[s, get_scorer_name(s)] for s in _metrics]
      html = env.get_template("ipynb_scores.html").render(
          metrics_and_names=metrics_and_names,
          models=models,
          tag_set=tag_set,
          corpus_scores=corpus_scores,
          group_scores=group_scores,
          corpus_and_group_score_latex=VizSeqWebView.latex_corpus_group_scores(
              corpus_scores, group_scores
          ),
          corpus_and_group_score_csv=VizSeqWebView.csv_corpus_group_scores(
              corpus_scores, group_scores
          ),
      )
      return HTML(html)
  
file_path: vizseq/vizseq/ipynb/core.py
imports: from typing import List, Optional
  from jinja2 import Environment, PackageLoader, select_autoescape
  import matplotlib.pyplot
  import numpy
  from IPython.display import HTML, display
  from vizseq._data import VizSeqDataSources, PathOrPathsOrDictOfStrList, VizSeqNGrams, VizSeqStats, get_g_translate, set_g_cred_path
  from vizseq._visualizers import SPAN_HIGHTLIGHT_JS
  from vizseq._view import VizSeqDataPageView, VizSeqWebView, VizSeqSortingType, DEFAULT_PAGE_SIZE, DEFAULT_PAGE_NO
  from vizseq.scorers import get_scorer_ids, get_scorer, get_scorer_name
  from vizseq._utils.logger import logger
label_desc: Use image node_id 5 for calling a global function with example usage: view_scores(references, hypothesis, metrics, tags) and returns: HTML