public void printTopWords (File file, int numWords, boolean useNewLines) throws IOException { PrintStream out = new PrintStream (file); printTopWords(out, numWords, useNewLines); out.close(); }
public void printTopWords (File file, int numWords, boolean useNewLines) throws IOException { PrintStream out = new PrintStream (file); printTopWords(out, numWords, useNewLines); out.close(); }
public void printTopWords (File file, int numWords, boolean useNewLines) throws IOException { PrintStream out = new PrintStream (file); printTopWords(out, numWords, useNewLines); out.close(); }
public static void main(String[] args) throws IOException { setOptions(args); String targetFile = modelFile + TARGET_FILE_SUFFIX; LOG.info(String.format("%nReading model from '%s'.%nStoring topic words in '%s'.", modelFile, targetFile)); ParallelTopicModel model; try { model = ParallelTopicModel.read(modelFile); } catch (Exception e) { throw new IOException(e); } model.printTopWords(new File(targetFile), nWords + 1, false); }
/** * Print the top n words of each topic into a file. * * @param modelFile * the model file * @param targetFile * the file in which the topic words are written * @param nWords * the number of words to extract * @throws IOException * if the model file cannot be read or if the target file cannot be written */ public static void printTopicWords(File modelFile, File targetFile, int nWords) throws IOException { boolean newLineAfterEachWord = false; ParallelTopicModel model; try { model = ParallelTopicModel.read(modelFile); } catch (Exception e) { throw new IOException(e); } model.printTopWords(targetFile, nWords, newLineAfterEachWord); }
topicModel.printTopWords(new File(topicKeysFile.value), topWords.value, false);
topicModel.printTopWords(new File(topicKeysFile.value), topWords.value, false);
topicModel.printTopWords(new File(topicKeysFile.value), topWords.value, false);
topicModel.printTopWords(new File(topicKeysFile.value), topWords.value, false);
topicModel.printTopWords(new File(topicKeysFile.value), topWords.value, false);
topicModel.printTopWords(new File(topicKeysFile.value), topWords.value, false);