docstr: :param model: gensim word2vec.Word2Vec model
  :param term_acceptance_re : SRE_Pattern, Regular expression to identify
      valid terms, default re.compile('[a-z]{3,}')
  :return: EmbeddingsResolver
docstr_tok: [":","param","model",":","gensim","word2vec.Word2Vec","model",":","param","term_acceptance_re",":","SRE_Pattern",",","Regular","expression","to","identify","valid","terms",",","default","re.compile","(","'","[","a-z","]","{","3",",","}","'",")",":","return",":","EmbeddingsResolver"]
code: def set_embeddings_model(
      self, model=None, term_acceptance_re=re.compile("[a-z]{3,}")
  ):
      """
  
      :param model: gensim word2vec.Word2Vec model
      :param term_acceptance_re : SRE_Pattern, Regular expression to identify
          valid terms, default re.compile('[a-z]{3,}')
      :return: EmbeddingsResolver
      """
      if self.embeddings_ is not None:
          raise Exception(
              "You have already set embeddings by running set_embeddings or set_embeddings_model."
          )
      self.word2vec_model_ = model
      if term_acceptance_re is not None:
          acceptable_terms = set(
              [
                  t
                  for t in self.corpus_.get_terms()
                  if term_acceptance_re.match(t)
              ]
          )
      else:
          acceptable_terms = set(self.corpus_.get_terms())
      model = Word2VecFromParsedCorpus(self.corpus_, model).train()
      self.corpus_ = self.corpus_.remove_terms(
          set(self.corpus_.get_terms()) - acceptable_terms
      )
      weight_list = [
          model.wv[word] for word in model.wv.key_to_index.keys()
      ]
      self.embeddings_ = np.stack(weight_list)
      self.vocab_ = list(model.wv.key_to_index.keys())
      return self
  
file_path: scattertext/scattertext/representations/EmbeddingsResolver.py
imports: import re
  import numpy
  import pandas
  from scipy import sparse
  from scipy.stats import pearsonr
  from scattertext.representations import Word2VecFromParsedCorpus
label_desc: Use image node_id 3 for calling the EmbeddingsResolver obj's underlying member method code with example usage: obj.set_embeddings_model(model, term_acceptance_re) and returns: self