class_docstr: Mostly borrowed from <https://github.com/clarkkev/deep-coref/blob/master/evaluation.py>
class_docstr_tok: ["Mostly","borrowed","from","<","https",":","\/\/github.com\/clarkkev\/deep-coref\/blob\/master\/evaluation.py",">"]
code: def update(
      self, predicted, gold, mention_to_predicted, mention_to_gold
  ):
      if self.metric == self.ceafe:
          p_num, p_den, r_num, r_den = self.metric(predicted, gold)
      else:
          p_num, p_den = self.metric(predicted, mention_to_gold)
          r_num, r_den = self.metric(gold, mention_to_predicted)
      self.precision_numerator += p_num
      self.precision_denominator += p_den
      self.recall_numerator += r_num
      self.recall_denominator += r_den
  
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 Scorer obj's underlying member method code with example usage: obj.update(predicted, gold, mention_to_predicted, mention_to_gold) without return types