class_docstr: Initialize the np2vec model, train it, save it and load it.
docstr: Train the np2vec model.
docstr_tok: ["Train","the","np2vec","model","."]
code: def _train(self):
      """
      Train the np2vec model.
      """
      if self.word_embedding_type == "word2vec":
          self.model = Word2Vec(
              self._sentences,
              sg=self.sg,
              size=self.size,
              window=self.window,
              alpha=self.alpha,
              min_alpha=self.min_alpha,
              min_count=self.min_count,
              sample=self.sample,
              workers=self.workers,
              hs=self.hs,
              negative=self.negative,
              cbow_mean=self.cbow_mean,
              iter=self.iter,
          )
  
      elif self.word_embedding_type == "fasttext":
          self.model = FastText(
              self._sentences,
              sg=self.sg,
              size=self.size,
              window=self.window,
              alpha=self.alpha,
              min_alpha=self.min_alpha,
              min_count=self.min_count,
              sample=self.sample,
              workers=self.workers,
              hs=self.hs,
              negative=self.negative,
              cbow_mean=self.cbow_mean,
              iter=self.iter,
              min_n=self.min_n,
              max_n=self.max_n,
              word_ngrams=self.word_ngrams,
          )
      else:
          logger.error(
              "invalid word embedding type: %s",
              self.word_embedding_type,
          )
          sys.exit(0)
  
file_path: nlp-architect/nlp_architect/models/np2vec.py
imports: import json
  import logging
  import sys
  from gensim.models import FastText, Word2Vec, KeyedVectors
  from gensim.models.word2vec import LineSentence
  from gensim import utils
  import nltk
  from nltk.corpus import conll2000
  from six import iteritems
  from smart_open import open
label_desc: Use image node_id 3 for calling the NP2vec obj's underlying member method code with example usage: obj._train() without return types