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",">"]
docstr: Counts the mentions in each predicted cluster which need to be re-allocated in
  order for each predicted cluster to be contained by the respective gold cluster.
  <http://aclweb.org/anthology/M/M95/M95-1005.pdf>
docstr_tok: ["Counts","the","mentions","in","each","predicted","cluster","which","need","to","be","re-allocated","in","order","for","each","predicted","cluster","to","be","contained","by","the","respective","gold","cluster",".","<","http",":","\/\/aclweb.org\/anthology\/M\/M95\/M95-1005.pdf",">"]
code: def muc(clusters, mention_to_gold):
      """
      Counts the mentions in each predicted cluster which need to be re-allocated in
      order for each predicted cluster to be contained by the respective gold cluster.
      <http://aclweb.org/anthology/M/M95/M95-1005.pdf>
      """
      true_p, all_p = 0, 0
      for cluster in clusters:
          all_p += len(cluster) - 1
          true_p += len(cluster)
          linked = set()
          for mention in cluster:
              if mention in mention_to_gold:
                  linked.add(mention_to_gold[mention])
              else:
                  true_p -= 1
          true_p -= len(linked)
      return true_p, all_p
  
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 8 for calling the Scorer obj's underlying member method code with example usage: obj.muc(clusters, mention_to_gold) and returns: true_p,  all_p