class_docstr: Collects information on gold and predicted clusters across documents.
  Can be used to retrieve weighted LEA-score for them.
docstr: Calculates LEA for the document's clusters and stores them to later
  output weighted LEA across documents.
  
  Returns:
      LEA score for the document as a tuple of (f1, precision, recall)
docstr_tok: ["Calculates","LEA","for","the","document","'s","clusters","and","stores","them","to","later","output","weighted","LEA","across","documents",".","Returns",":","LEA","score","for","the","document","as","a","tuple","of","(","f1",",","precision",",","recall",")"]
code: def add_predictions(
      self,
      gold_clusters: List[List[Hashable]],
      pred_clusters: List[List[Hashable]],
  ):
      """
      Calculates LEA for the document's clusters and stores them to later
      output weighted LEA across documents.
  
      Returns:
          LEA score for the document as a tuple of (f1, precision, recall)
      """
      recall, r_weight = ClusterChecker._lea(
          gold_clusters, pred_clusters
      )
      precision, p_weight = ClusterChecker._lea(
          pred_clusters, gold_clusters
      )
  
      self._r += recall
      self._r_weight += r_weight
      self._p += precision
      self._p_weight += p_weight
  
      doc_precision = precision / (p_weight + EPSILON)
      doc_recall = recall / (r_weight + EPSILON)
      doc_f1 = (
          (doc_precision * doc_recall)
          / (doc_precision + doc_recall + EPSILON)
          * 2
      )
      return doc_f1, doc_precision, doc_recall
  
imports: from typing import Hashable, List, Tuple
  from stanza.models.coref.const import EPSILON
label_desc: Use image node_id 2 for calling the ClusterChecker obj's underlying member method code with example usage: obj.add_predictions(gold_clusters, pred_clusters) and returns: doc_f1,  doc_precision,  doc_recall