# NOT RUN {
library(torch)
library(topicmodels.etm)
path <- system.file(package = "topicmodels.etm", "example", "example_etm.ckpt")
model <- torch_load(path)
plot(model, type = "loss")
# }
# NOT RUN {
# }
# NOT RUN {
library(torch)
library(topicmodels.etm)
library(textplot)
library(uwot)
library(ggrepel)
library(ggalt)
path <- system.file(package = "topicmodels.etm", "example", "example_etm.ckpt")
model <- torch_load(path)
plt <- plot(model, type = "topics", top_n = 7, which = c(1, 2, 14, 16, 18, 19),
metric = "cosine", n_neighbors = 15,
fast_sgd = FALSE, n_threads = 2, verbose = TRUE,
title = "ETM Topics example")
plt
# }
Run the code above in your browser using DataLab