parameters: ()
docstring: if not os.path.exists(output_file):
          train_sentences = LineSentence('data/whispers.default_hmm.random.cut')
          train(model, sentences, output_file, train_sentences)
      else:
          # test_model_random(sentences, output_file)
          test_model('data/exam_words.txt', output_file)
docstring_summary: if not os.path.exists(output_file):
          train_sentences = LineSentence('data/whispers.default_hmm.random.cut')
          train(model, sentences, output_file, train_sentences)
      else:
          # test_model_random(sentences, output_file)
          test_model('data/exam_words.txt', output_file)
docstring_tokens: if not os . path . exists ( output_file ) : train_sentences = LineSentence ( data / whispers . default_hmm . random . cut ) train ( model sentences output_file train_sentences ) else : # test_model_random ( sentences output_file ) test_model ( data / exam_words . txt output_file )
function: def word2vec_train():
      # Gensim的word2vec的输入是句子的序列. 每个句子是一个单词列表
      sentences = word2vec.Word2vecSentence(NEWS_WORDS_FILE)
      word2vec.train(sentences)
      '''
      if not os.path.exists(output_file):
          train_sentences = LineSentence('data/whispers.default_hmm.random.cut')
          train(model, sentences, output_file, train_sentences)
      else:
          # test_model_random(sentences, output_file)
          test_model('data/exam_words.txt', output_file)
      '''
      pass
function_tokens: def word2vec_train ( ) : # Gensim的word2vec的输入是句子的序列. 每个句子是一个单词列表 sentences = word2vec . Word2vecSentence ( NEWS_WORDS_FILE ) word2vec . train ( sentences ) pass