class_docstr: Word embedding model.
docstr: Transform words (or sequences of words) to vectors using a word2vec model.
  
  :param str words: An H2OFrame made of a single column containing source words.
  :param str aggregate_method: Specifies how to aggregate sequences of words. If your method is ```NONE```,
         no aggregation is performed and each input word is mapped to a single word-vector.
         If your method is ``'AVERAGE'``, input is treated as sequences of words delimited by NA.
         Each word of a sequences is internally mapped to a vector, and vectors belonging to
         the same sentence are averaged and returned in the result.
  
  :returns: the approximate reconstruction of the training data.
  
  :examples:
  
  >>> job_titles = h2o.import_file(("https://s3.amazonaws.com/h2o-public-test-data/smalldata/craigslistJobTitles.csv"), 
  ...                               col_names = ["category", "jobtitle"], 
  ...                               col_types = ["string", "string"], 
  ...                               header = 1)
  >>> STOP_WORDS = ["ax","i","you","edu","s","t","m","subject","can","lines","re","what",
  ...               "there","all","we","one","the","a","an","of","or","in","for","by","on",
  ...               "but","is","in","a","not","with","as","was","if","they","are","this","and","it","have",
  ...               "from","at","my","be","by","not","that","to","from","com","org","like","likes","so"]
  >>> words = job_titles.tokenize(" ")
  >>> words = words[(words.isna()) | (~ words.isin(STOP_WORDS)),:] 
  >>> w2v_model = H2OWord2vecEstimator(epochs = 10)
  >>> w2v_model.train(training_frame=words)
  >>> job_title_vecs = w2v_model.transform(words, aggregate_method = "AVERAGE")
docstr_tok: ["Transform","words","(","or","sequences","of","words",")","to","vectors","using","a","word2vec","model",".",":","param","str","words",":","An","H2OFrame","made","of","a","single","column","containing","source","words",".",":","param","str","aggregate_method",":","Specifies","how","to","aggregate","sequences","of","words",".","If","your","method","is","``","`","NONE","``","`",",","no","aggregation","is","performed","and","each","input","word","is","mapped","to","a","single","word-vector",".","If","your","method","is","``","'AVERAGE","'","``",",","input","is","treated","as","sequences","of","words","delimited","by","NA",".","Each","word","of","a","sequences","is","internally","mapped","to","a","vector",",","and","vectors","belonging","to","the","same","sentence","are","averaged","and","returned","in","the","result",".",":","returns",":","the","approximate","reconstruction","of","the","training","data",".",":","examples",":",">",">",">","job_titles","=","h2o.import_file","(","(","``","https",":","\/\/s3.amazonaws.com\/h2o-public-test-data\/smalldata\/craigslistJobTitles.csv","''",")",",","...","col_names","=","[","``","category","''",",","``","jobtitle","''","]",",","...","col_types","=","[","``","string","''",",","``","string","''","]",",","...","header","=","1",")",">",">",">","STOP_WORDS","=","[","``","ax","''",",","''","i","''",",","''","you","''",",","''","edu","''",",","''","s","''",",","''","t","''",",","''","m","''",",","''","subject","''",",","''","can","''",",","''","lines","''",",","''","re","''",",","''","what","''",",","...","``","there","''",",","''","all","''",",","''","we","''",",","''","one","''",",","''","the","''",",","''","a","''",",","''","an","''",",","''","of","''",",","''","or","''",",","''","in","''",",","''","for","''",",","''","by","''",",","''","on","''",",","...","``","but","''",",","''","is","''",",","''","in","''",",","''","a","''",",","''","not","''",",","''","with","''",",","''","as","''",",","''","was","''",",","''","if","''",",","''","they","''",",","''","are","''",",","''","this","''",",","''","and","''",",","''","it","''",",","''","have","''",",","...","``","from","''",",","''","at","''",",","''","my","''",",","''","be","''",",","''","by","''",",","''","not","''",",","''","that","''",",","''","to","''",",","''","from","''",",","''","com","''",",","''","org","''",",","''","like","''",",","''","likes","''",",","''","so","''","]",">",">",">","words","=","job_titles.tokenize","(","``","``",")",">",">",">","words","=","words","[","(","words.isna","(",")",")","|","(","~","words.isin","(","STOP_WORDS",")",")",",",":","]",">",">",">","w2v_model","=","H2OWord2vecEstimator","(","epochs","=","10",")",">",">",">","w2v_model.train","(","training_frame=words",")",">",">",">","job_title_vecs","=","w2v_model.transform","(","words",",","aggregate_method","=","``","AVERAGE","''",")"]
code: def transform(self, words, aggregate_method):
      """
      Transform words (or sequences of words) to vectors using a word2vec model.
  
      :param str words: An H2OFrame made of a single column containing source words.
      :param str aggregate_method: Specifies how to aggregate sequences of words. If your method is ```NONE```,
             no aggregation is performed and each input word is mapped to a single word-vector.
             If your method is ``'AVERAGE'``, input is treated as sequences of words delimited by NA.
             Each word of a sequences is internally mapped to a vector, and vectors belonging to
             the same sentence are averaged and returned in the result.
  
      :returns: the approximate reconstruction of the training data.
  
      :examples:
  
      >>> job_titles = h2o.import_file(("https://s3.amazonaws.com/h2o-public-test-data/smalldata/craigslistJobTitles.csv"),
      ...                               col_names = ["category", "jobtitle"],
      ...                               col_types = ["string", "string"],
      ...                               header = 1)
      >>> STOP_WORDS = ["ax","i","you","edu","s","t","m","subject","can","lines","re","what",
      ...               "there","all","we","one","the","a","an","of","or","in","for","by","on",
      ...               "but","is","in","a","not","with","as","was","if","they","are","this","and","it","have",
      ...               "from","at","my","be","by","not","that","to","from","com","org","like","likes","so"]
      >>> words = job_titles.tokenize(" ")
      >>> words = words[(words.isna()) | (~ words.isin(STOP_WORDS)),:]
      >>> w2v_model = H2OWord2vecEstimator(epochs = 10)
      >>> w2v_model.train(training_frame=words)
      >>> job_title_vecs = w2v_model.transform(words, aggregate_method = "AVERAGE")
      """
      j = h2o.api(
          "GET /3/Word2VecTransform",
          data={
              "model": self.model_id,
              "words_frame": words.frame_id,
              "aggregate_method": aggregate_method,
          },
      )
      return h2o.get_frame(j["vectors_frame"]["name"])
  
file_path: h2o-3/h2o-py/h2o/model/models/word_embedding.py
imports: from h2o.utils.compatibility import *
  from collections import OrderedDict
  import h2o
  from h2o.expr import ExprNode
  from h2o.model import ModelBase
label_desc: Use image node_id 2 for calling the H2OWordEmbeddingModel obj's underlying member method code with example usage: obj.transform(words, aggregate_method) and returns: h2o