class_docstr: Embedding Coherence Test (ECT) score measures if groups of words
  have stereotypical associations by computing the Spearman Coefficient
  of lists of attribute embeddings sorted based on their similarity to
  target embeddings.
  
  Based on: Dev, S., & Phillips, J.M. (2019). [Attenuating Bias in Word Vectors]
  (https://api.semanticscholar.org/CorpusID:59158788). AISTATS.
class_docstr_tok: ["Embedding","Coherence","Test","(","ECT",")","score","measures","if","groups","of","words","have","stereotypical","associations","by","computing","the","Spearman","Coefficient","of","lists","of","attribute","embeddings","sorted","based","on","their","similarity","to","target","embeddings",".","Based","on",":","Dev",",","S.",",","&","Phillips",",","J.M",".","(","2019",")",".","[","Attenuating","Bias","in","Word","Vectors","]","(","https",":","\/\/api.semanticscholar.org\/CorpusID:59158788",")",".","AISTATS","."]
code: def spearman_correlation(self, x: torch.Tensor, y: torch.Tensor):
      x_rank = self._get_ranks(x)
      y_rank = self._get_ranks(y)
  
      n = x.size(0)
      upper = 6 * torch.sum((x_rank - y_rank).pow(2))
      down = n * (n**2 - 1.0)
      return 1.0 - (upper / down)
  
imports: from typing import Optional, Dict, Union, List
  import torch
  import torch.distributed
  from allennlp.common.util import is_distributed
  from allennlp.common.checks import ConfigurationError
  from allennlp.nn.util import dist_reduce_sum
  from allennlp.training.metrics.metric import Metric
label_desc: Use image node_id 3 for calling the EmbeddingCoherenceTest obj's underlying member method code with example usage: obj.spearman_correlation(x, y) and returns: unknown