class_docstr: Rouge interface for Rouge-L and Rouge-N
class_docstr_tok: ["Rouge","interface","for","Rouge-L","and","Rouge-N"]
code: def __init__(
      self,
      multiref: str = "average",
      alpha: float = 0,
      output_transform: Callable = lambda x: x,
      device: Union[str, torch.device] = torch.device("cpu"),
  ) -> None:
      super(_BaseRouge, self).__init__(
          output_transform=output_transform, device=device
      )
      self._alpha = alpha
      if not 0 <= self._alpha <= 1:
          raise ValueError(
              f"alpha must be in interval [0, 1] (got : {self._alpha})"
          )
      self._multiref = multiref
      valid_multiref = ["best", "average"]
      if self._multiref not in valid_multiref:
          raise ValueError(
              f"multiref : valid values are {valid_multiref} (got : {self._multiref})"
          )
      self._mutliref_reducer = self._get_multiref_reducer()
  
imports: from abc import ABCMeta, abstractmethod
  from collections import namedtuple
  from typing import Any, Callable, List, Mapping, Optional, Sequence, Tuple, Union
  import torch
  from ignite.exceptions import NotComputableError
  from ignite.metrics import Metric
  from ignite.metrics.metric import reinit__is_reduced, sync_all_reduce
  from ignite.metrics.nlp.utils import lcs, ngrams
label_desc: Use image node_id 1 to create a new _BaseRouge object from inherited base classes: Metric with example: obj = _BaseRouge(multiref, alpha, output_transform, device)