Thanks for the A2A. I didn't know the answer to your question (never done this before), but its fairly simple to figure out. Among the parameters you list in your question, --output-state dumps state periodically, so if you set:topicModel.setSaveState(interval, statefile),nit will cause the topicModel to dump out state every interval seconds into a numbered file with the statefile pattern. For the other two, you could just call the appropriate setter on the topic model instance in your Java code.// --output-doc-topics ntopicModel.printDocumentTopics(File(docTopicsFile)),n// --output-topic-keysntopicModel.printTopWords(File(topicKeysFile), numTopWords),nIf you want to follow my approach, its pretty simple. May save you from having to post a question on Quora and wait for an answer in future. As an example, look at a command that has --output-state:bin/mallet train-topics --input topic-input.mallet n --num-topics 100 --output-state topic-state.gznThe script being called is bin/mallet, the subcommand is train-topics. If you search inside for train-topics, you will find it mapped to cc.mallet.topics.tui.Vectors2Topics. Looking inside Vectors2Topics.java for --output-state, its sets the variable outputStateInterval. Looking for outputStateInterval, it is used to set the saveState into topicModel. The topicModel is an instance of PolylingualTopicModel, so lets look inside that to see what happens. Inside PolylingualTopicModel, the setSaveState sets the two variables saveStateInterval and stateFilename.