docstr: Parameters
  ----------
  top_spans : ``torch.Tensor``
      (start, end) indices for all spans kept after span pruning in the model.
      Expected shape: (batch_size, num_spans, 2)
  antecedent_indices : ``torch.Tensor``
      For each span, the indices of all allowed antecedents for that span.  This is
      independent of the batch dimension, as it's just based on order in the document.
      Expected shape: (num_spans, num_antecedents)
  predicted_antecedents: ``torch.Tensor``
      For each span, this contains the index (into antecedent_indices) of the most likely
      antecedent for that span.
      Expected shape: (batch_size, num_spans)
  metadata_list : ``List[Dict[str, Any]]``
      A metadata dictionary for each instance in the batch.  We use the "clusters" key from
      this dictionary, which has the annotated gold coreference clusters for that instance.
docstr_tok: ["Parameters","--","--","--","--","--","top_spans",":","``","torch.Tensor","``","(","start",",","end",")","indices","for","all","spans","kept","after","span","pruning","in","the","model",".","Expected","shape",":","(","batch_size",",","num_spans",",","2",")","antecedent_indices",":","``","torch.Tensor","``","For","each","span",",","the","indices","of","all","allowed","antecedents","for","that","span",".","This","is","independent","of","the","batch","dimension",",","as","it","'s","just","based","on","order","in","the","document",".","Expected","shape",":","(","num_spans",",","num_antecedents",")","predicted_antecedents",":","``","torch.Tensor","``","For","each","span",",","this","contains","the","index","(","into","antecedent_indices",")","of","the","most","likely","antecedent","for","that","span",".","Expected","shape",":","(","batch_size",",","num_spans",")","metadata_list",":","``","List","[","Dict","[","str",",","Any","]","]","``","A","metadata","dictionary","for","each","instance","in","the","batch",".","We","use","the","``","clusters","''","key","from","this","dictionary",",","which","has","the","annotated","gold","coreference","clusters","for","that","instance","."]
code: def __call__(
      self,  # type: ignore
      top_spans,
      antecedent_indices,
      predicted_antecedents,
      metadata_list,
  ):
      """
      Parameters
      ----------
      top_spans : ``torch.Tensor``
          (start, end) indices for all spans kept after span pruning in the model.
          Expected shape: (batch_size, num_spans, 2)
      antecedent_indices : ``torch.Tensor``
          For each span, the indices of all allowed antecedents for that span.  This is
          independent of the batch dimension, as it's just based on order in the document.
          Expected shape: (num_spans, num_antecedents)
      predicted_antecedents: ``torch.Tensor``
          For each span, this contains the index (into antecedent_indices) of the most likely
          antecedent for that span.
          Expected shape: (batch_size, num_spans)
      metadata_list : ``List[Dict[str, Any]]``
          A metadata dictionary for each instance in the batch.  We use the "clusters" key from
          this dictionary, which has the annotated gold coreference clusters for that instance.
      """
      (
          top_spans,
          antecedent_indices,
          predicted_antecedents,
      ) = self.unwrap_to_tensors(
          top_spans, antecedent_indices, predicted_antecedents
      )
      for i, metadata in enumerate(metadata_list):
          gold_clusters, mention_to_gold = self.get_gold_clusters(
              metadata["clusters"]
          )
          (
              predicted_clusters,
              mention_to_predicted,
          ) = self.get_predicted_clusters(
              top_spans[i], antecedent_indices, predicted_antecedents[i]
          )
          for scorer in self.scorers:
              scorer.update(
                  predicted_clusters,
                  gold_clusters,
                  mention_to_predicted,
                  mention_to_gold,
              )
  
imports: from __future__ import division
  from __future__ import absolute_import
  from collections import Counter
  from sklearn.utils.linear_assignment_ import linear_assignment
  import numpy
  import torch
  from allennlp.training.metrics.metric import Metric
label_desc: Use image node_id 2 for calling the ConllCorefScores obj's underlying member method code with example usage: obj.__call__(top_spans, antecedent_indices, predicted_antecedents, metadata_list) without return types