public class Word2VecModel
extends Object
implements scala.Serializable
Constructor and Description |
---|
Word2VecModel(scala.collection.immutable.Map<String,float[]> model) |
Modifier and Type | Method and Description |
---|---|
scala.Tuple2<String,Object>[] |
findSynonyms(String word,
int num)
Find synonyms of a word
|
scala.Tuple2<String,Object>[] |
findSynonyms(Vector vector,
int num)
Find synonyms of the vector representation of a word
|
scala.collection.immutable.Map<String,float[]> |
getVectors()
Returns a map of words to their vector representations.
|
Vector |
transform(String word)
Transforms a word to its vector representation
|
public Word2VecModel(scala.collection.immutable.Map<String,float[]> model)
public Vector transform(String word)
word
- a wordpublic scala.Tuple2<String,Object>[] findSynonyms(String word, int num)
word
- a wordnum
- number of synonyms to findpublic scala.Tuple2<String,Object>[] findSynonyms(Vector vector, int num)
vector
- vector representation of a wordnum
- number of synonyms to findpublic scala.collection.immutable.Map<String,float[]> getVectors()