Description Usage Arguments Examples
Perform topic modeling on a corpus
1 | get_topics(corp, dfm_subset, num_topics, num_ngrams, ...)
|
corp |
A corpus object |
dfm_subset |
A logical expression indicating elements to keep: missing values are taken as false |
num_topics |
The number of topics to return |
num_ngrams |
The phrase length to |
... |
Additional options passed to |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ## Not run:
# load AFMC We Need data set
csv = "path/to/AFMC_We_Need/data/file.csv"
# Extract text from the CSV file
DATA = Text.Replace:::extract_text(csv)
# Subset DATA for question 1 of the Field Survey as object \code{q1f_DATA}
q1f_DATA = subset(DATA, Source == 'Field Survey' & Question == 1)
# Create the corpus object
corp = Text.Replace::create_corpus(q1f_DATA, "Comments")
# Get the topics
Text.Replace::get_topics(corp = corp,
dfm_subset = Base == "Robins",
num_topics = 10,
num_ngrams = 1,
remove = quanteda::stopwords("english"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.