class_docstr: Recall-Oriented Understudy for Gisting Evaluation (ROUGE)
  
  ROUGE is a metric for measuring the quality of summaries. It is based on calculating the recall
  between ngrams in the predicted summary and a set of reference summaries. See [Lin,
  "ROUGE: A Package For Automatic Evaluation Of Summaries", 2004]
  (https://api.semanticscholar.org/CorpusID:964287).
  
  # Parameters
  
  ngram_size : `int`, optional (default = `2`)
      ROUGE scores are calculate for ROUGE-1 .. ROUGE-`ngram_size`
  exclude_indices : `Set[int]`, optional (default = `None`)
      Indices to exclude when calculating ngrams. This should usually include
      the indices of the start, end, and pad tokens.
class_docstr_tok: ["Recall-Oriented","Understudy","for","Gisting","Evaluation","(","ROUGE",")","ROUGE","is","a","metric","for","measuring","the","quality","of","summaries",".","It","is","based","on","calculating","the","recall","between","ngrams","in","the","predicted","summary","and","a","set","of","reference","summaries",".","See","[","Lin",",","''","ROUGE",":","A","Package","For","Automatic","Evaluation","Of","Summaries","''",",","2004","]","(","https",":","\/\/api.semanticscholar.org\/CorpusID:964287",")",".","#","Parameters","ngram_size",":","`","int","`",",","optional","(","default","=","`","2","`",")","ROUGE","scores","are","calculate","for","ROUGE-1","..","ROUGE-","`","ngram_size","`","exclude_indices",":","`","Set","[","int","]","`",",","optional","(","default","=","`","None","`",")","Indices","to","exclude","when","calculating","ngrams",".","This","should","usually","include","the","indices","of","the","start",",","end",",","and","pad","tokens","."]
docstr: Update recall counts.
  
  # Parameters
  
  predictions : `torch.LongTensor`
      Batched predicted tokens of shape `(batch_size, max_sequence_length)`.
  references : `torch.LongTensor`
      Batched reference (gold) sequences with shape `(batch_size, max_gold_sequence_length)`.
  
  # Returns
  
  None
docstr_tok: ["Update","recall","counts",".","#","Parameters","predictions",":","`","torch.LongTensor","`","Batched","predicted","tokens","of","shape","`","(","batch_size",",","max_sequence_length",")","`",".","references",":","`","torch.LongTensor","`","Batched","reference","(","gold",")","sequences","with","shape","`","(","batch_size",",","max_gold_sequence_length",")","`",".","#","Returns","None"]
code: def __call__(
      self,  # type: ignore
      predictions: torch.LongTensor,
      gold_targets: torch.LongTensor,
      mask: Optional[torch.BoolTensor] = None,
  ) -> None:
      """
      Update recall counts.
  
      # Parameters
  
      predictions : `torch.LongTensor`
          Batched predicted tokens of shape `(batch_size, max_sequence_length)`.
      references : `torch.LongTensor`
          Batched reference (gold) sequences with shape `(batch_size, max_gold_sequence_length)`.
  
      # Returns
  
      None
      """
      if mask is not None:
          raise NotImplementedError(
              "This metric does not support a mask."
          )
  
      # ROUGE-N
      predictions, gold_targets = self.detach_tensors(
          predictions, gold_targets
      )
      for n in range(1, self._ngram_size + 1):
          recall, precision, f1 = self._get_rouge_n_stats(
              predictions, gold_targets, n
          )
          self._total_rouge_n_recalls[n] += recall
          self._total_rouge_n_precisions[n] += precision
          self._total_rouge_n_f1s[n] += f1
  
      # ROUGE-L
      self._total_rouge_l_f1 += self._get_rouge_l_score(
          predictions, gold_targets
      )
  
      sequence_count = len(predictions)
      self._total_sequence_count += dist_reduce_sum(sequence_count)
  
file_path: allennlp/allennlp/training/metrics/rouge.py
imports: from collections import defaultdict
  from typing import Tuple, Dict, Set, Optional
  import torch
  from allennlp.training.metrics.metric import Metric
  from allennlp.nn.util import dist_reduce_sum
label_desc: Use image node_id 6 for calling the ROUGE obj's underlying member method code with example usage: obj.__call__(predictions, gold_targets, mask) without return types