topics_terms_map: Extract a mapping between topics and representative topic...

Description Usage Arguments Details Value

View source: R/topic-extract.R

Description

The primary purpose of topics_terms_map is to provide an association between topics (by ID) and a representative set of words (terms) for a given topic. These can be used to create labels for visualizations.

Usage

1
topics_terms_map(topicModel, nLabelTerms = 7, labelType = "frex")

Arguments

topicModel

an stm topic model

nLabelTerms

the number of terms to be included as a label for a given topic; default is 7.

labelType

the stm word weighting used to determine the words most representative of a topic; default is "frex" (most frequent and exclusive terms). Other options are "prob", "lift", "score" (see stm::labelTopics for details)

Details

By default the terms that are both most frequent and exclusive are used (see stm for details).

Value

a dataframe with topics by ID and a selection of associated topic terms, where:

topic_id

a numeric identifier of a topic

topic_label

a character sequence of frequent and exclusive terms associated with a topic


sdaume/topicsplorrr documentation built on Dec. 22, 2021, 11:11 p.m.