Skip to content

Instantly share code, notes, and snippets.

@islem-esi
Created April 23, 2022 11:40
Show Gist options
  • Save islem-esi/a189a368e51125f8cad669d255b930e3 to your computer and use it in GitHub Desktop.
Save islem-esi/a189a368e51125f8cad669d255b930e3 to your computer and use it in GitHub Desktop.
from gensim.models import FastText
embed_model = FastText(vector_size=meta_hyper['vector_size'],
window=meta_hyper['window'],
min_count = meta_hyper['min_count'],
alpha= meta_hyper['alpha'],
workers=meta_hyper['CPU'])
embed_model.build_vocab(tokenized_data)
import time
start = time.time()
embed_model.train(tokenized_data, total_examples=len(tokenized_data), epochs=meta_hyper['epochs'])
end = time.time()
embed_model.save('fasttext_{}.mdl'.format(meta_hyper['vector_size']))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment