class_docstr: `Calculate Rouge Score`_, used for automatic summarization.
  
  This implementation should imitate the behaviour of the ``rouge-score`` package `Python ROUGE Implementation`
  
  As input to ``forward`` and ``update`` the metric accepts the following input:
  
  - ``preds`` (:class:`~Sequence`): An iterable of predicted sentences or a single predicted sentence
  - ``target`` (:class:`~Sequence`): An iterable of target sentences
    or an iterable of interables of target sentences
    or a single target sentence
  
  As output of ``forward`` and ``compute`` the metric returns the following output:
  
  - ``rouge`` (:class:`~Dict`): A dictionary of tensor rouge scores for each input str rouge key
  
  Args:
      use_stemmer: Use Porter stemmer to strip word suffixes to improve matching.
      normalizer: A user's own normalizer function.
          If this is ``None``, replacing any non-alpha-numeric characters with spaces is default.
          This function must take a ``str`` and return a ``str``.
      tokenizer:
          A user's own tokenizer function. If this is ``None``, splitting by spaces is default
          This function must take a ``str`` and return ``Sequence[str]``
      accumulate:
          Useful in case of multi-reference rouge score.
  
          - ``avg`` takes the avg of all references with respect to predictions
          - ``best`` takes the best fmeasure score obtained between prediction and multiple corresponding references.
  
      rouge_keys: A list of rouge types to calculate.
          Keys that are allowed are ``rougeL``, ``rougeLsum``, and ``rouge1`` through ``rouge9``.
      kwargs: Additional keyword arguments, see :ref:`Metric kwargs` for more info.
  
  Example:
      >>> from torchmetrics.text.rouge import ROUGEScore
      >>> preds = "My name is John"
      >>> target = "Is your name John"
      >>> rouge = ROUGEScore()
      >>> from pprint import pprint
      >>> pprint(rouge(preds, target))
      {'rouge1_fmeasure': tensor(0.7500),
       'rouge1_precision': tensor(0.7500),
       'rouge1_recall': tensor(0.7500),
       'rouge2_fmeasure': tensor(0.),
       'rouge2_precision': tensor(0.),
       'rouge2_recall': tensor(0.),
       'rougeL_fmeasure': tensor(0.5000),
       'rougeL_precision': tensor(0.5000),
       'rougeL_recall': tensor(0.5000),
       'rougeLsum_fmeasure': tensor(0.5000),
       'rougeLsum_precision': tensor(0.5000),
       'rougeLsum_recall': tensor(0.5000)}
  
  
  Raises:
      ValueError:
          If the python packages ``nltk`` is not installed.
      ValueError:
          If any of the ``rouge_keys`` does not belong to the allowed set of keys.
docstr: Plot a single or multiple values from the metric.
  
  Args:
      val: Either a single result from calling `metric.forward` or `metric.compute` or a list of these results.
          If no value is provided, will automatically call `metric.compute` and plot that result.
      ax: An matplotlib axis object. If provided will add plot to that axis
  
  Returns:
      Figure and Axes object
  
  Raises:
      ModuleNotFoundError:
          If `matplotlib` is not installed
  
  .. plot::
      :scale: 75
  
      >>> # Example plotting a single value
      >>> from torchmetrics.text.rouge import ROUGEScore
      >>> metric = ROUGEScore()
      >>> preds = "My name is John"
      >>> target = "Is your name John"
      >>> metric.update(preds, target)
      >>> fig_, ax_ = metric.plot()
  
  .. plot::
      :scale: 75
  
      >>> # Example plotting multiple values
      >>> from torchmetrics.text.rouge import ROUGEScore
      >>> metric = ROUGEScore()
      >>> preds = "My name is John"
      >>> target = "Is your name John"
      >>> values = [ ]
      >>> for _ in range(10):
      ...     values.append(metric(preds, target))
      >>> fig_, ax_ = metric.plot(values)
docstr_tok: ["Plot","a","single","or","multiple","values","from","the","metric",".","Args",":","val",":","Either","a","single","result","from","calling","`","metric.forward","`","or","`","metric.compute","`","or","a","list","of","these","results",".","If","no","value","is","provided",",","will","automatically","call","`","metric.compute","`","and","plot","that","result",".","ax",":","An","matplotlib","axis","object",".","If","provided","will","add","plot","to","that","axis","Returns",":","Figure","and","Axes","object","Raises",":","ModuleNotFoundError",":","If","`","matplotlib","`","is","not","installed","..","plot",":",":",":","scale",":","75",">",">",">","#","Example","plotting","a","single","value",">",">",">","from","torchmetrics.text.rouge","import","ROUGEScore",">",">",">","metric","=","ROUGEScore","(",")",">",">",">","preds","=","``","My","name","is","John","''",">",">",">","target","=","``","Is","your","name","John","''",">",">",">","metric.update","(","preds",",","target",")",">",">",">","fig_",",","ax_","=","metric.plot","(",")","..","plot",":",":",":","scale",":","75",">",">",">","#","Example","plotting","multiple","values",">",">",">","from","torchmetrics.text.rouge","import","ROUGEScore",">",">",">","metric","=","ROUGEScore","(",")",">",">",">","preds","=","``","My","name","is","John","''",">",">",">","target","=","``","Is","your","name","John","''",">",">",">","values","=","[","]",">",">",">","for","_","in","range","(","10",")",":","...","values.append","(","metric","(","preds",",","target",")",")",">",">",">","fig_",",","ax_","=","metric.plot","(","values",")"]
code: def plot(
      self,
      val: Optional[Union[Tensor, Sequence[Tensor]]] = None,
      ax: Optional[_AX_TYPE] = None,
  ) -> _PLOT_OUT_TYPE:
      """Plot a single or multiple values from the metric.
  
      Args:
          val: Either a single result from calling `metric.forward` or `metric.compute` or a list of these results.
              If no value is provided, will automatically call `metric.compute` and plot that result.
          ax: An matplotlib axis object. If provided will add plot to that axis
  
      Returns:
          Figure and Axes object
  
      Raises:
          ModuleNotFoundError:
              If `matplotlib` is not installed
  
      .. plot::
          :scale: 75
  
          >>> # Example plotting a single value
          >>> from torchmetrics.text.rouge import ROUGEScore
          >>> metric = ROUGEScore()
          >>> preds = "My name is John"
          >>> target = "Is your name John"
          >>> metric.update(preds, target)
          >>> fig_, ax_ = metric.plot()
  
      .. plot::
          :scale: 75
  
          >>> # Example plotting multiple values
          >>> from torchmetrics.text.rouge import ROUGEScore
          >>> metric = ROUGEScore()
          >>> preds = "My name is John"
          >>> target = "Is your name John"
          >>> values = [ ]
          >>> for _ in range(10):
          ...     values.append(metric(preds, target))
          >>> fig_, ax_ = metric.plot(values)
  
      """
      return self._plot(val, ax)
  
file_path: torchmetrics/src/torchmetrics/text/rouge.py
imports: from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union
  from torch import Tensor
  from typing_extensions import Literal
  from torchmetrics import Metric
  from torchmetrics.functional.text.rouge import ALLOWED_ACCUMULATE_VALUES, ALLOWED_ROUGE_KEYS, _rouge_score_compute, _rouge_score_update
  from torchmetrics.utilities.imports import _MATPLOTLIB_AVAILABLE, _NLTK_AVAILABLE
  from torchmetrics.utilities.plot import _AX_TYPE, _PLOT_OUT_TYPE
label_desc: Use image node_id 5 for calling the ROUGEScore obj's underlying member method code with example usage: obj.plot(val, ax) and returns: self