docstr: Initialize class identifying neighbouring words from the embedding for a given word.
  
  Parameters
  ----------
  nlp_obj
      `spaCy` model.
  n_similar
      Number of similar words to return.
  w_prob
      Smoothed log probability estimate of token's type.
docstr_tok: ["Initialize","class","identifying","neighbouring","words","from","the","embedding","for","a","given","word",".","Parameters","--","--","--","--","--","nlp_obj","`","spaCy","`","model",".","n_similar","Number","of","similar","words","to","return",".","w_prob","Smoothed","log","probability","estimate","of","token","'s","type","."]
code: def __init__(
      self,
      nlp_obj: "spacy.language.Language",
      n_similar: int = 500,
      w_prob: float = -15.0,
  ) -> None:
      """
      Initialize class identifying neighbouring words from the embedding for a given word.
  
      Parameters
      ----------
      nlp_obj
          `spaCy` model.
      n_similar
          Number of similar words to return.
      w_prob
          Smoothed log probability estimate of token's type.
      """
      self.nlp = nlp_obj
      self.w_prob = w_prob
      # list with spaCy lexemes in vocabulary
      # first if statement is a workaround due to some missing keys in models:
      # https://github.com/SeldonIO/alibi/issues/275#issuecomment-665017691
      self.to_check = [
          self.nlp.vocab[w]
          for w in self.nlp.vocab.vectors
          if int(w) in self.nlp.vocab.strings
          and self.nlp.vocab[w].prob  # type: ignore[operator]
          >= self.w_prob
      ]
      self.n_similar = n_similar
  
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 1 to create a new Neighbors object  with example: obj = Neighbors(nlp_obj, n_similar, w_prob)