use of zemberek.core.embeddings.WordVectorsTrainer in project zemberek-nlp by ahmetaa.
the class GenerateWordVectors method run.
@Override
public void run() throws IOException {
Log.info("Generating word vectors from %s", input);
WordVectorsTrainer trainer = WordVectorsTrainer.builder().epochCount(epochCount).learningRate(learningRate).modelType(modelType).minWordCount(minWordCount).threadCount(threadCount).wordNgramOrder(wordNGrams).dimension(dimension).contextWindowSize(contextWindowSize).build();
Log.info("Training Started.");
trainer.getEventBus().register(this);
FastText fastText = trainer.train(input);
Log.info("Saving vectors in text format to %s", output);
fastText.saveVectors(output);
}
Aggregations