code: def _get_sent_rouge(
      hypothesis: List[str],
      references: List[List[str]],
      rouge_type: str,
      extra_args: Optional[Dict[str, str]] = None,
  ) -> List[float]:
      assert rouge_type in {"rouge-1", "rouge-2", "rouge-l"}
      _rouge_type = "rouge-l" if rouge_type == "rouge-l" else "rouge-n"
      _max_n = 1 if rouge_type == "rouge-1" else 2
      joint_references = [list(r) for r in zip(*references)]
      scores = _rouge.Rouge(
          metrics=[_rouge_type], max_n=_max_n, apply_avg=False
      ).get_scores(hypothesis, joint_references)
      return [s[STATS_TYPE][0] for s in scores[rouge_type]]
  
file_path: vizseq/vizseq/scorers/rouge.py
imports: from typing import List, Optional, Dict
  import rouge
  import nltk
  from vizseq.scorers import register_scorer, VizSeqScorer, VizSeqScore
label_desc: Use image node_id 1 for calling a global function with example usage: _get_sent_rouge(hypothesis, references, rouge_type, extra_args) and returns: unknown