class_docstr: Class to imitate gensim's KeyedVectors, but instead getting the vectors from the memory,
  the vectors will be retrieved from a redis db.
  Based on https://engineering.talentpair.com/serving-word-vectors-
  for-distributed-computations-c5065cbaa02f
class_docstr_tok: ["Class","to","imitate","gensim","'s","KeyedVectors",",","but","instead","getting","the","vectors","from","the","memory",",","the","vectors","will","be","retrieved","from","a","redis","db",".","Based","on","https",":","\/\/engineering.talentpair.com\/serving-word-vectors-","for-distributed-computations-c5065cbaa02f"]
docstr: This method is mimicking the word_vec method from the Gensim KeyedVector class. Instead of
  looking it up from an in memory dict, it
  - requests the value from the redis instance, where the key is a combination between
  an optional word vector model key and the word itself
  - decompresses it
  - and finally unpickles it
  
  :param word: string
  
  :returns: numpy array of dim of the word vector model (for Google: 300, 1)
docstr_tok: ["This","method","is","mimicking","the","word_vec","method","from","the","Gensim","KeyedVector","class",".","Instead","of","looking","it","up","from","an","in","memory","dict",",","it","-","requests","the","value","from","the","redis","instance",",","where","the","key","is","a","combination","between","an","optional","word","vector","model","key","and","the","word","itself","-","decompresses","it","-","and","finally","unpickles","it",":","param","word",":","string",":","returns",":","numpy","array","of","dim","of","the","word","vector","model","(","for","Google",":","300",",","1",")"]
code: def word_vec(self, word):  # pylint: disable=E0202
      """
      This method is mimicking the word_vec method from the Gensim KeyedVector class. Instead of
      looking it up from an in memory dict, it
      - requests the value from the redis instance, where the key is a combination between
      an optional word vector model key and the word itself
      - decompresses it
      - and finally unpickles it
  
      :param word: string
  
      :returns: numpy array of dim of the word vector model (for Google: 300, 1)
      """
  
      try:
          cache_entry = self._redis.hget(self.key, word)
          if not cache_entry:
              raise KeyError(f"Key {word} does not exist in cache")
          return pickle.loads(cache_entry)
      except RedisError as exception:
          # pylint: disable=raise-missing-from
          raise RedisKeyedVectorException(
              f"The connection to Redis failed while trying to "
              f"retrieve a word vector. Redis error message: "
              f"{exception}"
          )
      except TypeError:
          return None
  
file_path: textpipe/textpipe/wrappers.py
imports: import pickle
  from functools import lru_cache
  from urllib.parse import urlparse
  import numpy
  from gensim.models.keyedvectors import KeyedVectors
  from redis import Redis
  from redis.exceptions import RedisError
  from tqdm import tqdm
label_desc: Use image node_id 2 for calling the RedisKeyedVectors obj's underlying member method code with example usage: obj.word_vec(word) and returns: pickle, None