docstr: Find similar words for a certain word in the vocabulary.
  
  Parameters
  ----------
  word
      Word for which we need to find similar words.
  tag
      Part of speech tag for the words.
  top_n
      Return only `top_n` neighbors.
  
  Returns
  -------
  A dict with two fields. The ``'words'`` field contains a `numpy` array of the `top_n` most similar words,         whereas the fields ``'similarities'`` is a `numpy` array with corresponding word similarities.
docstr_tok: ["Find","similar","words","for","a","certain","word","in","the","vocabulary",".","Parameters","--","--","--","--","--","word","Word","for","which","we","need","to","find","similar","words",".","tag","Part","of","speech","tag","for","the","words",".","top_n","Return","only","`","top_n","`","neighbors",".","Returns","--","--","--","-","A","dict","with","two","fields",".","The","``","'words","'","``","field","contains","a","`","numpy","`","array","of","the","`","top_n","`","most","similar","words",",","whereas","the","fields","``","'similarities","'","``","is","a","`","numpy","`","array","with","corresponding","word","similarities","."]
code: def neighbors(self, word: str, tag: str, top_n: int) -> dict:
      """
          Find similar words for a certain word in the vocabulary.
  
          Parameters
          ----------
          word
              Word for which we need to find similar words.
          tag
              Part of speech tag for the words.
          top_n
              Return only `top_n` neighbors.
  
          Returns
          -------
          A dict with two fields. The ``'words'`` field contains a `numpy` array of the `top_n` most similar words, \
          whereas the fields ``'similarities'`` is a `numpy` array with corresponding word similarities.
          """
  
      # the word itself is excluded so we add one to return the expected number of words
      top_n += 1
  
      texts: List = []
      similarities: List = []
      if word in self.nlp.vocab:
          word_vocab = self.nlp.vocab[word]
          queries = [
              w
              for w in self.to_check
              if w.is_lower == word_vocab.is_lower
          ]
          if word_vocab.prob < self.w_prob:
              queries += [word_vocab]
          by_similarity = sorted(
              queries,
              key=lambda w: word_vocab.similarity(w),
              reverse=True,
          )[: self.n_similar]
  
          # Find similar words with the same part of speech
          for lexeme in by_similarity:
              # because we don't add the word itself anymore
              if len(texts) == top_n - 1:
                  break
              token = self.nlp(lexeme.orth_)[0]
              if token.tag_ != tag or token.text == word:
                  continue
              texts.append(token.text)
              similarities.append(word_vocab.similarity(lexeme))
  
      words = np.array(texts) if texts else np.array(texts, dtype="<U")
      return {"words": words, "similarities": np.array(similarities)}
  
imports: import logging
  from abc import abstractmethod
  from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Union
  import numpy
  import spacy
label_desc: Use image node_id 2 for calling the Neighbors obj's underlying member method code with example usage: obj.neighbors(word, tag, top_n) and returns: dict