code: def __call__(
      self, batched_top_spans, batched_metadata  # type: ignore
  ):
      for top_spans, metadata in izip(
          batched_top_spans.data.tolist(), batched_metadata
      ):
          gold_mentions = set(
              [
                  mention
                  for cluster in metadata["clusters"]
                  for mention in cluster
              ]
          )
          predicted_spans = set(
              (span[0], span[1]) for span in top_spans
          )
          self._num_gold_mentions += len(gold_mentions)
          self._num_recalled_mentions += len(
              gold_mentions & predicted_spans
          )
  
file_path: magnitude/pymagnitude/third_party/allennlp/training/metrics/mention_recall.py
imports: from __future__ import division
  from __future__ import absolute_import
  import torch
  from allennlp.training.metrics.metric import Metric
label_desc: Use image node_id 2 for calling the MentionRecall obj's underlying member method code with example usage: obj.__call__(batched_top_spans, batched_metadata) without return types