public class Word2Vec extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Word2Vec.WordEntry |
| Modifier and Type | Field and Description |
|---|---|
protected int |
topNSize |
protected int |
vectorSize |
protected int |
vocabSize |
protected HashMap<String,float[]> |
vocabulary |
| Constructor and Description |
|---|
Word2Vec() |
| Modifier and Type | Method and Description |
|---|---|
TreeSet<Word2Vec.WordEntry> |
analogy(String query) |
TreeSet<Word2Vec.WordEntry> |
analogy(String word0,
String word1,
String word2) |
Set<Word2Vec.WordEntry> |
distance(String word) |
protected static float |
getFloat(byte[] b) |
List<Integer> |
getMostFrequentTopics(String word,
float threshold) |
int |
getSize() |
int |
getTopNSize() |
int |
getVocabSize() |
HashMap<String,float[]> |
getWordMap() |
float[] |
getWordVector(String word) |
protected void |
insertTopN(String name,
float score,
List<Word2Vec.WordEntry> wordsEntrys) |
static HashMap<String,Integer> |
loadClassModel(String path) |
Word2Vec |
loadModel(String path) |
protected static float |
readFloat(InputStream is) |
protected static String |
readString(DataInputStream dis) |
void |
setTopNSize(int topNSize) |
protected int vocabSize
protected int vectorSize
protected int topNSize
public Word2Vec loadModel(String path) throws IOException
IOExceptionpublic Set<Word2Vec.WordEntry> distance(String word)
public TreeSet<Word2Vec.WordEntry> analogy(String word0, String word1, String word2)
public TreeSet<Word2Vec.WordEntry> analogy(String query)
protected void insertTopN(String name, float score, List<Word2Vec.WordEntry> wordsEntrys)
public float[] getWordVector(String word)
protected static float readFloat(InputStream is) throws IOException
IOExceptionprotected static float getFloat(byte[] b)
protected static String readString(DataInputStream dis) throws IOException
IOExceptionpublic int getTopNSize()
public void setTopNSize(int topNSize)
public int getVocabSize()
public int getSize()
public static HashMap<String,Integer> loadClassModel(String path) throws IOException
IOExceptionCopyright © 2015 Bluebrain Project. All rights reserved.