predict_topic: Apply a STM to a new corpus

Description Usage Arguments Value Author(s) See Also

View source: R/predict_topic.R

Description

Apply a topic model to a new corpus of documents.

Usage

1
2
3
4
5
6
7
predict_topic(
  bow,
  topic_model,
  keywords = NULL,
  min_gamma = 0.1,
  min_common = 1
)

Arguments

bow

Tibble. Bag of words as returned by the function create_bow

topic_model

List. Structural topic model as returned by the function create_stm.

keywords

Tibble. One variable specifying the "document", one variable containing the "keywords" as a character vector.

min_gamma

Numeric. Minimum strength of the relationship between topic and document.

min_common

Integer. Maximum number of topics allowed per document.

Value

A tibble linking topics and documents for a new corpus.

Author(s)

Nicolas Mangin

See Also

create_bow

create_stm


NicolasJBM/lexR documentation built on Feb. 4, 2021, 6:43 p.m.