class_docstr: Create a doc instance of text, obtain cleaned, readable text and
  metadata from this doc.
  
  Properties:
  raw: incoming, unedited text
  language: 2-letter code for the language of the text
  is_detected_language: is the language detected or specified beforehand
  is_reliable_language: is the language specified or was it reliably detected
  hint_language: language you expect your text to be
  _spacy_nlps: nested dictionary {lang: {model_id: model}} with loaded spacy language modules
docstr: Loads pre-trained Gensim word2vec keyed vector model from either local or Redis
  
  >>> from textpipe.doc import Doc
  >>> model = Doc('')._load_gensim_word2vec_model('tests/models/gensim_test_nl.kv')
  >>> type(model)
  <class 'gensim.models.keyedvectors.Word2VecKeyedVectors'>
docstr_tok: ["Loads","pre-trained","Gensim","word2vec","keyed","vector","model","from","either","local","or","Redis",">",">",">","from","textpipe.doc","import","Doc",">",">",">","model","=","Doc","(","``",")","._load_gensim_word2vec_model","(","'tests\/models\/gensim_test_nl.kv","'",")",">",">",">","type","(","model",")","<","class","'gensim.models.keyedvectors.Word2VecKeyedVectors","'",">"]
code: def _load_gensim_word2vec_model(
      self, model_uri=None, max_lru_cache_size=1024
  ):
      """
      Loads pre-trained Gensim word2vec keyed vector model from either local or Redis
  
      >>> from textpipe.doc import Doc
      >>> model = Doc('')._load_gensim_word2vec_model('tests/models/gensim_test_nl.kv')
      >>> type(model)
      <class 'gensim.models.keyedvectors.Word2VecKeyedVectors'>
      """
      lang = (
          self.language
          if self.is_reliable_language
          else self.hint_language
      )
      if not self._gensim_vectors or lang not in self._gensim_vectors:
          if urlparse(model_uri).scheme == "redis":
              vectors = RedisKeyedVectors(
                  model_uri, lang, max_lru_cache_size
              )
              if not vectors.exists:
                  raise TextpipeMissingModelException(
                      f"Redis does not contain a model "
                      f"for language {lang}. The model "
                      f"needs to be loaded before use "
                      f"(see load_keyed_vectors_into_redis)."
                  )
          elif model_uri:
              try:
                  vectors = KeyedVectors.load(model_uri, mmap="r")
                  self.nr_train_tokens = sum(
                      token_vocab.count
                      for token_vocab in vectors.vocab.values()
                  )
              except FileNotFoundError:
                  # pylint: disable=raise-missing-from
                  raise TextpipeMissingModelException(
                      f"Gensim keyed vector file {model_uri} is not available."
                  )
          else:
              raise TextpipeMissingModelException(
                  "Either specify model filename or redis URI"
              )
          self._gensim_vectors[lang] = vectors
      return self._gensim_vectors[lang]
  
imports: import functools
  import re
  import unicodedata
  from collections import Counter
  from urllib.parse import urlparse
  import cld2
  import numpy
  import spacy
  import spacy.matcher
  import textacy
  import textacy.ke
  import textacy.text_utils
  from bs4 import BeautifulSoup
  from datasketch import MinHash
  from gensim.models.keyedvectors import KeyedVectors
  from gensim.summarization.summarizer import summarize
  from textpipe.data.emoji import EMOJI_TO_UNICODE_NAME, EMOJI_TO_SENTIMENT
  from textpipe.wrappers import RedisKeyedVectors
  from textpipe.util import getattr_
label_desc: Use image node_id 30 for calling the Doc obj's underlying member method code with example usage: obj._load_gensim_word2vec_model(model_uri, max_lru_cache_size) and returns: self