public class MalletLdaTopicModelUtils extends Object
Constructor and Description |
---|
MalletLdaTopicModelUtils() |
Modifier and Type | Method and Description |
---|---|
static List<Map<String,Double>> |
getTopWords(File modelFile,
int nWords,
boolean normalize)
Retrieve the top n topic words for each topic in the given model.
|
static void |
printTopicWords(File modelFile,
File targetFile,
int nWords)
Print the top n words of each topic into a file.
|
public static List<Map<String,Double>> getTopWords(File modelFile, int nWords, boolean normalize) throws IOException
modelFile
- the model filenWords
- the maximum number of words to retrievenormalize
- normalize the word weights ?IOException
- if the model cannot be readpublic static void printTopicWords(File modelFile, File targetFile, int nWords) throws IOException
modelFile
- the model filetargetFile
- the file in which the topic words are writtennWords
- the number of words to extractIOException
- if the model file cannot be read or if the target file cannot be writtenCopyright © 2007–2018 Ubiquitous Knowledge Processing (UKP) Lab, Technische Universität Darmstadt. All rights reserved.