Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package org.deeplearning4j.examples.advanced.modelling.embeddingsfromcorpus.word2vec;

import org.deeplearning4j.models.embeddings.loader.WordVectorSerializer;
import org.deeplearning4j.models.word2vec.Word2Vec;
import org.deeplearning4j.examples.utils.DownloaderUtility;
import org.deeplearning4j.text.sentenceiterator.BasicLineIterator;
Expand Down Expand Up @@ -77,7 +78,8 @@ public static void main(String[] args) throws Exception {
vec.fit();

log.info("Writing word vectors to text file....");

WordVectorSerializer.writeWord2VecModel(vec, "pathToSaveModel.txt");

// Prints out the closest 10 words to "day". An example on what to do with these Word Vectors.
log.info("Closest Words:");
Collection<String> lst = vec.wordsNearestSum("day", 10);
Expand Down