Search in sources :

Example 1 with WordVectorsTrainer

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);
}
Also used : WordVectorsTrainer(zemberek.core.embeddings.WordVectorsTrainer) FastText(zemberek.core.embeddings.FastText)

Aggregations

FastText (zemberek.core.embeddings.FastText)1 WordVectorsTrainer (zemberek.core.embeddings.WordVectorsTrainer)1