Description Usage Arguments Value See Also Examples
Uses the uwot package to map the word embeddings and the center of the topic embeddings to a 2-dimensional space
1 2 |
object |
object of class |
type |
character string with the type of summary to extract. Defaults to 'umap', no other summary information currently implemented. |
n_components |
the dimension of the space to embed into. Passed on to |
top_n |
passed on to |
... |
further arguments passed onto |
a list with elements
center: a matrix with the embeddings of the topic centers
words: a matrix with the embeddings of the words
embed_2d: a data.frame which contains a lower dimensional presentation in 2D of the topics and the top_n words associated with the topic, containing columns type, term, cluster (the topic number), rank, beta, x, y, weight; where type is either 'words' or 'centers', x/y contain the lower dimensional positions in 2D of the word and weight is the emitted beta scaled to the highest beta within a topic where the topic center always gets weight 0.8
1 2 3 4 5 6 7 8 9 10 | library(torch)
library(topicmodels.etm)
library(uwot)
path <- system.file(package = "topicmodels.etm", "example", "example_etm.ckpt")
model <- torch_load(path)
overview <- summary(model,
metric = "cosine", n_neighbors = 15,
fast_sgd = FALSE, n_threads = 1, verbose = TRUE)
overview$center
overview$embed_2d
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.