Database Reference
In-Depth Information
# Get the top words in the cluster
top.words <- top.topic.words(result$topics, 5,
by.score=TRUE)
# build topic proportions
topic.props <- t(result$document_sums) /
colSums(result$document_sums)
document.samples <- sample(1:dim(topic.props)[1], N)
topic.props <- topic.props[document.samples,]
topic.props[is.na(topic.props)] <- 1 / K
colnames(topic.props) <- apply(top.words, 2, paste,
collapse=" ")
topic.props.df <- melt(cbind(data.frame(topic.props),
document=factor(1:N)),
variable.name="topic",
id.vars = "document")
qplot(topic, value*100, fill=topic, stat="identity",
ylab="proportion (%)", data=topic.props.df,
geom="histogram") +
theme(axis.text.x = element_text(angle=0, hjust=1,
size=12)) +
coord_flip() +
facet_wrap(˜ document, ncol=3)
Topic models can be used in document modeling, document classification, and
collaborative filtering [29]. Topic models not only can be applied to textual data,
they can also help annotate images. Just as a document can be considered a
collection of topics, images can be considered a collection of image features.
Search WWH ::




Custom Search