Package cc.mallet.topics
Class WordEmbeddings
- java.lang.Object
-
- cc.mallet.topics.WordEmbeddings
-
public class WordEmbeddings extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static int
LINEAR_ORDERING
static int
RANDOM_ORDERING
static int
SHUFFLED_ORDERING
-
Constructor Summary
Constructors Constructor Description WordEmbeddings()
WordEmbeddings(Alphabet a, int numColumns, int windowSize)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description double[]
add(double[] result, int word)
double[]
add(double[] result, java.lang.String word)
double
averageAbsWeight()
double[]
copy(int word)
double[]
copy(java.lang.String word)
void
countWords(InstanceList instances, double samplingFactor)
void
findClosest(double[] targetVector)
int
getMinDocumentLength()
java.lang.String
getQueryWord()
void
initializeSortables()
static void
main(java.lang.String[] args)
void
setMinDocumentLength(int minDocumentLength)
void
setNumIterations(int i)
void
setQueryWord(java.lang.String queryWord)
double[]
subtract(double[] result, int word)
double[]
subtract(double[] result, java.lang.String word)
void
train(InstanceList instances, int numThreads, int numSamples)
double[]
variances()
void
write(java.io.PrintWriter out)
void
writeContext(java.io.PrintWriter out)
-
-
-
Field Detail
-
LINEAR_ORDERING
public static final int LINEAR_ORDERING
- See Also:
- Constant Field Values
-
SHUFFLED_ORDERING
public static final int SHUFFLED_ORDERING
- See Also:
- Constant Field Values
-
RANDOM_ORDERING
public static final int RANDOM_ORDERING
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
WordEmbeddings
public WordEmbeddings()
-
WordEmbeddings
public WordEmbeddings(Alphabet a, int numColumns, int windowSize)
-
-
Method Detail
-
getMinDocumentLength
public int getMinDocumentLength()
-
setMinDocumentLength
public void setMinDocumentLength(int minDocumentLength)
-
setNumIterations
public void setNumIterations(int i)
-
getQueryWord
public java.lang.String getQueryWord()
-
setQueryWord
public void setQueryWord(java.lang.String queryWord)
-
initializeSortables
public void initializeSortables()
-
countWords
public void countWords(InstanceList instances, double samplingFactor)
-
train
public void train(InstanceList instances, int numThreads, int numSamples)
-
findClosest
public void findClosest(double[] targetVector)
-
averageAbsWeight
public double averageAbsWeight()
-
variances
public double[] variances()
-
write
public void write(java.io.PrintWriter out)
-
writeContext
public void writeContext(java.io.PrintWriter out)
-
copy
public double[] copy(java.lang.String word)
-
copy
public double[] copy(int word)
-
add
public double[] add(double[] result, java.lang.String word)
-
add
public double[] add(double[] result, int word)
-
subtract
public double[] subtract(double[] result, java.lang.String word)
-
subtract
public double[] subtract(double[] result, int word)
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-