'Why my word2vec training has not INFO printing
I'm a very beginner of the word2vec model. I use the following code to train a word2vec model.
def Model_training(year):
print("Loading Training Sample")
training_sample_file = "training_sample_for_year" + str(year) +".csv"
training_sample = pd.read_csv(training_sample_file).iloc[:,1:]
print("PreTreating Training Sample")
df_item1a = training_sample[~training_sample['item1a_textstemmed'].isna()]
sent1a = [row.split() for row in df_item1a['item1a_textstemmed']]
# initializing the model
print("Model Initializing")
w2v_model_1a = Word2Vec(
vector_size=3000,
alpha=0.03,
min_alpha=0.0007,
workers=15
)
print("Vocabulary Building")
w2v_model_1a.build_vocab(sent1a, progress_per=100)
#train models
print("Training Item1a Model")
w2v_model_1a.train(sent1a, total_examples=len(sent1a), epochs=30)
# capture model with no further changes
print("Saving Models")
w2v_model_1a.init_sims(replace=True)
# save model
model1a_name = "word2vecM_item1a_forYear" + str(year)+".model"
w2v_model_1a.save(model1a_name)
for year in range(2007,2011):
print("Now working on traing sample of year: ", year)
Model_training(year)
For all the example online, I notice there will always be a INFO output while training for each epoch. Like the following image:
However, my code only returns with the following:
How can I make the INFO show up?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
