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: Get top-N nearest neighbours for a word
  Args:
      index (int): ID of the word for which we're finding the nearest neighbours
      topn (int): Used for specifying N nearest neighbours
  Returns:
      neighbours (list[int]): List of indices of the nearest neighbours
docstr_tok: ["Get","top-N","nearest","neighbours","for","a","word","Args",":","index","(","int",")",":","ID","of","the","word","for","which","we","'re","finding","the","nearest","neighbours","topn","(","int",")",":","Used","for","specifying","N","nearest","neighbours","Returns",":","neighbours","(","list","[","int","]",")",":","List","of","indices","of","the","nearest","neighbours"]
code: def nearest_neighbours(self, index, topn, return_words=True):
      """
      Get top-N nearest neighbours for a word
      Args:
          index (int): ID of the word for which we're finding the nearest neighbours
          topn (int): Used for specifying N nearest neighbours
      Returns:
          neighbours (list[int]): List of indices of the nearest neighbours
      """
      word = self.keyed_vectors.index_to_key[index]
      return [
          self.word2index(i[0])
          for i in self.keyed_vectors.similar_by_word(word, topn)
      ]
  
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 7 for calling the GensimWordEmbedding obj's underlying member method code with example usage: obj.nearest_neighbours(index, topn, return_words) and returns: unknown