The LDAvis package produces beautiful intertopic distance maps
serVis(json_lda, out.dir = 'vis', open.browser = FALSE) # outputs lda visualizations
How can go about producing a matrix or dataframe of all of the pairwise relative distances between each topic?
I have access to the Document Term Matrix, Corpus, LDA model object, and json_lda used to output the visualization.
I've uploaded RDS files for testing to here. They can be loaded using:
library(lsa)
library(tm)
library(slam)
library(LDAvis)
library(topicmodels)
DTM <- readRDS("dtm.RDS")
ldamodel <- readRDS("ldamodel.RDS")
json_lda <- readRDS("json_lda.RDS")
corpus <- readRDS("new.corpus.RDS")