Step 6 - Prepare the topics of interest

Prepare the top 5 topics with each topic having 10 terms. Include the terms and their corresponding weights:

val topicIndices = ldaModel.describeTopics(maxTermsPerTopic = 10)println(topicIndices.length)val topics = topicIndices.map {    case (terms, termWeights) => terms.zip(termWeights).map {    case (term, weight) => (vocabArray(term.toInt), weight)    }}

Get Scala Machine Learning Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.