Takes the result of sframe_run_stm_topics() (not a raw stm model
object) and, for each topic, pulls the top n_quotes documents by
topic-document probability using stm::findThoughts(), then maps each
one back to its original respondent row via the mapping
sframe_run_stm_topics() stored on result$fit.
Arguments
- model
A
stm_topicsresult list fromsframe_run_stm_topics()(i.e.result, notresult$fitand not the rawstmobject).- text
The response vector the topic model was fit on: either the raw vector (one entry per original data row, indexed 1:1 by row number) or the
clean_text_responses()-cleaned vector, which drops blank/missing rows and is therefore shorter, its positions no longer equal original row numbers once any earlier row was dropped. Both forms work correctly: whentextcarries therespondentattributeclean_text_responses()sets, that mapping is used to find each quote's real position; otherwisetextis assumed to be the raw, 1:1-indexed vector.- n_quotes
Integer. Quotes to return per topic. Default
3L.