class_docstr: Wraps Gensim's `models.keyedvectors` module
  (https://radimrehurek.com/gensim/models/keyedvectors.html)
class_docstr_tok: ["Wraps","Gensim","'s","`","models.keyedvectors","`","module","(","https",":","\/\/radimrehurek.com\/gensim\/models\/keyedvectors.html",")"]
docstr: Return cosine similarity between vector for word `a` and vector for
  word `b`.
  
  Since this is a metric, `get_mse_dist(a,b)` and `get_mse_dist(b,a)` should return the same value.
  Args:
      a (Union[str|int]): Either word or integer presenting the id of the word
      b (Union[str|int]): Either word or integer presenting the id of the word
  Returns:
      distance (float): cosine similarity
docstr_tok: ["Return","cosine","similarity","between","vector","for","word","`","a","`","and","vector","for","word","`","b","`",".","Since","this","is","a","metric",",","`","get_mse_dist","(","a",",","b",")","`","and","`","get_mse_dist","(","b",",","a",")","`","should","return","the","same","value",".","Args",":","a","(","Union","[","str|int","]",")",":","Either","word","or","integer","presenting","the","id","of","the","word","b","(","Union","[","str|int","]",")",":","Either","word","or","integer","presenting","the","id","of","the","word","Returns",":","distance","(","float",")",":","cosine","similarity"]
code: def get_cos_sim(self, a, b):
      """Return cosine similarity between vector for word `a` and vector for
      word `b`.
  
      Since this is a metric, `get_mse_dist(a,b)` and `get_mse_dist(b,a)` should return the same value.
      Args:
          a (Union[str|int]): Either word or integer presenting the id of the word
          b (Union[str|int]): Either word or integer presenting the id of the word
      Returns:
          distance (float): cosine similarity
      """
      if not isinstance(a, str):
          a = self.keyed_vectors.index_to_key[a]
      if not isinstance(b, str):
          b = self.keyed_vectors.index_to_key[b]
      cos_sim = self.keyed_vectors.similarity(a, b)
      return cos_sim
  
imports: from abc import ABC, abstractmethod
  from collections import defaultdict
  import os
  import pickle
  import numpy
  import torch
  from textattack.shared import utils
label_desc: Use image node_id 6 for calling the GensimWordEmbedding obj's underlying member method code with example usage: obj.get_cos_sim(a, b) and returns: cos_sim