Text Mining with R by Julia Silge

Text Mining with R by Julia Silge

Author:Julia Silge
Language: eng
Format: epub
Publisher: O'Reilly Media
Published: 2017-06-26T04:00:00+00:00


library(topicmodels) data("AssociatedPress") AssociatedPress

## <<DocumentTermMatrix (documents: 2246, terms: 10473)>> ## Non-/sparse entries: 302031/23220327 ## Sparsity : 99% ## Maximal term length: 18 ## Weighting : term frequency (tf)

We can use the LDA() function from the topicmodels package, setting k = 2, to create a two-topic LDA model.

Note

Almost any topic model in practice will use a larger k, but we will soon see that this analysis approach extends to a larger number of topics.

This function returns an object containing the full details of the model fit, such as how words are associated with topics and how topics are associated with documents.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.