old_contents: import argparser
  from corpora import Corpus
  
  
  def word2vec(corpus, target, **w2vargs):
      corpus = Corpus(corpus)
      model = gensim.models.Word2Vec(corpus, **w2vargs)
      model.save_word2vec_format(target, binary=True)
  
  
  if __name__ == '__main__':
      parser = argparse.ArgumentParser(
          description='Script for training word vector models using public corpora')
      parser.add_argument('corpus', type=str,
                          help='source folder with preprocessed corpus (one sentence plain text per line in each file)')
      parser.add_argument('target', type=str,
                          help='target file name to store model in')
      parser.add_argument('-s', '--size', type=int, default=300,
                          help='dimension of word vectors')
      parser.add_argument('-w', '--window', type=int, default=5,
                          help='size of the sliding window')
      parser.add_argument('-m', '--mincount', type=int, default=5,
                          help='minimum number of occurences of a word to be considered')
      parser.add_argument('-c', '--workers', type=int, default=4,
                          help='number of worker threads to train the model')
      parser.add_argument('-g', '--sg', type=int, default=1,
                          help='training algorithm: Skip-Gram (1), otherwise CBOW (0)')
      parser.add_argument('-i', '--hs', type=int, default=1,
                          help='use of hierachical sampling for training')
      parser.add_argument('-n', '--negative', type=int, default=0,
                          help='use of negative sampling for training (usually between 5-20)')
      parser.add_argument('-o', '--cbowmean', type=int, default=0,
                          help='for CBOW training algorithm: use sum (0) or mean (1) to merge context vectors')
      args = parser.parse_args()
  
      word2vec(**args)
  
new_contents: import argparse
  from gensim.models.word2vec import Word2Vec, LineSentence
  
  description = """
  Script for training word vector models using public corpora
  """
  
  
  def word2vec(train, output, limit, **w2vargs):
      limit = int(limit) if limit else None
      sents = LineSentence(train, limit)
      model = Word2Vec(sents, **w2vargs)
      model.wv.save_word2vec_format(output)
  
  
  if __name__ == '__main__':
      parser = argparse.ArgumentParser(description=description)
  
      parser.add_argument('-t', '--train', type=str, required=True,
                          help='token file')
      parser.add_argument('-o', '--output', type=str, required=True,
                          help='Target file to store model')
      parser.add_argument('-limit', type=float, default=None,
                          help='Number of sentences to use from data')
      parser.add_argument('-workers', type=int, default=32,
                          help='number of worker threads to train the model')
      modelargs = parser.add_argument_group(title='word2vec')
      modelargs.add_argument('-iter', type=int, default=10,
                             help='Number of iterations over the corpus')
      modelargs.add_argument('-size', type=int, default=400,
                             help='Size of word vectors')
      modelargs.add_argument('-window', type=int, default=5,
                             help='Size of the sliding window')
      modelargs.add_argument('-min_count', type=int, default=5,
                             help='Ignore all words with lower total frequency')
      modelargs.add_argument('-sample', type=float, default=0.00001,
                             help='Threshold frequency over which words are downsampled')
      model = modelargs.add_mutually_exclusive_group()
      model.add_argument('-sg', dest='sg', action='store_const', const=1,
                         help='Use Skip-Gram model')
      model.add_argument('-cbow', dest='sg', action='store_const', const=0,
                         help='Use CBOW model')
      args = parser.parse_args()
  
      word2vec(**vars(args))
  
subject: Rename word2vec arguments