Package org.nlpub.watset.util
Class Word2VecFormat
java.lang.Object
org.nlpub.watset.util.Word2VecFormat
Utilities for handling the Word2Vec text format for node embeddings.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSpace character handling strategy. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic <V> voidwrite(BufferedWriter writer, List<NodeEmbedding<V>> embeddings, Word2VecFormat.SpaceStrategy spaceStrategy) Write the file in the Word2Vec format representing the node embeddings.
-
Field Details
-
SPACES
A pattern that matches a space.
-
-
Method Details
-
write
public static <V> void write(BufferedWriter writer, List<NodeEmbedding<V>> embeddings, Word2VecFormat.SpaceStrategy spaceStrategy) throws IOException Write the file in the Word2Vec format representing the node embeddings.- Type Parameters:
V- the type of nodes in the graph- Parameters:
writer- the writerembeddings- the embeddingsspaceStrategy- the space handling strategy- Throws:
IOException- if an I/O error occurs
-