Here is the code for LDA topic modelling with R text2vec package:
library(text2vec)
tokens = docs$text %>% # docs$text: a colection of text documents
wo
Private fields are private for a purpose - they are specifically hided for a user and not part of public API (can be easily changed in future or removed). The correct way of embedding LDAvis to a shiny app is to store LDAvis json on disk and then open it in a shiny app. Something like should work:
lda_model$plot(out.dir = "SOME_DIR", open.browser = FALSE)
And in shiny:
output$myChart <- renderVis(readLines("SOME_DIR/lda.json"))
This works because ...
passed to LDAvis::createJSON
and LDAvis::serVis
(as documentation says):
$plot(lambda.step = 0.1, reorder.topics = FALSE, ...)
plot LDA model using https://cran.r-project.org/package=LDAvis package. ... will be passed to LDAvis::createJSON and LDAvis::serVis functions