January 2018
Intermediate to advanced
470 pages
11h 9m
English
The following steps show TM from data reading to printing the topics, along with their term weights. Here's the short workflow of the TM pipeline:
object topicmodelingwithLDA { def main(args: Array[String]): Unit = { val lda = new LDAforTM() // actual computations are done here val defaultParams = Params().copy(input = "data/docs/") //Loading parameters for training lda.run(defaultParams) // Training the LDA model with the default parameters. }}
We also need to import some related packages and libraries:
import edu.stanford.nlp.process.Morphologyimport edu.stanford.nlp.simple.Documentimport org.apache.log4j.{Level, Logger}import scala.collection.JavaConversions._import org.apache.spark.{SparkConf, SparkContext}import org.apache.spark.ml.Pipeline ...Read now
Unlock full access