class_docstr: Collects information on gold and predicted clusters across documents.
  Can be used to retrieve weighted LEA-score for them.
docstr: See aclweb.org/anthology/P16-1060.pdf. 
docstr_tok: ["See","aclweb.org\/anthology\/P16-1060.pdf","."]
code: def _lea(
      key: List[List[Hashable]], response: List[List[Hashable]]
  ) -> Tuple[float, float]:
      """See aclweb.org/anthology/P16-1060.pdf."""
      response_clusters = [set(cluster) for cluster in response]
      response_map = {
          mention: cluster
          for cluster in response_clusters
          for mention in cluster
      }
      importances = []
      resolutions = []
      for entity in key:
          size = len(entity)
          if size == 1:  # entities of size 1 are not annotated
              continue
          importances.append(size)
          correct_links = 0
          for i in range(size):
              for j in range(i + 1, size):
                  correct_links += int(
                      entity[i] in response_map.get(entity[j], {})
                  )
          resolutions.append(correct_links / (size * (size - 1) / 2))
      res = sum(imp * res for imp, res in zip(importances, resolutions))
      weight = sum(importances)
      return res, weight
  
imports: from typing import Hashable, List, Tuple
  from stanza.models.coref.const import EPSILON
label_desc: Use image node_id 4 for calling the ClusterChecker obj's underlying member method code with example usage: obj._lea(key, response) and returns: res,  weight