run_btm: Run Biterm Topic Models

View source: R/run_btm.R

run_btmR Documentation

Run Biterm Topic Models

Description

Uses the BTM package to run noun-based topic models in collections of short texts. Uses udpipe to tokenize and keep only nouns, proper nouns. The BTM output is then processed using functions and calculations from the LDAvis package.

Usage

run_btm(handle, data_source = c("timeline", "mentions"), n_topics, n_terms)

Arguments

handle

twitter handle without the @ sign

data_source

either timeline or mentions

n_topics

how many topics to model

n_terms

how many of the most salient terms to include for each topic

Details

The json file is included in the output if you want to visualize with LDAvis or plots can be made with the x_phi output.

Value

.rds file - x_phi is scaled x,y coordinates for topics, term_info is the top n terms; both are based on lambda - 0.6; json is the json object from LDAvis package

Examples

## Not run: 
run_btm("BMWUSA", data_source = 'timeline', n_topics = 40, n_terms = 30)

## End(Not run)

taylorgrant/twAccount documentation built on March 20, 2022, 7:33 p.m.