melt.sentopicmodel | R Documentation |
This function extracts the estimated document mixtures from a topic model and returns them in a long data.table::data.table format.
## S3 method for class 'sentopicmodel'
melt(data, ..., include_docvars = FALSE)
data |
a model created from the |
... |
not used |
include_docvars |
if |
A data.table::data.table in the long format, where each line is the estimated proportion of a single topic/sentiment for a document. For JST and rJST models, the probability is also decomposed into 'L1' and 'L2' layers, representing the probability at each layer of the topic-sentiment hierarchy.
Olivier Delmarcelle
topWords()
for extracting representative words,
data.table::melt()
and data.table::dcast()
# only returns topic proportion for LDA models
lda <- LDA(ECB_press_conferences_tokens)
lda <- fit(lda, 10)
melt(lda)
# includes sentiment for JST and rJST models
jst <- JST(ECB_press_conferences_tokens)
jst <- fit(jst, 10)
melt(jst)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.