-
Download the materials in this repository using the "Clone or download" button and click the "Download ZIP" link. Unzip the file locally.
-
Ensure you have R and R Studio installed on your machine. Use the links and follow the instructions to download each locally.
Alternatively, you can use RollApp to create a free account and run R and R Studio on a cloud service. This option has more issues with saving so this is only an option if you want to avoid downloading R/R Studio locally.
Open R Studio and run the following command to ensure you have all of the R libraries:
packages <- c("quanteda","tidyverse","topicmodels","stm","RColorBrewer","servr",
"LDAvis", "RJSONIO", "igraph","visNetwork")
lapply(packages, install.packages(packages), character.only = TRUE)
Part | Subject | ||
---|---|---|---|
1 | Latent Dirichlet Allocation (LDA) | code | HTML output |
2 | Correlated Topic Model (CTM) | code | HTML output |
3 | Structured Topic Model (STM) | code | HTML output |
For users interested in large-scale LDA on Spark (not available yet for CTM or STM), see this code.
Users interested in Structural Topic Modeling should read www.structuraltopicmodel.com. This site provides multiple papers that have employed STM as well as references on STM including the stm
R package.